get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/43932/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 43932,
    "url": "http://patches.dpdk.org/api/patches/43932/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1535469030-18647-4-git-send-email-amo@semihalf.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1535469030-18647-4-git-send-email-amo@semihalf.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1535469030-18647-4-git-send-email-amo@semihalf.com",
    "date": "2018-08-28T15:10:25",
    "name": "[3/8] net/mvneta: support for setting of MTU",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b21cddc2056211f4477373ce31f5f63214fa6519",
    "submitter": {
        "id": 1112,
        "url": "http://patches.dpdk.org/api/people/1112/?format=api",
        "name": "Andrzej Ostruszka",
        "email": "amo@semihalf.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1535469030-18647-4-git-send-email-amo@semihalf.com/mbox/",
    "series": [
        {
            "id": 1080,
            "url": "http://patches.dpdk.org/api/series/1080/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1080",
            "date": "2018-08-28T15:10:22",
            "name": "Add Marvell NETA PMD",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/1080/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/43932/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/43932/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id F25514D3A;\n\tTue, 28 Aug 2018 17:10:40 +0200 (CEST)",
            "from mail-lf1-f67.google.com (mail-lf1-f67.google.com\n\t[209.85.167.67]) by dpdk.org (Postfix) with ESMTP id 3DBE737B7\n\tfor <dev@dpdk.org>; Tue, 28 Aug 2018 17:10:36 +0200 (CEST)",
            "by mail-lf1-f67.google.com with SMTP id i7-v6so1679525lfh.5\n\tfor <dev@dpdk.org>; Tue, 28 Aug 2018 08:10:36 -0700 (PDT)",
            "from amok.semihalf.local (31-172-191-173.noc.fibertech.net.pl.\n\t[31.172.191.173]) by smtp.googlemail.com with ESMTPSA id\n\tp28-v6sm260685ljp.90.2018.08.28.08.10.34\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tTue, 28 Aug 2018 08:10:34 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=semihalf-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=YyfLpC6lNrIch6RXGL+dHCQjCFR2LhIgmto9vd+MhfI=;\n\tb=sR9nh5YDPKq/wvAGsOhljV/F4BTWiieeEZHVZgjpn6SQ475aUpXC58sB2YlmPU+tIA\n\tosnuSBKNo6Bw2JN/Ne7ko1sh9oke1hqbcDzHxtGVWHhTHHZ5jqbH8d7qESp9eCHG4ToX\n\t/+qDjDzaX9Iekqxj6DVNfGvznhUlJEf5tECarh1OP0ihXqqoyrjwQ2bjyFGuc/pSxLID\n\tXR8j1rS+opEmWTBfF1qplFaMR3vtfsIgee2gbZJu7bljVPkWNO75BN4un05vqUK0+TdA\n\tpdQKiQ3bwRXIhAaOeMVi0YVsD4ne3Kbld6s2EjCF4llh/ogwP4zPC0NgeCi4YFcoi6NM\n\tWs5Q==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=YyfLpC6lNrIch6RXGL+dHCQjCFR2LhIgmto9vd+MhfI=;\n\tb=eY6aoMiGAk92cdfLbP4Fhs8XfdWfcl/PIF1sfNlVa7Vhc1DWR8KCqTevgRniRpfOuA\n\tDPjpjMbU+KT/MkvXQ9mOgeMIuqamyMmYq8yA/MWDzIeOCz9Ndescfi0RIf0/Q31TxKZa\n\tz3eYnzYefsBNJaAg923re+ltSzUOCFuAlWU/IuqZqjDrmxUx/JMq1EAofSXlb1K5xvVS\n\t3cJY6sWKf2g/8E9QIc5Nbj6QQZRUjf/3hK5XJa8qK7n8D6clLgu5JLRvkahURmaxmGtB\n\tBT35ZVJN52paHKkM6iULbIscPBgkMSjY6OTjbgZ/aAPAsUBCh3fVDo6b9OET/hHK+rfq\n\tJBMA==",
        "X-Gm-Message-State": "APzg51DStEdwHYVKo/YViRbnczxmjl0AP1i28ol6vpN8clR+MLShRKRZ\n\tIbQl0a/kKTwPuHEgwfpFzlbwMeYgiDY=",
        "X-Google-Smtp-Source": "ANB0VdbDPjjvdjUxu8qxOgR57SrukZKNimk9LnzQTMAv42T9nYsizGNNcHlO6YOyn9w7J1Nv7iw97w==",
        "X-Received": "by 2002:a19:6d12:: with SMTP id\n\ti18-v6mr1548854lfc.72.1535469035630; \n\tTue, 28 Aug 2018 08:10:35 -0700 (PDT)",
        "From": "Andrzej Ostruszka <amo@semihalf.com>",
        "To": "dev@dpdk.org",
        "Cc": "nsamsono@marvell.com",
        "Date": "Tue, 28 Aug 2018 17:10:25 +0200",
        "Message-Id": "<1535469030-18647-4-git-send-email-amo@semihalf.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1535469030-18647-1-git-send-email-amo@semihalf.com>",
        "References": "<1535469030-18647-1-git-send-email-amo@semihalf.com>",
        "Subject": "[dpdk-dev] [PATCH 3/8] net/mvneta: support for setting of MTU",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Natalie Samsonov <nsamsono@marvell.com>\n\nAdd callback for setting of MTU.\n\nSigned-off-by: Natalie Samsonov <nsamsono@marvell.com>\nSigned-off-by: Zyta Szpak <zr@semihalf.com>\n---\n drivers/net/mvneta/mvneta_ethdev.c | 78 ++++++++++++++++++++++++++++++++++++++\n 1 file changed, 78 insertions(+)",
    "diff": "diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c\nindex a480b14..eded4eb 100644\n--- a/drivers/net/mvneta/mvneta_ethdev.c\n+++ b/drivers/net/mvneta/mvneta_ethdev.c\n@@ -1032,6 +1032,77 @@ static void mvneta_txq_info_get(struct rte_eth_dev *dev, uint16_t tx_queue_id,\n }\n \n /**\n+ * DPDK callback to change the MTU.\n+ *\n+ * Setting the MTU affects hardware MRU (packets larger than the MRU\n+ * will be dropped).\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device structure.\n+ * @param mtu\n+ *   New MTU.\n+ *\n+ * @return\n+ *   0 on success, negative error value otherwise.\n+ */\n+static int\n+mvneta_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)\n+{\n+\tstruct mvneta_priv *priv = dev->data->dev_private;\n+\tuint16_t mbuf_data_size = 0; /* SW buffer size */\n+\tuint16_t mru;\n+\tint ret;\n+\n+\tmru = MRVL_NETA_MTU_TO_MRU(mtu);\n+\t/*\n+\t * min_rx_buf_size is equal to mbuf data size\n+\t * if pmd didn't set it differently\n+\t */\n+\tmbuf_data_size = dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM;\n+\t/* Prevent PMD from:\n+\t * - setting mru greater than the mbuf size resulting in\n+\t * hw and sw buffer size mismatch\n+\t * - setting mtu that requires the support of scattered packets\n+\t * when this feature has not been enabled/supported so far.\n+\t */\n+\tif (!dev->data->scattered_rx &&\n+\t    (mru + MRVL_NETA_PKT_OFFS > mbuf_data_size)) {\n+\t\tmru = mbuf_data_size - MRVL_NETA_PKT_OFFS;\n+\t\tmtu = MRVL_NETA_MRU_TO_MTU(mru);\n+\t\tMVNETA_LOG(WARNING, \"MTU too big, max MTU possible limitted by\"\n+\t\t\t\" current mbuf size: %u. Set MTU to %u, MRU to %u\\n\",\n+\t\t\tmbuf_data_size, mtu, mru);\n+\t}\n+\n+\tif (mtu < ETHER_MIN_MTU || mru > MVNETA_PKT_SIZE_MAX) {\n+\t\tMVNETA_LOG(ERR, \"Invalid MTU [%u] or MRU [%u]\\n\", mtu, mru);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tdev->data->mtu = mtu;\n+\tdev->data->dev_conf.rxmode.max_rx_pkt_len = mru - MV_MH_SIZE;\n+\n+\tif (!priv->ppio)\n+\t\t/* It is OK. New MTU will be set later on mvneta_dev_start */\n+\t\treturn 0;\n+\n+\tret = neta_ppio_set_mru(priv->ppio, mru);\n+\tif (ret) {\n+\t\tMVNETA_LOG(ERR, \"Failed to change MRU\\n\");\n+\t\treturn ret;\n+\t}\n+\n+\tret = neta_ppio_set_mtu(priv->ppio, mtu);\n+\tif (ret) {\n+\t\tMVNETA_LOG(ERR, \"Failed to change MTU\\n\");\n+\t\treturn ret;\n+\t}\n+\tMVNETA_LOG(INFO, \"MTU changed to %u, MRU = %u\\n\", mtu, mru);\n+\n+\treturn 0;\n+}\n+\n+/**\n  * DPDK callback to bring the link up.\n  *\n  * @param dev\n@@ -1305,6 +1376,12 @@ mvneta_dev_start(struct rte_eth_dev *dev)\n \t\t}\n \t}\n \n+\tret = mvneta_mtu_set(dev, dev->data->mtu);\n+\tif (ret) {\n+\t\tMVNETA_LOG(ERR, \"Failed to set MTU %d\\n\", dev->data->mtu);\n+\t\tgoto out;\n+\t}\n+\n \tret = mvneta_dev_set_link_up(dev);\n \tif (ret) {\n \t\tMVNETA_LOG(ERR, \"Failed to set link up\\n\");\n@@ -1420,6 +1497,7 @@ static const struct eth_dev_ops mvneta_ops = {\n \t.dev_set_link_down = mvneta_dev_set_link_down,\n \t.dev_close = mvneta_dev_close,\n \t.mac_addr_set = mvneta_mac_addr_set,\n+\t.mtu_set = mvneta_mtu_set,\n \t.dev_infos_get = mvneta_dev_infos_get,\n \t.dev_supported_ptypes_get = mvneta_dev_supported_ptypes_get,\n \t.rxq_info_get = mvneta_rxq_info_get,\n",
    "prefixes": [
        "3/8"
    ]
}