Show a patch.

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

{
    "id": 40746,
    "url": "http://patches.dpdk.org/api/patches/40746/?format=api",
    "web_url": "http://patches.dpdk.org/patch/40746/",
    "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": "<20180607123849.14439-3-qi.z.zhang@intel.com>",
    "date": "2018-06-07T12:38:29",
    "name": "[dpdk-dev,02/22] bus/vdev: enable one device scan",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "af4382fdbb47f9e9109bc37b441158548f76c247",
    "submitter": {
        "id": 504,
        "url": "http://patches.dpdk.org/api/people/504/?format=api",
        "name": "Zhang, Qi Z",
        "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/patch/40746/mbox/",
    "series": [
        {
            "id": 30,
            "url": "http://patches.dpdk.org/api/series/30/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=30",
            "date": "2018-06-07T12:38:27",
            "name": "enable hotplug on multi-process",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/30/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/40746/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/40746/checks/",
    "tags": {},
    "headers": {
        "X-Mailer": "git-send-email 2.13.6",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Precedence": "list",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Date": "Thu,  7 Jun 2018 20:38:29 +0800",
        "X-Mailman-Version": "2.1.15",
        "Delivered-To": "patchwork@dpdk.org",
        "List-Unsubscribe": "<https://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "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>",
        "To": "thomas@monjalon.net,\n\tanatoly.burakov@intel.com",
        "Errors-To": "dev-bounces@dpdk.org",
        "References": "<20180607123849.14439-1-qi.z.zhang@intel.com>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-IronPort-AV": "E=Sophos;i=\"5.49,486,1520924400\"; d=\"scan'208\";a=\"62605512\"",
        "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 C3E401B1BE;\n\tThu,  7 Jun 2018 14:38:28 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 4EF931B1B1\n\tfor <dev@dpdk.org>; Thu,  7 Jun 2018 14:38:27 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t07 Jun 2018 05:38:26 -0700",
            "from dpdk51.sh.intel.com ([10.67.110.184])\n\tby orsmga001.jf.intel.com with ESMTP; 07 Jun 2018 05:38:24 -0700"
        ],
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "X-Amp-File-Uploaded": "False",
        "Subject": "[dpdk-dev] [PATCH 02/22] bus/vdev: enable one device scan",
        "In-Reply-To": "<20180607123849.14439-1-qi.z.zhang@intel.com>",
        "Message-Id": "<20180607123849.14439-3-qi.z.zhang@intel.com>",
        "X-ExtLoop1": "1",
        "X-BeenThere": "dev@dpdk.org",
        "X-Original-To": "patchwork@dpdk.org"
    },
    "content": "Implemented the bus ops scan_one, besides this improve the scan\nefficiency in hotplug case, it aslo avoid sync IPC invoke (which\nhappens in vdev->scan on secondary process). The benifit is it\nremoves the potiential deadlock in the case when secondary process\nreceive a request from primary process to attach a new device, since\nvdev->scan will be invoked on mp thread itself at this case.\n\nSigned-off-by: Qi Zhang <qi.z.zhang@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": [
        "dpdk-dev",
        "02/22"
    ]
}