get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 21435,
    "url": "http://patches.dpdk.org/api/patches/21435/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1488794430-25179-8-git-send-email-jblunck@infradead.org/",
    "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": "<1488794430-25179-8-git-send-email-jblunck@infradead.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1488794430-25179-8-git-send-email-jblunck@infradead.org",
    "date": "2017-03-06T09:59:59",
    "name": "[dpdk-dev,07/38] net/vhost: use ethdev allocation helper for virtual devices",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "919311e3654825caa7c6a2d742e9acf58c32e365",
    "submitter": {
        "id": 249,
        "url": "http://patches.dpdk.org/api/people/249/?format=api",
        "name": "Jan Blunck",
        "email": "jblunck@infradead.org"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1488794430-25179-8-git-send-email-jblunck@infradead.org/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/21435/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/21435/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id E609BF928;\n\tMon,  6 Mar 2017 11:01:33 +0100 (CET)",
            "from mail-wr0-f193.google.com (mail-wr0-f193.google.com\n\t[209.85.128.193]) by dpdk.org (Postfix) with ESMTP id 065F1952\n\tfor <dev@dpdk.org>; Mon,  6 Mar 2017 11:00:53 +0100 (CET)",
            "by mail-wr0-f193.google.com with SMTP id l37so20982724wrc.3\n\tfor <dev@dpdk.org>; Mon, 06 Mar 2017 02:00:53 -0800 (PST)",
            "from weierstrass.local.net ([91.200.109.169])\n\tby smtp.gmail.com with ESMTPSA id\n\tu145sm3829237wmu.1.2017.03.06.02.00.51 for <dev@dpdk.org>\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 06 Mar 2017 02:00:51 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:from:to:subject:date:message-id:in-reply-to:references;\n\tbh=auj2rMGinToCfG7chcys4eDGZk2KkNHnuThkK64q/tM=;\n\tb=gYL2XsOpwkiEIYYIW7bGALUTMnTdmB9f6DF6Jn9Fldtivg3tyaoydiR/Ov/IyU5Q4n\n\t0UQa+tOaBGTXNvdCJLDGHad8AwC58JQY+zJIxbW1KqgvmHq/PmxlKNXxNJ3W0ASm6cw5\n\tNW7oYSp809rRqpvBAwA32v3c5oieOXyKkLnOoLtK4zl7eUfj8sTAZqXKIBaj6+fWO0Og\n\tSDVlaxSgkrgqc8+8DPffkMaoNO9GgbciB0+kRHw2ZJLKWTOuJNghpMMGz/vEXQVQuBPU\n\tFl9ATTbJTh0YQnE1mqSg6Y1bdG+vLzzxyH+GzkJ8XhbosP/CgHqPaAUtuRwy67jNbk7D\n\tO3NQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:from:to:subject:date:message-id\n\t:in-reply-to:references;\n\tbh=auj2rMGinToCfG7chcys4eDGZk2KkNHnuThkK64q/tM=;\n\tb=SZAtiRxr2AmVTBw68ClisMdDdvolAoUBR8p6uYGDp169fwo0pGuJ9Bgaow5K+tc8x5\n\tPFGW9DdlORSJf6gkXX5dVgxU0bQka+odtfdapEvUGuStKO1CDFeDnRFwSYdifb/7zqsE\n\tG1B4yRt+P4MjfZsyirs5CmGPUmxED0gkHiUFmlXvqra3+tB6OaAe4C2dk/f2HS8YKrLN\n\tYiGEAIN7Xo3rlZpAz2HYpPg0YkoZAzRLI1X0b8cC+dhsSNg9bxgyhm/+FKStY5i1Vy0s\n\tPzQz8LAPl4Pdfq2T7DIpl9IpZu96nsDZ7juRl9joM/8LikFux3dIvI8yP3PQeGcvOOR9\n\tZaxQ==",
        "X-Gm-Message-State": "AMke39nm0dBhUSwmX/UR1Iyl+sZNuplW9EDxntHwV5It/aNvVuaZRoFZxpBYv9n9uO91ng==",
        "X-Received": "by 10.223.164.150 with SMTP id g22mr15034046wrb.92.1488794452565;\n\tMon, 06 Mar 2017 02:00:52 -0800 (PST)",
        "From": "Jan Blunck <jblunck@infradead.org>",
        "To": "dev@dpdk.org",
        "Date": "Mon,  6 Mar 2017 10:59:59 +0100",
        "Message-Id": "<1488794430-25179-8-git-send-email-jblunck@infradead.org>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1488794430-25179-1-git-send-email-jblunck@infradead.org>",
        "References": "<1488794430-25179-1-git-send-email-jblunck@infradead.org>",
        "Subject": "[dpdk-dev] [PATCH 07/38] net/vhost: use ethdev allocation helper\n\tfor virtual devices",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Signed-off-by: Jan Blunck <jblunck@infradead.org>\n---\n drivers/net/vhost/rte_eth_vhost.c | 54 +++++++++++++++++++--------------------\n 1 file changed, 26 insertions(+), 28 deletions(-)",
    "diff": "diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c\nindex d0d0474..e2dae6f 100644\n--- a/drivers/net/vhost/rte_eth_vhost.c\n+++ b/drivers/net/vhost/rte_eth_vhost.c\n@@ -39,6 +39,7 @@\n \n #include <rte_mbuf.h>\n #include <rte_ethdev.h>\n+#include <rte_ethdev_vdev.h>\n #include <rte_malloc.h>\n #include <rte_memcpy.h>\n #include <rte_vdev.h>\n@@ -1012,9 +1013,10 @@ static const struct eth_dev_ops ops = {\n static struct rte_vdev_driver pmd_vhost_drv;\n \n static int\n-eth_dev_vhost_create(const char *name, char *iface_name, int16_t queues,\n-\t\t     const unsigned numa_node, uint64_t flags)\n+eth_dev_vhost_create(struct rte_vdev_device *dev, char *iface_name,\n+\tint16_t queues, const unsigned int numa_node, uint64_t flags)\n {\n+\tconst char *name = rte_vdev_device_name(dev);\n \tstruct rte_eth_dev_data *data = NULL;\n \tstruct pmd_internal *internal = NULL;\n \tstruct rte_eth_dev *eth_dev = NULL;\n@@ -1025,23 +1027,19 @@ eth_dev_vhost_create(const char *name, char *iface_name, int16_t queues,\n \tRTE_LOG(INFO, PMD, \"Creating VHOST-USER backend on numa socket %u\\n\",\n \t\tnuma_node);\n \n-\t/* now do all data allocation - for eth_dev structure, dummy pci driver\n-\t * and internal (private) data\n+\t/* now do all data allocation - for eth_dev structure and internal\n+\t * (private) data\n \t */\n \tdata = rte_zmalloc_socket(name, sizeof(*data), 0, numa_node);\n \tif (data == NULL)\n \t\tgoto error;\n \n-\tinternal = rte_zmalloc_socket(name, sizeof(*internal), 0, numa_node);\n-\tif (internal == NULL)\n-\t\tgoto error;\n-\n \tlist = rte_zmalloc_socket(name, sizeof(*list), 0, numa_node);\n \tif (list == NULL)\n \t\tgoto error;\n \n \t/* reserve an ethdev entry */\n-\teth_dev = rte_eth_dev_allocate(name);\n+\teth_dev = rte_eth_vdev_allocate(dev, sizeof(*internal));\n \tif (eth_dev == NULL)\n \t\tgoto error;\n \n@@ -1058,10 +1056,10 @@ eth_dev_vhost_create(const char *name, char *iface_name, int16_t queues,\n \n \t/* now put it all together\n \t * - store queue data in internal,\n-\t * - store numa_node info in ethdev data\n \t * - point eth_dev_data to internals\n \t * - and point eth_dev structure to new eth_dev_data structure\n \t */\n+\tinternal = eth_dev->data->dev_private;\n \tinternal->dev_name = strdup(name);\n \tif (internal->dev_name == NULL)\n \t\tgoto error;\n@@ -1077,26 +1075,21 @@ eth_dev_vhost_create(const char *name, char *iface_name, int16_t queues,\n \trte_spinlock_init(&vring_state->lock);\n \tvring_states[eth_dev->data->port_id] = vring_state;\n \n-\tdata->dev_private = internal;\n-\tdata->port_id = eth_dev->data->port_id;\n-\tmemmove(data->name, eth_dev->data->name, sizeof(data->name));\n+\t/* We'll replace the 'data' originally allocated by eth_dev. So the\n+\t * vhost PMD resources won't be shared between multi processes.\n+\t */\n+\trte_memcpy(data, eth_dev->data, sizeof(*data));\n+\teth_dev->data = data;\n+\n \tdata->nb_rx_queues = queues;\n \tdata->nb_tx_queues = queues;\n \tinternal->max_queues = queues;\n \tdata->dev_link = pmd_link;\n \tdata->mac_addrs = eth_addr;\n-\n-\t/* We'll replace the 'data' originally allocated by eth_dev. So the\n-\t * vhost PMD resources won't be shared between multi processes.\n-\t */\n-\teth_dev->data = data;\n-\teth_dev->dev_ops = &ops;\n-\teth_dev->driver = NULL;\n \tdata->dev_flags =\n \t\tRTE_ETH_DEV_DETACHABLE | RTE_ETH_DEV_INTR_LSC;\n-\tdata->kdrv = RTE_KDRV_NONE;\n-\tdata->drv_name = pmd_vhost_drv.driver.name;\n-\tdata->numa_node = numa_node;\n+\n+\teth_dev->dev_ops = &ops;\n \n \t/* finally assign rx and tx ops */\n \teth_dev->rx_pkt_burst = eth_vhost_rx;\n@@ -1114,8 +1107,10 @@ eth_dev_vhost_create(const char *name, char *iface_name, int16_t queues,\n \treturn data->port_id;\n \n error:\n-\tif (internal)\n+\tif (internal) {\n+\t\tfree(internal->iface_name);\n \t\tfree(internal->dev_name);\n+\t}\n \trte_free(vring_state);\n \trte_free(eth_addr);\n \tif (eth_dev)\n@@ -1158,7 +1153,6 @@ open_int(const char *key __rte_unused, const char *value, void *extra_args)\n static int\n rte_pmd_vhost_probe(struct rte_vdev_device *dev)\n {\n-\tconst char *name;\n \tstruct rte_kvargs *kvlist = NULL;\n \tint ret = 0;\n \tchar *iface_name;\n@@ -1167,8 +1161,8 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)\n \tint client_mode = 0;\n \tint dequeue_zero_copy = 0;\n \n-\tname = rte_vdev_device_name(dev);\n-\tRTE_LOG(INFO, PMD, \"Initializing pmd_vhost for %s\\n\", name);\n+\tRTE_LOG(INFO, PMD, \"Initializing pmd_vhost for %s\\n\",\n+\t\trte_vdev_device_name(dev));\n \n \tkvlist = rte_kvargs_parse(rte_vdev_device_args(dev), valid_arguments);\n \tif (kvlist == NULL)\n@@ -1213,7 +1207,11 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)\n \t\t\tflags |= RTE_VHOST_USER_DEQUEUE_ZERO_COPY;\n \t}\n \n-\teth_dev_vhost_create(name, iface_name, queues, rte_socket_id(), flags);\n+\tif (dev->device.numa_node == SOCKET_ID_ANY)\n+\t\tdev->device.numa_node = rte_socket_id();\n+\n+\teth_dev_vhost_create(dev, iface_name, queues, dev->device.numa_node,\n+\t\tflags);\n \n out_free:\n \trte_kvargs_free(kvlist);\n",
    "prefixes": [
        "dpdk-dev",
        "07/38"
    ]
}