get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 45554,
    "url": "http://patches.dpdk.org/api/patches/45554/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180928042326.50471-5-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": "<20180928042326.50471-5-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180928042326.50471-5-qi.z.zhang@intel.com",
    "date": "2018-09-28T04:23:24",
    "name": "[v16,4/6] drivers/net: enable hotplug on secondary process",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "3b2286eabf1885c7315f2d3064a1d3fd30d76740",
    "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/20180928042326.50471-5-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 1562,
            "url": "http://patches.dpdk.org/api/series/1562/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1562",
            "date": "2018-09-28T04:23:20",
            "name": "enable hotplug on multi-process",
            "version": 16,
            "mbox": "http://patches.dpdk.org/series/1562/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/45554/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/45554/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 11F7D1B19D;\n\tFri, 28 Sep 2018 06:23:04 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 68A3B1B11C\n\tfor <dev@dpdk.org>; Fri, 28 Sep 2018 06:22:55 +0200 (CEST)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t27 Sep 2018 21:22:53 -0700",
            "from dpdk51.sh.intel.com ([10.67.110.190])\n\tby fmsmga005.fm.intel.com with ESMTP; 27 Sep 2018 21:22:34 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.54,313,1534834800\"; d=\"scan'208\";a=\"266654798\"",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "thomas@monjalon.net, gaetan.rivet@6wind.com, anatoly.burakov@intel.com, \n\tarybchenko@solarflare.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": "Fri, 28 Sep 2018 12:23:24 +0800",
        "Message-Id": "<20180928042326.50471-5-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20180928042326.50471-1-qi.z.zhang@intel.com>",
        "References": "<20180607123849.14439-1-qi.z.zhang@intel.com>\n\t<20180928042326.50471-1-qi.z.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v16 4/6] drivers/net: enable hotplug on secondary\n\tprocess",
        "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": "Attach port from secondary should ignore devargs since the private\ndevice is not necessary to support. Also previously, detach port on\na secondary process will mess primary process and cause the same\ndevice can't be attached back again. A secondary process should use\nrte_eth_dev_release_port_secondary to release a port.\n\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n drivers/net/af_packet/rte_eth_af_packet.c | 6 ++++--\n drivers/net/bonding/rte_eth_bond_pmd.c    | 6 ++++--\n drivers/net/kni/rte_eth_kni.c             | 6 ++++--\n drivers/net/null/rte_eth_null.c           | 6 ++++--\n drivers/net/octeontx/octeontx_ethdev.c    | 8 ++++++++\n drivers/net/pcap/rte_eth_pcap.c           | 6 ++++--\n drivers/net/tap/rte_eth_tap.c             | 8 +++++---\n drivers/net/vhost/rte_eth_vhost.c         | 6 ++++--\n 8 files changed, 37 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c\nindex bc7daed5e..376d76302 100644\n--- a/drivers/net/af_packet/rte_eth_af_packet.c\n+++ b/drivers/net/af_packet/rte_eth_af_packet.c\n@@ -926,8 +926,7 @@ rte_pmd_af_packet_probe(struct rte_vdev_device *dev)\n \n \tPMD_LOG(INFO, \"Initializing pmd_af_packet for %s\", name);\n \n-\tif (rte_eal_process_type() == RTE_PROC_SECONDARY &&\n-\t    strlen(rte_vdev_device_args(dev)) == 0) {\n+\tif (rte_eal_process_type() == RTE_PROC_SECONDARY) {\n \t\teth_dev = rte_eth_dev_attach_secondary(name);\n \t\tif (!eth_dev) {\n \t\t\tPMD_LOG(ERR, \"Failed to probe %s\", name);\n@@ -987,6 +986,9 @@ rte_pmd_af_packet_remove(struct rte_vdev_device *dev)\n \tif (eth_dev == NULL)\n \t\treturn -1;\n \n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\t\treturn rte_eth_dev_release_port_secondary(eth_dev);\n+\n \tinternals = eth_dev->data->dev_private;\n \tfor (q = 0; q < internals->nb_queues; q++) {\n \t\trte_free(internals->rx_queue[q].rd);\ndiff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c\nindex 7814258f2..94eed800a 100644\n--- a/drivers/net/bonding/rte_eth_bond_pmd.c\n+++ b/drivers/net/bonding/rte_eth_bond_pmd.c\n@@ -3116,8 +3116,7 @@ bond_probe(struct rte_vdev_device *dev)\n \tname = rte_vdev_device_name(dev);\n \tRTE_BOND_LOG(INFO, \"Initializing pmd_bond for %s\", name);\n \n-\tif (rte_eal_process_type() == RTE_PROC_SECONDARY &&\n-\t    strlen(rte_vdev_device_args(dev)) == 0) {\n+\tif (rte_eal_process_type() == RTE_PROC_SECONDARY) {\n \t\teth_dev = rte_eth_dev_attach_secondary(name);\n \t\tif (!eth_dev) {\n \t\t\tRTE_BOND_LOG(ERR, \"Failed to probe %s\", name);\n@@ -3232,6 +3231,9 @@ bond_remove(struct rte_vdev_device *dev)\n \tif (eth_dev == NULL)\n \t\treturn -ENODEV;\n \n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\t\treturn rte_eth_dev_release_port_secondary(eth_dev);\n+\n \tRTE_ASSERT(eth_dev->device == &dev->device);\n \n \tinternals = eth_dev->data->dev_private;\ndiff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c\nindex 8a7015a0b..72f3c16c1 100644\n--- a/drivers/net/kni/rte_eth_kni.c\n+++ b/drivers/net/kni/rte_eth_kni.c\n@@ -410,8 +410,7 @@ eth_kni_probe(struct rte_vdev_device *vdev)\n \tparams = rte_vdev_device_args(vdev);\n \tPMD_LOG(INFO, \"Initializing eth_kni for %s\", name);\n \n-\tif (rte_eal_process_type() == RTE_PROC_SECONDARY &&\n-\t    strlen(params) == 0) {\n+\tif (rte_eal_process_type() == RTE_PROC_SECONDARY) {\n \t\teth_dev = rte_eth_dev_attach_secondary(name);\n \t\tif (!eth_dev) {\n \t\t\tPMD_LOG(ERR, \"Failed to probe %s\", name);\n@@ -464,6 +463,9 @@ eth_kni_remove(struct rte_vdev_device *vdev)\n \tif (eth_dev == NULL)\n \t\treturn -1;\n \n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\t\treturn rte_eth_dev_release_port_secondary(eth_dev);\n+\n \teth_kni_dev_stop(eth_dev);\n \n \tinternals = eth_dev->data->dev_private;\ndiff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c\nindex de10b5bdf..1e8237a41 100644\n--- a/drivers/net/null/rte_eth_null.c\n+++ b/drivers/net/null/rte_eth_null.c\n@@ -614,8 +614,7 @@ rte_pmd_null_probe(struct rte_vdev_device *dev)\n \tparams = rte_vdev_device_args(dev);\n \tPMD_LOG(INFO, \"Initializing pmd_null for %s\", name);\n \n-\tif (rte_eal_process_type() == RTE_PROC_SECONDARY &&\n-\t    strlen(params) == 0) {\n+\tif (rte_eal_process_type() == RTE_PROC_SECONDARY) {\n \t\teth_dev = rte_eth_dev_attach_secondary(name);\n \t\tif (!eth_dev) {\n \t\t\tPMD_LOG(ERR, \"Failed to probe %s\", name);\n@@ -680,6 +679,9 @@ rte_pmd_null_remove(struct rte_vdev_device *dev)\n \tif (eth_dev == NULL)\n \t\treturn -1;\n \n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\t\treturn rte_eth_dev_release_port_secondary(eth_dev);\n+\n \trte_free(eth_dev->data->dev_private);\n \n \trte_eth_dev_release_port(eth_dev);\ndiff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c\nindex 71843c63a..5431b44dc 100644\n--- a/drivers/net/octeontx/octeontx_ethdev.c\n+++ b/drivers/net/octeontx/octeontx_ethdev.c\n@@ -1133,6 +1133,11 @@ octeontx_remove(struct rte_vdev_device *dev)\n \t\tif (eth_dev == NULL)\n \t\t\treturn -ENODEV;\n \n+\t\tif (rte_eal_process_type() != RTE_PROC_PRIMARY) {\n+\t\t\trte_eth_dev_release_port_secondary(eth_dev);\n+\t\t\tcontinue;\n+\t\t}\n+\n \t\tnic = octeontx_pmd_priv(eth_dev);\n \t\trte_event_dev_stop(nic->evdev);\n \t\tPMD_INIT_LOG(INFO, \"Closing octeontx device %s\", octtx_name);\n@@ -1143,6 +1148,9 @@ octeontx_remove(struct rte_vdev_device *dev)\n \t\trte_event_dev_close(nic->evdev);\n \t}\n \n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\t\treturn 0;\n+\n \t/* Free FC resource */\n \tocteontx_pko_fc_free();\n \ndiff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c\nindex a015a9d48..8146602a7 100644\n--- a/drivers/net/pcap/rte_eth_pcap.c\n+++ b/drivers/net/pcap/rte_eth_pcap.c\n@@ -1007,8 +1007,7 @@ pmd_pcap_probe(struct rte_vdev_device *dev)\n \tstart_cycles = rte_get_timer_cycles();\n \thz = rte_get_timer_hz();\n \n-\tif (rte_eal_process_type() == RTE_PROC_SECONDARY &&\n-\t    strlen(rte_vdev_device_args(dev)) == 0) {\n+\tif (rte_eal_process_type() == RTE_PROC_SECONDARY) {\n \t\teth_dev = rte_eth_dev_attach_secondary(name);\n \t\tif (!eth_dev) {\n \t\t\tPMD_LOG(ERR, \"Failed to probe %s\", name);\n@@ -1107,6 +1106,9 @@ pmd_pcap_remove(struct rte_vdev_device *dev)\n \tif (eth_dev == NULL)\n \t\treturn -1;\n \n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\t\treturn rte_eth_dev_release_port_secondary(eth_dev);\n+\n \trte_free(eth_dev->data->dev_private);\n \n \trte_eth_dev_release_port(eth_dev);\ndiff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c\nindex ad5ae988b..84aaf2410 100644\n--- a/drivers/net/tap/rte_eth_tap.c\n+++ b/drivers/net/tap/rte_eth_tap.c\n@@ -1992,8 +1992,7 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)\n \tname = rte_vdev_device_name(dev);\n \tparams = rte_vdev_device_args(dev);\n \n-\tif (rte_eal_process_type() == RTE_PROC_SECONDARY &&\n-\t    strlen(params) == 0) {\n+\tif (rte_eal_process_type() == RTE_PROC_SECONDARY) {\n \t\teth_dev = rte_eth_dev_attach_secondary(name);\n \t\tif (!eth_dev) {\n \t\t\tTAP_LOG(ERR, \"Failed to probe %s\", name);\n@@ -2075,7 +2074,10 @@ rte_pmd_tap_remove(struct rte_vdev_device *dev)\n \t/* find the ethdev entry */\n \teth_dev = rte_eth_dev_allocated(rte_vdev_device_name(dev));\n \tif (!eth_dev)\n-\t\treturn 0;\n+\t\treturn -ENODEV;\n+\n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\t\treturn rte_eth_dev_release_port_secondary(eth_dev);\n \n \tinternals = eth_dev->data->dev_private;\n \ndiff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c\nindex aa6052221..a7604ff23 100644\n--- a/drivers/net/vhost/rte_eth_vhost.c\n+++ b/drivers/net/vhost/rte_eth_vhost.c\n@@ -1344,8 +1344,7 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)\n \n \tVHOST_LOG(INFO, \"Initializing pmd_vhost for %s\\n\", name);\n \n-\tif (rte_eal_process_type() == RTE_PROC_SECONDARY &&\n-\t    strlen(rte_vdev_device_args(dev)) == 0) {\n+\tif (rte_eal_process_type() == RTE_PROC_SECONDARY) {\n \t\teth_dev = rte_eth_dev_attach_secondary(name);\n \t\tif (!eth_dev) {\n \t\t\tVHOST_LOG(ERR, \"Failed to probe %s\\n\", name);\n@@ -1436,6 +1435,9 @@ rte_pmd_vhost_remove(struct rte_vdev_device *dev)\n \tif (eth_dev == NULL)\n \t\treturn -ENODEV;\n \n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\t\treturn rte_eth_dev_release_port_secondary(eth_dev);\n+\n \teth_dev_close(eth_dev);\n \n \trte_free(vring_states[eth_dev->data->port_id]);\n",
    "prefixes": [
        "v16",
        "4/6"
    ]
}