get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 44105,
    "url": "http://patchwork.dpdk.org/api/patches/44105/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1535718368-15803-9-git-send-email-amo@semihalf.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<1535718368-15803-9-git-send-email-amo@semihalf.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1535718368-15803-9-git-send-email-amo@semihalf.com",
    "date": "2018-08-31T12:26:04",
    "name": "[v2,4/8] net/mvneta: support for setting of MTU",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": true,
    "hash": "bbe1edd1a361bbab7aba011c2ad3b33a4f662aad",
    "submitter": {
        "id": 1112,
        "url": "http://patchwork.dpdk.org/api/people/1112/?format=api",
        "name": "Andrzej Ostruszka",
        "email": "amo@semihalf.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1535718368-15803-9-git-send-email-amo@semihalf.com/mbox/",
    "series": [
        {
            "id": 1135,
            "url": "http://patchwork.dpdk.org/api/series/1135/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=1135",
            "date": "2018-08-31T12:26:04",
            "name": null,
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/1135/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/44105/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/44105/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 230125F16;\n\tFri, 31 Aug 2018 14:26:30 +0200 (CEST)",
            "from mail-lf1-f66.google.com (mail-lf1-f66.google.com\n\t[209.85.167.66]) by dpdk.org (Postfix) with ESMTP id 624D95911\n\tfor <dev@dpdk.org>; Fri, 31 Aug 2018 14:26:20 +0200 (CEST)",
            "by mail-lf1-f66.google.com with SMTP id x26-v6so9830899lfi.7\n\tfor <dev@dpdk.org>; Fri, 31 Aug 2018 05:26:20 -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\tt4-v6sm1825422lfd.13.2018.08.31.05.26.18\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tFri, 31 Aug 2018 05:26:19 -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=a+Cta85EWUKpT64PU8UyNVUyMG8cM3zlt4ooWDcXcnY=;\n\tb=OVmdDB6EWcD/w9D5ZYJqGYghs4IzYEqh1nGrzy6vv6AGtj8ReLZC7jMe0gwJHUKcmA\n\tbpZdYeylf1OhAdeqNfgV4No7QxgcJ4XkntetoZQiPvmjA6QWJHu1UMetEHnMltiq/c1X\n\tFKKj4mIcaTTP4Vk7SD8zfVnJUoV494/tPX3fnq7iNRJkhlXMKxCvmyCag21Eoasq7m2i\n\teJ78DVLAAj6IAbu9R3NOQzfXMQWRTwSvPB0v66F9xufHzX1So1VFArTjbzl1IEpazD90\n\te1Ejclptg0CcigxAEwEj7byXzzFnRbz7bPkenogmN6mAHWu4NQWwJutrscmdeO2iCJoL\n\tAEOw==",
        "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=a+Cta85EWUKpT64PU8UyNVUyMG8cM3zlt4ooWDcXcnY=;\n\tb=iTfEvrJtjFRGnFtfVxP96A9onBED1dHh1x+xgGuFHwmYJvWOml+nppMzEMBBdpgPoD\n\t9WCQ3dAT4IvCFXYPsSfmA4qgqldSK6/5t8jmMx4x0X/uNYArdYZukR8sg9b3bH1E50hr\n\t3bd+U7mfPHa3XKytdjLHBGMb0qUONHfzB2vnHqIPi0ezOeX430OSofmICZ0ndd3OcNcO\n\tmpDYbmd6wmDo7cRowStz+fs+c4gczVdQ/OYqnJO81rxJ2/54fX5bdOeZJYIXqiCnvju5\n\tJP2LVQOGTOXcvdbsipfA91gc8EjzpKNbYjlN1C5TtxUWbziGmv5iGqFi2+NZ4s7SVx2L\n\tzFhQ==",
        "X-Gm-Message-State": "APzg51C/jbsMXdEg92b/WW02cz6O9PoJX/DkWRFjyr8Jx7rWGaXiDgO8\n\tqxIfJku4uqN22iGrcE4DbMGCAUntavc=",
        "X-Google-Smtp-Source": "ANB0VdZD+01m+cS3D0WaAb5hSQeTS71IfedDcL8oBRlfEE5vrrAFo2Fy6H7IoPMdKoOUzRN4hbAMSQ==",
        "X-Received": "by 2002:ac2:428f:: with SMTP id\n\tm15-v6mr10017377lfh.52.1535718379895; \n\tFri, 31 Aug 2018 05:26:19 -0700 (PDT)",
        "From": "Andrzej Ostruszka <amo@semihalf.com>",
        "To": "dev@dpdk.org",
        "Cc": "mw@semihalf.com, zr@semihalf.com, tdu@semihalf.com, nsamsono@marvell.com",
        "Date": "Fri, 31 Aug 2018 14:26:04 +0200",
        "Message-Id": "<1535718368-15803-9-git-send-email-amo@semihalf.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1535718368-15803-1-git-send-email-amo@semihalf.com>",
        "References": "<1535469030-18647-1-git-send-email-amo@semihalf.com>\n\t<1535718368-15803-1-git-send-email-amo@semihalf.com>",
        "Subject": "[dpdk-dev] [PATCH v2 4/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 drivers/net/mvneta/mvneta_ethdev.c | 149 +++++++++++++++++++++++++++++++++++++\n 1 file changed, 149 insertions(+)",
    "diff": "diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c\nindex 968f920..a7e79ea 100644\n--- a/drivers/net/mvneta/mvneta_ethdev.c\n+++ b/drivers/net/mvneta/mvneta_ethdev.c\n@@ -1025,6 +1025,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+\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@@ -1298,6 +1369,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@@ -1380,6 +1457,76 @@ mvneta_dev_close(struct rte_eth_dev *dev)\n }\n \n /**\n+ * DPDK callback to retrieve physical link information.\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device structure.\n+ * @param wait_to_complete\n+ *   Wait for request completion (ignored).\n+ *\n+ * @return\n+ *   0 on success, negative error value otherwise.\n+ */\n+static int\n+mvneta_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)\n+{\n+\t/*\n+\t * TODO\n+\t * once MUSDK provides necessary API use it here\n+\t */\n+\tstruct mvneta_priv *priv = dev->data->dev_private;\n+\tstruct ethtool_cmd edata;\n+\tstruct ifreq req;\n+\tint ret, fd, link_up;\n+\n+\tif (!priv->ppio)\n+\t\treturn -EPERM;\n+\n+\tedata.cmd = ETHTOOL_GSET;\n+\n+\tstrcpy(req.ifr_name, dev->data->name);\n+\treq.ifr_data = (void *)&edata;\n+\n+\tfd = socket(AF_INET, SOCK_DGRAM, 0);\n+\tif (fd == -1)\n+\t\treturn -EFAULT;\n+\tret = ioctl(fd, SIOCETHTOOL, &req);\n+\tif (ret == -1) {\n+\t\tclose(fd);\n+\t\treturn -EFAULT;\n+\t}\n+\n+\tclose(fd);\n+\n+\tswitch (ethtool_cmd_speed(&edata)) {\n+\tcase SPEED_10:\n+\t\tdev->data->dev_link.link_speed = ETH_SPEED_NUM_10M;\n+\t\tbreak;\n+\tcase SPEED_100:\n+\t\tdev->data->dev_link.link_speed = ETH_SPEED_NUM_100M;\n+\t\tbreak;\n+\tcase SPEED_1000:\n+\t\tdev->data->dev_link.link_speed = ETH_SPEED_NUM_1G;\n+\t\tbreak;\n+\tcase SPEED_2500:\n+\t\tdev->data->dev_link.link_speed = ETH_SPEED_NUM_2_5G;\n+\t\tbreak;\n+\tdefault:\n+\t\tdev->data->dev_link.link_speed = ETH_SPEED_NUM_NONE;\n+\t}\n+\n+\tdev->data->dev_link.link_duplex = edata.duplex ? ETH_LINK_FULL_DUPLEX :\n+\t\t\t\t\t\t\t ETH_LINK_HALF_DUPLEX;\n+\tdev->data->dev_link.link_autoneg = edata.autoneg ? ETH_LINK_AUTONEG :\n+\t\t\t\t\t\t\t   ETH_LINK_FIXED;\n+\n+\tneta_ppio_get_link_state(priv->ppio, &link_up);\n+\tdev->data->dev_link.link_status = link_up ? ETH_LINK_UP : ETH_LINK_DOWN;\n+\n+\treturn 0;\n+}\n+\n+/**\n  * DPDK callback to set the primary MAC address.\n  *\n  * @param dev\n@@ -1412,7 +1559,9 @@ static const struct eth_dev_ops mvneta_ops = {\n \t.dev_set_link_up = mvneta_dev_set_link_up,\n \t.dev_set_link_down = mvneta_dev_set_link_down,\n \t.dev_close = mvneta_dev_close,\n+\t.link_update = mvneta_link_update,\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": [
        "v2",
        "4/8"
    ]
}