get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 44057,
    "url": "https://patches.dpdk.org/api/patches/44057/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20180830223512.21297-3-stephen@networkplumber.org/",
    "project": {
        "id": 1,
        "url": "https://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": "<20180830223512.21297-3-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180830223512.21297-3-stephen@networkplumber.org",
    "date": "2018-08-30T22:35:09",
    "name": "[2/5] net/netvsc: allow tuning latency with devargs",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "31819fe9230834521725f35cbca31fff12fedf38",
    "submitter": {
        "id": 27,
        "url": "https://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20180830223512.21297-3-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 1120,
            "url": "https://patches.dpdk.org/api/series/1120/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=1120",
            "date": "2018-08-30T22:35:07",
            "name": "netvsc changes for 18.11",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/1120/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/44057/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/44057/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 1C3985F1F;\n\tFri, 31 Aug 2018 00:35:28 +0200 (CEST)",
            "from mail-pf1-f193.google.com (mail-pf1-f193.google.com\n\t[209.85.210.193]) by dpdk.org (Postfix) with ESMTP id DE62B5F13\n\tfor <dev@dpdk.org>; Fri, 31 Aug 2018 00:35:22 +0200 (CEST)",
            "by mail-pf1-f193.google.com with SMTP id x17-v6so4534451pfh.5\n\tfor <dev@dpdk.org>; Thu, 30 Aug 2018 15:35:22 -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.20\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 30 Aug 2018 15:35:20 -0700 (PDT)"
        ],
        "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=KW+5S+oOCMAgwNoA7ctkJEK+xC7bsKZaj67Hbwz4vUI=;\n\tb=ddO/cm9Tf7/rBUA+VO00d2eZMtphyF/zziKNrJyjufU5Yc6xQP46PExBiCHXfIbpyz\n\tF+/Ka+vbxtupv1A6qggqu0WJVmRjedi1cXq2dUGuhVldP16g845Uoo9gJl1cBycaBk+i\n\t9fiW52ob28zECBv3gjl8uNUOqcgTkoVfEskVWjfLgpztVdNvjMlBfOWneJbwrQRJQb3K\n\tm9J3TEGVtXqlfdY9IGrLpj5gOifylN0y210Hu5WGylPuGA73M6kO0XBdasUUjd4a59U2\n\tSRqEqSa/2Py2oVJgOM6faWnRFMxXk0XcNj3g+3fgSS/vQoilUS14OMpl3niRhBIcDDk6\n\tIsUw==",
        "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=KW+5S+oOCMAgwNoA7ctkJEK+xC7bsKZaj67Hbwz4vUI=;\n\tb=TwHyYdmHKDs8IvXhb3ikEMUA1ArumuYLGHfyX++i7CTTh6pSxmyIz6pueLk+E0Zu4K\n\tX0BVL5cxYBUmRz5OzyIRmADBk6T0WDbzfp+WbQ7ms3R/4Ra6ORAywRGaTRQCjRx6aIxv\n\tjW429kn1q3atkVkNYy3Mr68bfPYrGiH2mDoAoKXU4VfHFFN52+teHZ1j6JKAuBEPT66q\n\tBMrSmzbFCTTo9AEU5A5zaz/4W7tXuJUUOvep3sG5ZuoK3vWOwU8RpNeVkQNJJJIw59kk\n\tKjdq6XDDj0Ab8XdggMg3NgsJXcw7vp6HcCJAR9AYTq8BIkJzzyDVMqSYvg8fxp2c+kUe\n\tgJ9w==",
        "X-Gm-Message-State": "APzg51BLP/yLy4v5/+6pgaaliHKsIIck6gUG8sTkWCSwFuB5hjfoZH9l\n\t3GerMh7PHm+enzZtHs+8bRS6e8MJj2DYKg==",
        "X-Google-Smtp-Source": "ANB0VdaZruckkbrIt78oonMg0leijOwGCB8uXJ+y4U5DmJtl0fF6bE/K5G6DcIxqg4ul1Xa92sdajQ==",
        "X-Received": "by 2002:a62:1f11:: with SMTP id\n\tf17-v6mr12585866pff.168.1535668521678; \n\tThu, 30 Aug 2018 15:35:21 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <sthemmin@microsoft.com>",
        "Date": "Thu, 30 Aug 2018 15:35:09 -0700",
        "Message-Id": "<20180830223512.21297-3-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.18.0",
        "In-Reply-To": "<20180830223512.21297-1-stephen@networkplumber.org>",
        "References": "<20180830223512.21297-1-stephen@networkplumber.org>",
        "Subject": "[dpdk-dev] [PATCH 2/5] net/netvsc: allow tuning latency with devargs",
        "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: Stephen Hemminger <sthemmin@microsoft.com>\n\nAllow overriding default guest to host latency on per device basis\nwith devargs.\n\nSigned-off-by: Stephen Hemminger <sthemmin@microsoft.com>\n---\n doc/guides/nics/netvsc.rst     | 16 +++++++++\n drivers/net/netvsc/hn_ethdev.c | 62 +++++++++++++++++++++++++++++++---\n drivers/net/netvsc/hn_var.h    |  1 +\n 3 files changed, 75 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/netvsc.rst b/doc/guides/nics/netvsc.rst\nindex 345f393c24ba..cc07ce46f885 100644\n--- a/doc/guides/nics/netvsc.rst\n+++ b/doc/guides/nics/netvsc.rst\n@@ -103,3 +103,19 @@ The following prerequisites apply:\n *   Linux kernel support for UIO on vmbus is done with the uio_hv_generic driver.\n     Full support of multiple queues requires the 4.17 kernel. It is possible\n     to use the netvsc PMD with 4.16 kernel but it is limited to a single queue.\n+\n+\n+Netvsc PMD arguments\n+--------------------\n+\n+The user can specify below argument in devargs.\n+\n+#.  ``latency``:\n+\n+    A netvsc device uses a mailbox page to indicate to the host that there\n+    is something in the transmit queue. The host scans this page at a\n+    periodic interval. This parameter allows adjusting the value that\n+    is used by the host. Smaller values improve transmit latency, and larger\n+    values save CPU cycles. This parameter is in microseconds.\n+    If the value is too large or too small it will be\n+    ignored by the host. (Default: 50)\ndiff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c\nindex 2200ee319f98..97e4b0da4410 100644\n--- a/drivers/net/netvsc/hn_ethdev.c\n+++ b/drivers/net/netvsc/hn_ethdev.c\n@@ -14,7 +14,9 @@\n #include <rte_memcpy.h>\n #include <rte_string_fns.h>\n #include <rte_memzone.h>\n+#include <rte_devargs.h>\n #include <rte_malloc.h>\n+#include <rte_kvargs.h>\n #include <rte_atomic.h>\n #include <rte_branch_prediction.h>\n #include <rte_ether.h>\n@@ -131,6 +133,55 @@ eth_dev_vmbus_release(struct rte_eth_dev *eth_dev)\n \teth_dev->intr_handle = NULL;\n }\n \n+/* handle \"latency=X\" from devargs */\n+static int hn_set_latency(const char *key, const char *value, void *opaque)\n+{\n+\tstruct hn_data *hv = opaque;\n+\tchar *endp = NULL;\n+\tunsigned long lat;\n+\n+\terrno = 0;\n+\tlat = strtoul(value, &endp, 0);\n+\n+\tif (*value == '\\0' || *endp != '\\0') {\n+\t\tPMD_DRV_LOG(ERR, \"invalid parameter %s=%s\", key, value);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tPMD_DRV_LOG(DEBUG, \"set latency %lu usec\", lat);\n+\n+\thv->latency = lat * 1000;\t/* usec to nsec */\n+\treturn 0;\n+}\n+\n+/* Parse device arguments */\n+static int hn_parse_args(const struct rte_eth_dev *dev)\n+{\n+\tstruct hn_data *hv = dev->data->dev_private;\n+\tstruct rte_devargs *devargs = dev->device->devargs;\n+\tstatic const char * const valid_keys[] = {\n+\t\t\"latency\",\n+\t\tNULL\n+\t};\n+\tstruct rte_kvargs *kvlist;\n+\n+\tif (!devargs)\n+\t\treturn 0;\n+\n+\tPMD_INIT_LOG(DEBUG, \"device args %s %s\",\n+\t\t     devargs->name, devargs->args);\n+\n+\tkvlist = rte_kvargs_parse(devargs->args, valid_keys);\n+\tif (!kvlist) {\n+\t\tPMD_DRV_LOG(NOTICE, \"invalid parameters\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\trte_kvargs_process(kvlist, \"latency\", hn_set_latency, hv);\n+\trte_kvargs_free(kvlist);\n+\treturn 0;\n+}\n+\n /* Update link status.\n  * Note: the DPDK definition of \"wait_to_complete\"\n  *   means block this call until link is up.\n@@ -264,8 +315,7 @@ static int hn_subchan_configure(struct hn_data *hv,\n \t\t\treturn err;\n \t\t}\n \n-\t\trte_vmbus_set_latency(hv->vmbus, new_sc,\n-\t\t\t\t      HN_CHAN_LATENCY_NS);\n+\t\trte_vmbus_set_latency(hv->vmbus, new_sc, hv->latency);\n \n \t\tretry = 0;\n \t\tchn_index = rte_vmbus_sub_channel_index(new_sc);\n@@ -627,14 +677,18 @@ eth_hn_dev_init(struct rte_eth_dev *eth_dev)\n \thv->rxbuf_res = &vmbus->resource[HV_RECV_BUF_MAP];\n \thv->chim_res  = &vmbus->resource[HV_SEND_BUF_MAP];\n \thv->port_id = eth_dev->data->port_id;\n+\thv->latency = HN_CHAN_LATENCY_NS;\n+\n+\terr = hn_parse_args(eth_dev);\n+\tif (err)\n+\t\treturn err;\n \n \t/* Initialize primary channel input for control operations */\n \terr = rte_vmbus_chan_open(vmbus, &hv->channels[0]);\n \tif (err)\n \t\treturn err;\n \n-\trte_vmbus_set_latency(hv->vmbus, hv->channels[0],\n-\t\t\t      HN_CHAN_LATENCY_NS);\n+\trte_vmbus_set_latency(hv->vmbus, hv->channels[0], hv->latency);\n \n \thv->primary = hn_rx_queue_alloc(hv, 0,\n \t\t\t\t\teth_dev->device->numa_node);\ndiff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h\nindex b42bd97b9a45..f188f6360f79 100644\n--- a/drivers/net/netvsc/hn_var.h\n+++ b/drivers/net/netvsc/hn_var.h\n@@ -113,6 +113,7 @@ struct hn_data {\n \tuint32_t\tchim_szmax;\t\t/* Max size per buffer */\n \tuint32_t\tchim_cnt;\t\t/* Max packets per buffer */\n \n+\tuint32_t\tlatency;\n \tuint32_t\tnvs_ver;\n \tuint32_t\tndis_ver;\n \tuint32_t\trndis_agg_size;\n",
    "prefixes": [
        "2/5"
    ]
}