get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 43727,
    "url": "http://patches.dpdk.org/api/patches/43727/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180816030455.41354-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": "<20180816030455.41354-5-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180816030455.41354-5-qi.z.zhang@intel.com",
    "date": "2018-08-16T03:04:52",
    "name": "[v15,4/7] 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/20180816030455.41354-5-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 993,
            "url": "http://patches.dpdk.org/api/series/993/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=993",
            "date": "2018-08-16T03:04:48",
            "name": "enable hotplug on multi-process",
            "version": 15,
            "mbox": "http://patches.dpdk.org/series/993/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/43727/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/43727/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 68F614CA5;\n\tThu, 16 Aug 2018 05:04:27 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id D971F4C95\n\tfor <dev@dpdk.org>; Thu, 16 Aug 2018 05:04:24 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t15 Aug 2018 20:04:24 -0700",
            "from dpdk51.sh.intel.com ([10.67.110.190])\n\tby orsmga002.jf.intel.com with ESMTP; 15 Aug 2018 20:04:22 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.53,245,1531810800\"; d=\"scan'208\";a=\"83720841\"",
        "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": "Thu, 16 Aug 2018 11:04:52 +0800",
        "Message-Id": "<20180816030455.41354-5-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20180816030455.41354-1-qi.z.zhang@intel.com>",
        "References": "<20180607123849.14439-1-qi.z.zhang@intel.com>\n\t<20180816030455.41354-1-qi.z.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v15 4/7] 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 eb3cce3a6..80a390b19 100644\n--- a/drivers/net/af_packet/rte_eth_af_packet.c\n+++ b/drivers/net/af_packet/rte_eth_af_packet.c\n@@ -927,8 +927,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@@ -988,6 +987,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 58f7377c6..47d0f23cc 100644\n--- a/drivers/net/bonding/rte_eth_bond_pmd.c\n+++ b/drivers/net/bonding/rte_eth_bond_pmd.c\n@@ -3186,8 +3186,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@@ -3302,6 +3301,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 085bb8452..3ce14e2b1 100644\n--- a/drivers/net/kni/rte_eth_kni.c\n+++ b/drivers/net/kni/rte_eth_kni.c\n@@ -411,8 +411,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@@ -465,6 +464,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 244f86545..ebe3e35f2 100644\n--- a/drivers/net/null/rte_eth_null.c\n+++ b/drivers/net/null/rte_eth_null.c\n@@ -615,8 +615,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@@ -681,6 +680,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 0f3d5d673..6d044c862 100644\n--- a/drivers/net/octeontx/octeontx_ethdev.c\n+++ b/drivers/net/octeontx/octeontx_ethdev.c\n@@ -1141,6 +1141,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@@ -1151,6 +1156,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 e8810a171..c601b45f0 100644\n--- a/drivers/net/pcap/rte_eth_pcap.c\n+++ b/drivers/net/pcap/rte_eth_pcap.c\n@@ -1008,8 +1008,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@@ -1108,6 +1107,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 feb92b48e..7794a49bb 100644\n--- a/drivers/net/tap/rte_eth_tap.c\n+++ b/drivers/net/tap/rte_eth_tap.c\n@@ -1993,8 +1993,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@@ -2076,7 +2075,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 e58f32211..992f53b56 100644\n--- a/drivers/net/vhost/rte_eth_vhost.c\n+++ b/drivers/net/vhost/rte_eth_vhost.c\n@@ -1345,8 +1345,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@@ -1437,6 +1436,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": [
        "v15",
        "4/7"
    ]
}