get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 41617,
    "url": "http://patches.dpdk.org/api/patches/41617/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180627071740.19870-3-qi.z.zhang@intel.com/",
    "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": "<20180627071740.19870-3-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180627071740.19870-3-qi.z.zhang@intel.com",
    "date": "2018-06-27T07:17:18",
    "name": "[v5,02/24] bus/vdev: enable one device scan",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": true,
    "hash": "af4382fdbb47f9e9109bc37b441158548f76c247",
    "submitter": {
        "id": 504,
        "url": "http://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "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/20180627071740.19870-3-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 252,
            "url": "http://patches.dpdk.org/api/series/252/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=252",
            "date": "2018-06-27T07:17:16",
            "name": "enable hotplug on multi-process",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/252/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/41617/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/41617/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 2930B1BBB4;\n\tWed, 27 Jun 2018 09:17:20 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 6003B1B53B\n\tfor <dev@dpdk.org>; Wed, 27 Jun 2018 09:17:13 +0200 (CEST)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t27 Jun 2018 00:17:12 -0700",
            "from dpdk51.sh.intel.com ([10.67.110.190])\n\tby orsmga007.jf.intel.com with ESMTP; 27 Jun 2018 00:17:10 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,278,1526367600\"; d=\"scan'208\";a=\"52236051\"",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "thomas@monjalon.net,\n\tanatoly.burakov@intel.com",
        "Cc": "konstantin.ananyev@intel.com, dev@dpdk.org, bruce.richardson@intel.com, \n\tferruh.yigit@intel.com, benjamin.h.shelton@intel.com,\n\tnarender.vangati@intel.com, Qi Zhang <qi.z.zhang@intel.com>",
        "Date": "Wed, 27 Jun 2018 15:17:18 +0800",
        "Message-Id": "<20180627071740.19870-3-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20180627071740.19870-1-qi.z.zhang@intel.com>",
        "References": "<20180607123849.14439-1-qi.z.zhang@intel.com>\n\t<20180627071740.19870-1-qi.z.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v5 02/24] bus/vdev: enable one device scan",
        "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": "The patch implements the ops scan_one for the vdev bus, which gives two\nbenefits:\n1. Improves scan efficiency when a device is attached as hotplug, since\nthere is no need to populate a new device by iterating all devargs in\ndevargs_list\n2. It also avoids sync IPC invoke (which happens in vdev->scan on\nsecondary process). The benefit is this removes the potential deadlock\nin the case when a secondary process receives a request from primary\nprocess to attach a new device, since vdev->scan will be invoked on mp\nthread itself in that case\n\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\nAcked-by: Remy Horton <remy.horton@intel.com>\n---\n drivers/bus/vdev/vdev.c | 30 ++++++++++++++++++++++++++++++\n 1 file changed, 30 insertions(+)",
    "diff": "diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c\nindex 6139dd551..cdbd77df0 100644\n--- a/drivers/bus/vdev/vdev.c\n+++ b/drivers/bus/vdev/vdev.c\n@@ -467,6 +467,35 @@ vdev_scan(void)\n \treturn 0;\n }\n \n+static struct rte_device *vdev_scan_one(struct rte_devargs *devargs)\n+{\n+\tstruct rte_vdev_device *dev = NULL;\n+\n+\tdev = calloc(1, sizeof(*dev));\n+\tif (!dev) {\n+\t\tVDEV_LOG(ERR, \"failed to allocate memory for new device\");\n+\t\treturn NULL;\n+\t}\n+\n+\trte_spinlock_recursive_lock(&vdev_device_list_lock);\n+\n+\tif (find_vdev(devargs->name)) {\n+\t\tVDEV_LOG(ERR, \"device %s already exist\", devargs->name);\n+\t\tfree(dev);\n+\t\trte_spinlock_recursive_unlock(&vdev_device_list_lock);\n+\t\treturn NULL;\n+\t}\n+\n+\tdev->device.devargs = devargs;\n+\tdev->device.numa_node = SOCKET_ID_ANY;\n+\tdev->device.name = devargs->name;\n+\tTAILQ_INSERT_TAIL(&vdev_device_list, dev, next);\n+\n+\trte_spinlock_recursive_unlock(&vdev_device_list_lock);\n+\n+\treturn &dev->device;\n+}\n+\n static int\n vdev_probe(void)\n {\n@@ -531,6 +560,7 @@ vdev_unplug(struct rte_device *dev)\n \n static struct rte_bus rte_vdev_bus = {\n \t.scan = vdev_scan,\n+\t.scan_one = vdev_scan_one,\n \t.probe = vdev_probe,\n \t.find_device = vdev_find_device,\n \t.plug = vdev_plug,\n",
    "prefixes": [
        "v5",
        "02/24"
    ]
}