Show a patch.

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

{
    "id": 44104,
    "url": "http://patches.dpdk.org/api/patches/44104/",
    "web_url": "http://patches.dpdk.org/patch/44104/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<1535718368-15803-8-git-send-email-amo@semihalf.com>",
    "date": "2018-08-31T12:26:03",
    "name": "[v2,4/8] net/mvneta: add link update",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "fbfab796905876357d765f4f1f56c23494806ed8",
    "submitter": {
        "id": 1112,
        "url": "http://patches.dpdk.org/api/people/1112/",
        "name": "Andrzej Ostruszka",
        "email": "amo@semihalf.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@intel.com"
    },
    "mbox": "http://patches.dpdk.org/patch/44104/mbox/",
    "series": [
        {
            "id": 1131,
            "url": "http://patches.dpdk.org/api/series/1131/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1131",
            "date": "2018-08-31T12:25:56",
            "name": "Add Marvell NETA PMD",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/1131/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/44104/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/44104/checks/",
    "tags": {},
    "headers": {
        "X-Mailman-Version": "2.1.15",
        "In-Reply-To": "<1535718368-15803-1-git-send-email-amo@semihalf.com>",
        "Errors-To": "dev-bounces@dpdk.org",
        "X-Mailer": "git-send-email 2.7.4",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 067325F0F;\n\tFri, 31 Aug 2018 14:26:28 +0200 (CEST)",
            "from mail-lj1-f194.google.com (mail-lj1-f194.google.com\n\t[209.85.208.194]) by dpdk.org (Postfix) with ESMTP id 2FEA95911\n\tfor <dev@dpdk.org>; Fri, 31 Aug 2018 14:26:19 +0200 (CEST)",
            "by mail-lj1-f194.google.com with SMTP id 203-v6so9889227ljj.13\n\tfor <dev@dpdk.org>; Fri, 31 Aug 2018 05:26:19 -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.17\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tFri, 31 Aug 2018 05:26:17 -0700 (PDT)"
        ],
        "References": "<1535469030-18647-1-git-send-email-amo@semihalf.com>\n\t<1535718368-15803-1-git-send-email-amo@semihalf.com>",
        "X-Google-Smtp-Source": "ANB0VdZdrqXclV55juAWe3FJofcGjsthapcS8+Kd+Xj1kF0sYYQqBXn3UNnlIqjdFQW7pvKziiy2Mw==",
        "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=fxCLrocOWbc7MOZOFrOcijmE75rnX73Ghlb+m3TTN4A=;\n\tb=vvzjwRnLZaDU3I5vjAh5BFUciUUHQBF2HXhXp+zHN/rj5Fh5jMMKO0tB+SeQqzvKvw\n\tiS/cXYi3RUHnKqg24fI/DrgcRMin132Ql7JrJo4KbtfRmwvRwq0h6qnmJNkwDJ+9Qf/O\n\tyCiLFmBx4oJvSM6oOGE/5VOa09fgN8mFyRgHEDxpqrqfpVZRpMFbgNZVfE10zbePz7LJ\n\twrLe2jcAINNdpdMDL1fK/wBwTYkxg3Ma2uOtiiHkq6p2gKj+GETN8JAv3KCkNQ7oNJYh\n\tv6JrHUu+VU5QYXaNh/EXOpfUgSL1EuETlTQd5wq3kyEY4FjGd6VOYy41GxJK3qn6XfuO\n\tLUkA==",
        "X-BeenThere": "dev@dpdk.org",
        "X-Received": "by 2002:a2e:8257:: with SMTP id\n\tj23-v6mr9947710ljh.49.1535718378598; \n\tFri, 31 Aug 2018 05:26:18 -0700 (PDT)",
        "Message-Id": "<1535718368-15803-8-git-send-email-amo@semihalf.com>",
        "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=fxCLrocOWbc7MOZOFrOcijmE75rnX73Ghlb+m3TTN4A=;\n\tb=Ew0lrZevxF5QD9dQRRRU1kD6T5kmdkvZddPIlQ7D5BDOzItGg3h6dn6PzX4If4ldNB\n\t8uDo6UEJLJybDj5ZAlA85ePkRHwXy1NkxZs62QvngskEsRdoAbOqds/QX67GDORO/uip\n\t86EggxVGTZRhzqzPT/d16kllVMhKku9jAnPTm3zd4KGgw+nvRrKjb9AkSWsQQE4lqtjJ\n\t/u4m2H2UDtCu9qNROs4lFz16rdYZYSvrsiKzHQjFAUK0hrYn3/a6Vj4N7hq77woN2MS5\n\tvEuE3xXrBpafmPKzE6KZqJbZr1L20XcAzgD9jyQQuLonRSWXTyg1+D9tpSXUADDObJqZ\n\t/xKw==",
        "Delivered-To": "patchwork@dpdk.org",
        "Precedence": "list",
        "From": "Andrzej Ostruszka <amo@semihalf.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Sender": "\"dev\" <dev-bounces@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>",
        "To": "dev@dpdk.org",
        "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>",
        "Date": "Fri, 31 Aug 2018 14:26:03 +0200",
        "X-Gm-Message-State": "APzg51DxjoJc2k10bShO8ytGrMsxp8Y9gp/HN5o2cSxSNLiW5ua1uZaU\n\t9xmeiD3bwtpE5WyTwpi5/zH44XbBIBI=",
        "Cc": "mw@semihalf.com, zr@semihalf.com, tdu@semihalf.com, nsamsono@marvell.com",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Subject": "[dpdk-dev] [PATCH v2 4/8] net/mvneta: add link update"
    },
    "content": "From: Zyta Szpak <zr@semihalf.com>\n\nAdd callback for updating information about link status/info.\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 | 71 ++++++++++++++++++++++++++++++++++++++\n 1 file changed, 71 insertions(+)",
    "diff": "diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c\nindex 88d28f2..a7e79ea 100644\n--- a/drivers/net/mvneta/mvneta_ethdev.c\n+++ b/drivers/net/mvneta/mvneta_ethdev.c\n@@ -1457,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@@ -1489,6 +1559,7 @@ 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",
    "prefixes": [
        "v2",
        "4/8"
    ]
}