Show a patch.

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

{
    "id": 41636,
    "url": "http://patches.dpdk.org/api/patches/41636/?format=api",
    "web_url": "http://patches.dpdk.org/patch/41636/",
    "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": "<20180627071740.19870-22-qi.z.zhang@intel.com>",
    "date": "2018-06-27T07:17:37",
    "name": "[v5,21/24] net/softnic: enable port detach on secondary process",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a0f69d8ed35860907b7f397b5f86b38faf819193",
    "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/41636/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/41636/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/41636/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,278,1526367600\"; d=\"scan'208\";a=\"52236454\"",
        "X-Amp-File-Uploaded": "False",
        "Precedence": "list",
        "X-Mailman-Version": "2.1.15",
        "X-Original-To": "patchwork@dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "References": "<20180607123849.14439-1-qi.z.zhang@intel.com>\n\t<20180627071740.19870-1-qi.z.zhang@intel.com>",
        "X-BeenThere": "dev@dpdk.org",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH v5 21/24] net/softnic: enable port detach on\n\tsecondary process",
        "Sender": "\"dev\" <dev-bounces@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 5F6F81BE5D;\n\tWed, 27 Jun 2018 09:18:17 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 5B0761BE09\n\tfor <dev@dpdk.org>; Wed, 27 Jun 2018 09:17:47 +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:46 -0700",
            "from dpdk51.sh.intel.com ([10.67.110.190])\n\tby orsmga007.jf.intel.com with ESMTP; 27 Jun 2018 00:17:45 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Mailer": "git-send-email 2.13.6",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-ExtLoop1": "1",
        "Date": "Wed, 27 Jun 2018 15:17:37 +0800",
        "To": "thomas@monjalon.net,\n\tanatoly.burakov@intel.com",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "In-Reply-To": "<20180627071740.19870-1-qi.z.zhang@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>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<20180627071740.19870-22-qi.z.zhang@intel.com>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "content": "Previously, detach port on secondary process will mess primary\nprocess and cause same device can't be attached again, by take\nadvantage of rte_eth_release_port_private, we can support this\nwith minor change.\n\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n drivers/net/softnic/rte_eth_softnic.c | 19 ++++++++++++++++---\n 1 file changed, 16 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c\nindex 6b3c13e5c..a45a7b0dd 100644\n--- a/drivers/net/softnic/rte_eth_softnic.c\n+++ b/drivers/net/softnic/rte_eth_softnic.c\n@@ -750,6 +750,7 @@ pmd_probe(struct rte_vdev_device *vdev)\n \t\t}\n \t\t/* TODO: request info from primary to set up Rx and Tx */\n \t\teth_dev->dev_ops = &pmd_ops;\n+\t\teth_dev->device = &vdev->device;\n \t\trte_eth_dev_probing_finish(eth_dev);\n \t\treturn 0;\n \t}\n@@ -803,17 +804,29 @@ pmd_remove(struct rte_vdev_device *vdev)\n {\n \tstruct rte_eth_dev *dev = NULL;\n \tstruct pmd_internals *p;\n+\tconst char *name;\n \n \tif (!vdev)\n \t\treturn -EINVAL;\n \n-\tPMD_LOG(INFO, \"Removing device \\\"%s\\\"\",\n-\t\trte_vdev_device_name(vdev));\n+\tname = rte_vdev_device_name(vdev);\n+\tPMD_LOG(INFO, \"Removing device \\\"%s\\\"\", name);\n \n \t/* Find the ethdev entry */\n-\tdev = rte_eth_dev_allocated(rte_vdev_device_name(vdev));\n+\tdev = rte_eth_dev_allocated(name);\n \tif (dev == NULL)\n \t\treturn -ENODEV;\n+\n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY) {\n+\t\t/* detach device on local pprocess only */\n+\t\tif (strlen(rte_vdev_device_args(vdev)) == 0)\n+\t\t\treturn rte_eth_dev_release_port_private(dev);\n+\t\t/**\n+\t\t * else this is a private device for current process\n+\t\t * so continue with normal detach scenario\n+\t\t */\n+\t}\n+\n \tp = dev->data->dev_private;\n \n \t/* Free device data structures*/\n",
    "prefixes": [
        "v5",
        "21/24"
    ]
}