get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 44998,
    "url": "http://patches.dpdk.org/api/patches/44998/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1537434339-22570-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": "<1537434339-22570-4-git-send-email-amo@semihalf.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1537434339-22570-4-git-send-email-amo@semihalf.com",
    "date": "2018-09-20T09:05:34",
    "name": "[v5,3/8] net/mvneta: support for setting of MTU",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8874f52cc74926cfd61ecb3473025e8c075e1d01",
    "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/1537434339-22570-4-git-send-email-amo@semihalf.com/mbox/",
    "series": [
        {
            "id": 1410,
            "url": "http://patches.dpdk.org/api/series/1410/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1410",
            "date": "2018-09-20T09:05:31",
            "name": "Add Marvell NETA PMD",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/1410/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/44998/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/44998/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 6365D7CD2;\n\tThu, 20 Sep 2018 11:05:51 +0200 (CEST)",
            "from mail-lf1-f65.google.com (mail-lf1-f65.google.com\n\t[209.85.167.65]) by dpdk.org (Postfix) with ESMTP id 33EE55F36\n\tfor <dev@dpdk.org>; Thu, 20 Sep 2018 11:05:46 +0200 (CEST)",
            "by mail-lf1-f65.google.com with SMTP id m26-v6so7676215lfb.0\n\tfor <dev@dpdk.org>; Thu, 20 Sep 2018 02:05:46 -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\tg16-v6sm4338106lje.1.2018.09.20.02.05.44\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tThu, 20 Sep 2018 02:05:44 -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=FmlilUNGhHM7ewSaBbK4njhq6v2GxL2pKxDnXmcT+sc=;\n\tb=NaGO59fp8vdK0+0PgVBBUK18szsNaKZCbh2wJhRSvRC0C4SdEgrRSxx45PCpi+gb5c\n\tyI++RFWJQyFFpsirCQ25JFVL2c8xyqk4cmsvdM6PMCI8KaUpWQhKLMtBURUOh/fO/4wq\n\tk5Cu3wNuwvrs8ZyhT5StNOSB+nwIG36RZg5CBM35rRKryxOSCcU3UpuiKVYe68G0qFW8\n\tlulUJl4PzS5LvafjQpPZnplaVnFW16N0IV+BbsuETQsDztO0kNoiG42GM0gI7G73+yHm\n\ti//1x+GWNaOho4rb7aL4K2Y0Z9Gs0wwL0ySzlAOXpJN5oz7VGp4my7n+V2ixfyAYeC0F\n\tN8Wg==",
        "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=FmlilUNGhHM7ewSaBbK4njhq6v2GxL2pKxDnXmcT+sc=;\n\tb=r2+EeofRC7IuSn28E4dn+YJp00s6Q8q8xk5msBTU4KA2AN0ReZQnYkar37hTDiWsqt\n\tu5UmHshKHfK/5NmT04zBa0XMlWNH920sDWj2iCpw325alB9sU2tsebX/zWlswZrvKrPo\n\tgaJVYwwrautQO+b9JAQtFsCfa2+Ow/OzbDujeGUm8cFbg125f8n5UzFZf7mCro4lzwMH\n\t+2MXpbnlAp5daxCkWL+af3pDP0oT5ZmhvvYDy5r3uPsK5xfJIP+f2z3aE6naFNQnYwQV\n\tPK95xqeoPmgBe0z4e4Jq8rXTxTzWzHMUbMqTzR81CdS5HyvUGpKJKtlf+Q9fFn2qSjKc\n\t46qw==",
        "X-Gm-Message-State": "APzg51AvkZb3e5V99xqG9GnUUjqKkBwACu4ClotwYAzjB/uQ9Qt+0iNW\n\t8QKcr9z75mtMtVEi3iL8AXnx1iwIRZw=",
        "X-Google-Smtp-Source": "ANB0VdYaqYSQduGXBVYMCBeOnhjv2as5AClhyOSaym2/h3199BaPxsUyrGx0N/6RruksF2B1Vj2wEw==",
        "X-Received": "by 2002:a19:1588:: with SMTP id\n\t8-v6mr12403557lfv.36.1537434345327; \n\tThu, 20 Sep 2018 02:05:45 -0700 (PDT)",
        "From": "Andrzej Ostruszka <amo@semihalf.com>",
        "To": "dev@dpdk.org",
        "Cc": "mw@semihalf.com, zr@semihalf.com, tdu@semihalf.com, nadavh@marvell.com",
        "Date": "Thu, 20 Sep 2018 11:05:34 +0200",
        "Message-Id": "<1537434339-22570-4-git-send-email-amo@semihalf.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1537434339-22570-1-git-send-email-amo@semihalf.com>",
        "References": "<1537369294-17099-1-git-send-email-amo@semihalf.com>\n\t<1537434339-22570-1-git-send-email-amo@semihalf.com>",
        "Subject": "[dpdk-dev] [PATCH v5 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: Zyta Szpak <zr@semihalf.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 doc/guides/nics/features/mvneta.ini |  1 +\n doc/guides/nics/mvneta.rst          |  1 +\n drivers/net/mvneta/mvneta_ethdev.c  | 78 +++++++++++++++++++++++++++++++++++++\n 3 files changed, 80 insertions(+)",
    "diff": "diff --git a/doc/guides/nics/features/mvneta.ini b/doc/guides/nics/features/mvneta.ini\nindex 0a89e2f..bc4e400 100644\n--- a/doc/guides/nics/features/mvneta.ini\n+++ b/doc/guides/nics/features/mvneta.ini\n@@ -5,6 +5,7 @@\n ;\n [Features]\n Speed capabilities   = Y\n+MTU update           = Y\n Jumbo frame          = Y\n CRC offload          = Y\n L3 checksum offload  = Y\ndiff --git a/doc/guides/nics/mvneta.rst b/doc/guides/nics/mvneta.rst\nindex 9d25c40..55ffe57 100644\n--- a/doc/guides/nics/mvneta.rst\n+++ b/doc/guides/nics/mvneta.rst\n@@ -30,6 +30,7 @@ Features of the MVNETA PMD are:\n - tx/rx_burst\n - Speed capabilities\n - Jumbo frame\n+- MTU update\n - CRC offload\n - L3 checksum offload\n - L4 checksum offload\ndiff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c\nindex 331cd1d..1b26c87 100644\n--- a/drivers/net/mvneta/mvneta_ethdev.c\n+++ b/drivers/net/mvneta/mvneta_ethdev.c\n@@ -221,6 +221,77 @@ mvneta_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused)\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+\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]\", 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+\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+\t\treturn ret;\n+\t}\n+\tMVNETA_LOG(INFO, \"MTU changed to %u, MRU = %u\", mtu, mru);\n+\n+\treturn 0;\n+}\n+\n+/**\n  * DPDK callback to bring the link up.\n  *\n  * @param dev\n@@ -318,6 +389,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\", 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@@ -433,6 +510,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": [
        "v5",
        "3/8"
    ]
}