Show a patch.

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

{
    "id": 44059,
    "url": "http://patches.dpdk.org/api/patches/44059/?format=api",
    "web_url": "http://patches.dpdk.org/patch/44059/",
    "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"
    },
    "msgid": "<20180830223512.21297-5-stephen@networkplumber.org>",
    "date": "2018-08-30T22:35:11",
    "name": "[4/5] net/netvsc: implement link state change callback",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "33b48e1b805031e494b56071d279d2ecca534cdf",
    "submitter": {
        "id": 27,
        "url": "http://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@intel.com"
    },
    "mbox": "http://patches.dpdk.org/patch/44059/mbox/",
    "series": [
        {
            "id": 1120,
            "url": "http://patches.dpdk.org/api/series/1120/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1120",
            "date": "2018-08-30T22:35:07",
            "name": "netvsc changes for 18.11",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/1120/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/44059/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/44059/checks/",
    "tags": {},
    "headers": {
        "X-Mailer": "git-send-email 2.18.0",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=15fBkQEZKCUQzo2bzYGOcCv/ZrckLKSqQAa1y/5Etis=;\n\tb=I5dJ59sZykHRptA3RgDk6hkx69O9VTrETNgJxkAfZOlVIVfvdg+4356svid0c136sE\n\tBfLHkudqwmyCw2fWGzhLJAZtIl736/YndbBAplKQNPspb9kN+5vlBhanKhXHtBtMPQJO\n\tuKjDwN0kT4FkBqJ0APvf6nfSRMRm917z3gsTa1XpUCipjDdcLBAb4YI/5P/YMrsgKTlk\n\tJnkAJsJaGdcEgcnZyxEsYS1MB0S68KXS7xbvuUmaZdtBD3IQENiU1Y197gZk6pQp8gCg\n\tDZkvg722RtoE4eN2XPSlcO2zAOnuxKGUbEajT2mF49fKS8kXod+cErCZQVKtvUelaHbZ\n\thEog==",
        "X-Mailman-Version": "2.1.15",
        "Delivered-To": "patchwork@dpdk.org",
        "X-Gm-Message-State": "APzg51BisAm0zxiLrVhdwnELzDuVuJFoKE3664dC5+e8OO4/XfWYzB0Y\n\tCDwRjzy6Q5KqhjjYsu3iXBstfQIdetNL3w==",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Cc": "Stephen Hemminger <sthemmin@microsoft.com>",
        "To": "dev@dpdk.org",
        "Errors-To": "dev-bounces@dpdk.org",
        "References": "<20180830223512.21297-1-stephen@networkplumber.org>",
        "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=15fBkQEZKCUQzo2bzYGOcCv/ZrckLKSqQAa1y/5Etis=;\n\tb=D5zrpVFIXnJgFNcuwl4OHt16udzGvrN7rGBeLRYtxMNJq5SkpINWR0yzPvOkuKFObe\n\t0SR5d9zuUVy3xL+HuicxZ2BkcVBhMUMnABjHVGVW8FoRXEbW3AI44SEp/krSj8UFnzxO\n\tDP8RQI6XMNFqBnNLxb5wzSlqg2MDpmIeY+uYq+F1WgcQd8c5R+WqE7apRRA9nHxa/HQi\n\til5mRl8MdBbXoYAvND72bvmcg2UEZb6HpmZi445QUD5vMaD1ZGcXxpxayT6I+UHNC4UA\n\tKLQj/armZfpN4JhV43pqWgNnHdH1+D9G5/d2M6E0N8YCX7e7FNBZTXbV4ON90bUsLb59\n\ty/ww==",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id D254F5F36;\n\tFri, 31 Aug 2018 00:35:31 +0200 (CEST)",
            "from mail-pg1-f194.google.com (mail-pg1-f194.google.com\n\t[209.85.215.194]) by dpdk.org (Postfix) with ESMTP id 1DE345F16\n\tfor <dev@dpdk.org>; Fri, 31 Aug 2018 00:35:26 +0200 (CEST)",
            "by mail-pg1-f194.google.com with SMTP id y3-v6so3303019pgv.0\n\tfor <dev@dpdk.org>; Thu, 30 Aug 2018 15:35:26 -0700 (PDT)",
            "from xeon-e3.lan (204-195-22-127.wavecable.com. [204.195.22.127])\n\tby smtp.gmail.com with ESMTPSA id\n\tr19-v6sm11746033pgg.39.2018.08.30.15.35.23\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 30 Aug 2018 15:35:23 -0700 (PDT)"
        ],
        "Date": "Thu, 30 Aug 2018 15:35:11 -0700",
        "X-Received": "by 2002:a62:7590:: with SMTP id\n\tq138-v6mr4882673pfc.148.1535668524393; \n\tThu, 30 Aug 2018 15:35:24 -0700 (PDT)",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH 4/5] net/netvsc: implement link state change\n\tcallback",
        "In-Reply-To": "<20180830223512.21297-1-stephen@networkplumber.org>",
        "Message-Id": "<20180830223512.21297-5-stephen@networkplumber.org>",
        "Precedence": "list",
        "X-BeenThere": "dev@dpdk.org",
        "X-Original-To": "patchwork@dpdk.org",
        "X-Google-Smtp-Source": "ANB0VdZXI6iimy30jYve9A9HeZ9LlSpJOY55zC/K9hXGqs8Hl+M07nCaE+yvT1O8A/50Ns2NsadrCg=="
    },
    "content": "From: Stephen Hemminger <sthemmin@microsoft.com>\n\nImplement callback functionality on link state changes.\nThis is not really driven off of interrupt file descriptor like most other\nPMD's. Instead, it happens when a link state change message arrives\nin the common ring buffer.\n\nSigned-off-by: Stephen Hemminger <sthemmin@microsoft.com>\n---\n doc/guides/nics/netvsc.rst     |  3 ++-\n drivers/net/netvsc/hn_ethdev.c | 12 +++++-------\n drivers/net/netvsc/hn_rndis.c  | 11 ++++++++---\n drivers/net/netvsc/hn_rndis.h  |  2 +-\n drivers/net/netvsc/hn_rxtx.c   |  4 ++--\n drivers/net/netvsc/hn_var.h    |  1 +\n 6 files changed, 19 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/netvsc.rst b/doc/guides/nics/netvsc.rst\nindex cc07ce46f885..c5f9b7c6fa1e 100644\n--- a/doc/guides/nics/netvsc.rst\n+++ b/doc/guides/nics/netvsc.rst\n@@ -28,7 +28,8 @@ In this release, the hyper PMD driver provides the basic functionality of packet\n \n *   VLAN tags are always stripped and presented in mbuf tci field.\n \n-*   The Hyper-V driver does not use or support Link State or Rx interrupt.\n+*   The Hyper-V driver does not use or support interrupts. Link state change\n+    callback is done via change events in the packet ring.\n \n *   The maximum number of queues is limited by the host (currently 64).\n     When used with 4.16 kernel only a single queue is available.\ndiff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c\nindex 8643e0b3c057..63e04a453546 100644\n--- a/drivers/net/netvsc/hn_ethdev.c\n+++ b/drivers/net/netvsc/hn_ethdev.c\n@@ -107,6 +107,10 @@ eth_dev_vmbus_allocate(struct rte_vmbus_device *dev, size_t private_data_size)\n \t}\n \n \teth_dev->device = &dev->device;\n+\n+\t/* interrupt is simulated */\n+\tdev->intr_handle.type = RTE_INTR_HANDLE_EXT;\n+\teth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;\n \teth_dev->intr_handle = &dev->intr_handle;\n \n \treturn eth_dev;\n@@ -187,7 +191,7 @@ static int hn_parse_args(const struct rte_eth_dev *dev)\n  *   means block this call until link is up.\n  *   which is not worth supporting.\n  */\n-static int\n+int\n hn_dev_link_update(struct rte_eth_dev *dev,\n \t\t   __rte_unused int wait_to_complete)\n {\n@@ -554,12 +558,6 @@ hn_dev_start(struct rte_eth_dev *dev)\n \n \tPMD_INIT_FUNC_TRACE();\n \n-\t/* check if lsc interrupt feature is enabled */\n-\tif (dev->data->dev_conf.intr_conf.lsc) {\n-\t\tPMD_DRV_LOG(ERR, \"link status not supported yet\");\n-\t\treturn -ENOTSUP;\n-\t}\n-\n \treturn hn_rndis_set_rxfilter(hv,\n \t\t\t\t     NDIS_PACKET_TYPE_BROADCAST |\n \t\t\t\t     NDIS_PACKET_TYPE_ALL_MULTICAST |\ndiff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c\nindex f44add726b91..a5d205ce2636 100644\n--- a/drivers/net/netvsc/hn_rndis.c\n+++ b/drivers/net/netvsc/hn_rndis.c\n@@ -11,6 +11,7 @@\n #include <errno.h>\n #include <unistd.h>\n \n+#include <rte_ethdev_driver.h>\n #include <rte_ethdev.h>\n #include <rte_string_fns.h>\n #include <rte_memzone.h>\n@@ -281,7 +282,7 @@ static int hn_nvs_send_rndis_ctrl(struct vmbus_channel *chan,\n \t\t\t\t  &nvs_rndis, sizeof(nvs_rndis), 0U, NULL);\n }\n \n-void hn_rndis_link_status(struct hn_data *hv __rte_unused, const void *msg)\n+void hn_rndis_link_status(struct rte_eth_dev *dev, const void *msg)\n {\n \tconst struct rndis_status_msg *indicate = msg;\n \n@@ -290,15 +291,19 @@ void hn_rndis_link_status(struct hn_data *hv __rte_unused, const void *msg)\n \tPMD_DRV_LOG(DEBUG, \"link status %#x\", indicate->status);\n \n \tswitch (indicate->status) {\n-\tcase RNDIS_STATUS_LINK_SPEED_CHANGE:\n \tcase RNDIS_STATUS_NETWORK_CHANGE:\n \tcase RNDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG:\n \t\t/* ignore not in DPDK API */\n \t\tbreak;\n \n+\tcase RNDIS_STATUS_LINK_SPEED_CHANGE:\n \tcase RNDIS_STATUS_MEDIA_CONNECT:\n \tcase RNDIS_STATUS_MEDIA_DISCONNECT:\n-\t\t/* TODO handle as LSC interrupt  */\n+\t\tif (dev->data->dev_conf.intr_conf.lsc &&\n+\t\t    hn_dev_link_update(dev, 0) == 0)\n+\t\t\t_rte_eth_dev_callback_process(dev,\n+\t\t\t\t\t\t      RTE_ETH_EVENT_INTR_LSC,\n+\t\t\t\t\t\t      NULL);\n \t\tbreak;\n \tdefault:\n \t\tPMD_DRV_LOG(NOTICE, \"unknown RNDIS indication: %#x\",\ndiff --git a/drivers/net/netvsc/hn_rndis.h b/drivers/net/netvsc/hn_rndis.h\nindex 89e2e6ba0fcb..01b5120631b1 100644\n--- a/drivers/net/netvsc/hn_rndis.h\n+++ b/drivers/net/netvsc/hn_rndis.h\n@@ -6,7 +6,7 @@ struct hn_data;\n \n void hn_rndis_receive_response(struct hn_data *hv,\n \t\t\t      const void *data, uint32_t len);\n-void\thn_rndis_link_status(struct hn_data *hv, const void *data);\n+void\thn_rndis_link_status(struct rte_eth_dev *dev, const void *msg);\n int\thn_rndis_attach(struct hn_data *hv);\n void\thn_rndis_detach(struct hn_data *hv);\n int\thn_rndis_get_eaddr(struct hn_data *hv, uint8_t *eaddr);\ndiff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c\nindex 92de5d09e442..ad22a95f6c27 100644\n--- a/drivers/net/netvsc/hn_rxtx.c\n+++ b/drivers/net/netvsc/hn_rxtx.c\n@@ -601,7 +601,7 @@ static void hn_rndis_rx_data(struct hn_rx_queue *rxq,\n }\n \n static void\n-hn_rndis_receive(const struct rte_eth_dev *dev, struct hn_rx_queue *rxq,\n+hn_rndis_receive(struct rte_eth_dev *dev, struct hn_rx_queue *rxq,\n \t\t struct hn_rx_bufinfo *rxb, void *buf, uint32_t len)\n {\n \tconst struct rndis_msghdr *hdr = buf;\n@@ -613,7 +613,7 @@ hn_rndis_receive(const struct rte_eth_dev *dev, struct hn_rx_queue *rxq,\n \t\tbreak;\n \n \tcase RNDIS_INDICATE_STATUS_MSG:\n-\t\thn_rndis_link_status(rxq->hv, buf);\n+\t\thn_rndis_link_status(dev, buf);\n \t\tbreak;\n \n \tcase RNDIS_INITIALIZE_CMPLT:\ndiff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h\nindex ff722560d9d9..17b67941dc83 100644\n--- a/drivers/net/netvsc/hn_var.h\n+++ b/drivers/net/netvsc/hn_var.h\n@@ -142,6 +142,7 @@ uint16_t hn_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\n \t\t      uint16_t nb_pkts);\n \n int\thn_tx_pool_init(struct rte_eth_dev *dev);\n+int\thn_dev_link_update(struct rte_eth_dev *dev, int wait);\n int\thn_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,\n \t\t\t      uint16_t nb_desc, unsigned int socket_id,\n \t\t\t      const struct rte_eth_txconf *tx_conf);\n",
    "prefixes": [
        "4/5"
    ]
}