get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 21440,
    "url": "http://patches.dpdk.org/api/patches/21440/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1488794430-25179-13-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-13-git-send-email-jblunck@infradead.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1488794430-25179-13-git-send-email-jblunck@infradead.org",
    "date": "2017-03-06T10:00:04",
    "name": "[dpdk-dev,12/38] net/null: use ethdev allocation helper for virtual devices",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "279cd4a418779f55531b8aece4c184daaa678739",
    "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-13-git-send-email-jblunck@infradead.org/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/21440/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/21440/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 C2432F95C;\n\tMon,  6 Mar 2017 11:01:46 +0100 (CET)",
            "from mail-wr0-f196.google.com (mail-wr0-f196.google.com\n\t[209.85.128.196]) by dpdk.org (Postfix) with ESMTP id B466F567F\n\tfor <dev@dpdk.org>; Mon,  6 Mar 2017 11:00:58 +0100 (CET)",
            "by mail-wr0-f196.google.com with SMTP id u48so21046409wrc.1\n\tfor <dev@dpdk.org>; Mon, 06 Mar 2017 02:00:58 -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.57 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:57 -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=pvybLu98rrXykCMwL7awYLLBjNGKOiz07PYxFDuXXZg=;\n\tb=gBrt8lHGgq+2q9aa6BWgwYxsPrpSf7tnBqnz/Sw/e1aNc0Y4hKUae8Ho632tGw2vK0\n\twVKQdKqjuUOh41QXEJ4yHr65ZRzjGL5RAxKl9Twm1vf39Ve5oUxlWlUAibiOyPFK9zB8\n\t8d62QCxQrERE+uEoSpbGy59lINYH2KNbQyJRsuh17fA2i40e2lRC4igwCBgKMTwe6Py8\n\t8EF55HGW+uwRYTxIfu5OUKd0BYmWCUNI/c4c8PIjBP01yscowaX3TR4yRg0uTHAa71PU\n\tBkTTXaEesfqfyyVMwHzR33LNZUFulFU9XCXQh8gdo4mX2YMyyPYfB/1opy7xqSpQKljE\n\tUy8w==",
        "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=pvybLu98rrXykCMwL7awYLLBjNGKOiz07PYxFDuXXZg=;\n\tb=pgjbZfzsfxwCn2g0r76eSIWuiT2GOLJ6ZgrS+72h8kMhfQbJ81tVJ0KLB7wRkgRonQ\n\te7sGFRruHT2ZKQBsuUyYyxVno9F7+hEFWRR7UKL+ShI4d9Ku0hqkuleRA1W+eq4O/xP6\n\tn72jRUtrwKVy1HVpDrYnCickkmM6X32yzUav01nMQsvC7eFUNiX7l+UvTTB4g89xGnt1\n\tA9lXwyVGOWjWkDpvuSyy7lAwYwqHvPWkIDwFEv+4CgJ+YptbWgjwSGkpptZCvyjUctoo\n\ti0JJ2LzsJEz8C9PlQgIB/l5S9PEEpnHLdfpL6rLuZFNcgEgH3TCp9FIeJvb6jOaQGUT8\n\t1/XA==",
        "X-Gm-Message-State": "AMke39n1RO+vtvNiZNRowVvVjnC/zBfziEGJkS/EW9qA0cmVAjlAj74NmubWoBgsQvdjxA==",
        "X-Received": "by 10.223.160.9 with SMTP id k9mr15233675wrk.123.1488794458295; \n\tMon, 06 Mar 2017 02:00:58 -0800 (PST)",
        "From": "Jan Blunck <jblunck@infradead.org>",
        "To": "dev@dpdk.org",
        "Date": "Mon,  6 Mar 2017 11:00:04 +0100",
        "Message-Id": "<1488794430-25179-13-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 12/38] net/null: use ethdev allocation helper for\n\tvirtual 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/null/rte_eth_null.c | 50 ++++++++++++++---------------------------\n 1 file changed, 17 insertions(+), 33 deletions(-)",
    "diff": "diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c\nindex 14f35d7..226c2e4 100644\n--- a/drivers/net/null/rte_eth_null.c\n+++ b/drivers/net/null/rte_eth_null.c\n@@ -33,6 +33,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@@ -479,8 +480,7 @@ static const struct eth_dev_ops ops = {\n static struct rte_vdev_driver pmd_null_drv;\n \n static int\n-eth_dev_null_create(const char *name,\n-\t\tconst unsigned numa_node,\n+eth_dev_null_create(struct rte_vdev_device *dev,\n \t\tunsigned packet_size,\n \t\tunsigned packet_copy)\n {\n@@ -497,27 +497,25 @@ eth_dev_null_create(const char *name,\n \t\t0xBE, 0xAC, 0x01, 0xFA\n \t};\n \n-\tif (name == NULL)\n-\t\treturn -EINVAL;\n+\tif (dev->device.numa_node == SOCKET_ID_ANY)\n+\t\tdev->device.numa_node = rte_socket_id();\n \n \tRTE_LOG(INFO, PMD, \"Creating null ethdev on numa socket %u\\n\",\n-\t\t\tnuma_node);\n+\t\tdev->device.numa_node);\n \n \t/* now do all data allocation - for eth_dev structure, dummy pci driver\n \t * and internal (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-\tinternals = rte_zmalloc_socket(name, sizeof(*internals), 0, numa_node);\n-\tif (internals == NULL)\n-\t\tgoto error;\n+\tdata = rte_zmalloc_socket(rte_vdev_device_name(dev), sizeof(*data), 0,\n+\t\tdev->device.numa_node);\n+\tif (!data)\n+\t\treturn -ENOMEM;\n \n-\t/* reserve an ethdev entry */\n-\teth_dev = rte_eth_dev_allocate(name);\n-\tif (eth_dev == NULL)\n-\t\tgoto error;\n+\teth_dev = rte_eth_vdev_allocate(dev, sizeof(*internals));\n+\tif (!eth_dev) {\n+\t\trte_free(data);\n+\t\treturn -ENOMEM;\n+\t}\n \n \t/* now put it all together\n \t * - store queue data in internals,\n@@ -528,6 +526,7 @@ eth_dev_null_create(const char *name,\n \t/* NOTE: we'll replace the data element, of originally allocated eth_dev\n \t * so the nulls are local per-process */\n \n+\tinternals = eth_dev->data->dev_private;\n \tinternals->packet_size = packet_size;\n \tinternals->packet_copy = packet_copy;\n \tinternals->port_id = eth_dev->data->port_id;\n@@ -537,22 +536,16 @@ eth_dev_null_create(const char *name,\n \n \trte_memcpy(internals->rss_key, default_rss_key, 40);\n \n-\tdata->dev_private = internals;\n-\tdata->port_id = eth_dev->data->port_id;\n+\trte_memcpy(data, eth_dev->data, sizeof(*data));\n \tdata->nb_rx_queues = (uint16_t)nb_rx_queues;\n \tdata->nb_tx_queues = (uint16_t)nb_tx_queues;\n \tdata->dev_link = pmd_link;\n \tdata->mac_addrs = &eth_addr;\n-\tstrncpy(data->name, eth_dev->data->name, strlen(eth_dev->data->name));\n \n \teth_dev->data = data;\n \teth_dev->dev_ops = &ops;\n \n-\teth_dev->driver = NULL;\n \tdata->dev_flags = RTE_ETH_DEV_DETACHABLE;\n-\tdata->kdrv = RTE_KDRV_NONE;\n-\tdata->drv_name = pmd_null_drv.driver.name;\n-\tdata->numa_node = numa_node;\n \n \t/* finally assign rx and tx ops */\n \tif (packet_copy) {\n@@ -564,12 +557,6 @@ eth_dev_null_create(const char *name,\n \t}\n \n \treturn 0;\n-\n-error:\n-\trte_free(data);\n-\trte_free(internals);\n-\n-\treturn -1;\n }\n \n static inline int\n@@ -610,7 +597,6 @@ static int\n rte_pmd_null_probe(struct rte_vdev_device *dev)\n {\n \tconst char *name, *params;\n-\tunsigned numa_node;\n \tunsigned packet_size = default_packet_size;\n \tunsigned packet_copy = default_packet_copy;\n \tstruct rte_kvargs *kvlist = NULL;\n@@ -623,8 +609,6 @@ rte_pmd_null_probe(struct rte_vdev_device *dev)\n \tparams = rte_vdev_device_args(dev);\n \tRTE_LOG(INFO, PMD, \"Initializing pmd_null for %s\\n\", name);\n \n-\tnuma_node = rte_socket_id();\n-\n \tif (params != NULL) {\n \t\tkvlist = rte_kvargs_parse(params, valid_arguments);\n \t\tif (kvlist == NULL)\n@@ -653,7 +637,7 @@ rte_pmd_null_probe(struct rte_vdev_device *dev)\n \t\t\t\"packet copy is %s\\n\", packet_size,\n \t\t\tpacket_copy ? \"enabled\" : \"disabled\");\n \n-\tret = eth_dev_null_create(name, numa_node, packet_size, packet_copy);\n+\tret = eth_dev_null_create(dev, packet_size, packet_copy);\n \n free_kvlist:\n \tif (kvlist)\n",
    "prefixes": [
        "dpdk-dev",
        "12/38"
    ]
}