get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 43662,
    "url": "http://patches.dpdk.org/api/patches/43662/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180810004213.44497-2-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": "<20180810004213.44497-2-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180810004213.44497-2-qi.z.zhang@intel.com",
    "date": "2018-08-10T00:42:08",
    "name": "[v14,1/6] ethdev: add function to release port in secondary process",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "82bf585be826105a16272f6dec1ada5e85e88d94",
    "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/20180810004213.44497-2-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 956,
            "url": "http://patches.dpdk.org/api/series/956/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=956",
            "date": "2018-08-10T00:42:07",
            "name": "enable hotplug on multi-process",
            "version": 14,
            "mbox": "http://patches.dpdk.org/series/956/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/43662/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/43662/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 37EB92BE6;\n\tFri, 10 Aug 2018 02:41:36 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 2821725D9\n\tfor <dev@dpdk.org>; Fri, 10 Aug 2018 02:41:33 +0200 (CEST)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t09 Aug 2018 17:41:32 -0700",
            "from dpdk51.sh.intel.com ([10.67.110.190])\n\tby fmsmga008.fm.intel.com with ESMTP; 09 Aug 2018 17:41:30 -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,217,1531810800\"; d=\"scan'208\";a=\"62025560\"",
        "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, 10 Aug 2018 08:42:08 +0800",
        "Message-Id": "<20180810004213.44497-2-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20180810004213.44497-1-qi.z.zhang@intel.com>",
        "References": "<20180607123849.14439-1-qi.z.zhang@intel.com>\n\t<20180810004213.44497-1-qi.z.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v14 1/6] ethdev: add function to release port in\n\tsecondary process",
        "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": "Add driver API rte_eth_release_port_secondary to support the\ncase when an ethdev need to be detached on a secondary process.\nLocal state is set to unused and shared data will not be reset\nso the primary process can still use it.\n\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n lib/librte_ethdev/rte_ethdev.c           | 21 ++++++++++++++++++---\n lib/librte_ethdev/rte_ethdev_driver.h    | 16 +++++++++++++++-\n lib/librte_ethdev/rte_ethdev_pci.h       |  9 +++++++--\n lib/librte_ethdev/rte_ethdev_version.map |  7 +++++++\n 4 files changed, 47 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex 4c3202505..c653bf5fa 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -359,6 +359,18 @@ rte_eth_dev_attach_secondary(const char *name)\n }\n \n int\n+rte_eth_dev_release_port_secondary(struct rte_eth_dev *eth_dev)\n+{\n+\tif (eth_dev == NULL)\n+\t\treturn -EINVAL;\n+\n+\t_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_DESTROY, NULL);\n+\teth_dev->state = RTE_ETH_DEV_UNUSED;\n+\n+\treturn 0;\n+}\n+\n+int\n rte_eth_dev_release_port(struct rte_eth_dev *eth_dev)\n {\n \tif (eth_dev == NULL)\n@@ -3532,10 +3544,13 @@ rte_eth_dev_destroy(struct rte_eth_dev *ethdev,\n \t\t\treturn ret;\n \t}\n \n-\tif (rte_eal_process_type() == RTE_PROC_PRIMARY)\n-\t\trte_free(ethdev->data->dev_private);\n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\t\treturn rte_eth_dev_release_port_secondary(ethdev);\n \n-\tethdev->data->dev_private = NULL;\n+\tif (ethdev->data->dev_private != NULL) {\n+\t\trte_free(ethdev->data->dev_private);\n+\t\tethdev->data->dev_private = NULL;\n+\t}\n \n \treturn rte_eth_dev_release_port(ethdev);\n }\ndiff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h\nindex c6d9bc1a3..8fe82d2ab 100644\n--- a/lib/librte_ethdev/rte_ethdev_driver.h\n+++ b/lib/librte_ethdev/rte_ethdev_driver.h\n@@ -61,7 +61,7 @@ struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name);\n  * Release the specified ethdev port.\n  *\n  * @param eth_dev\n- * The *eth_dev* pointer is the address of the *rte_eth_dev* structure.\n+ * Device to be detached.\n  * @return\n  *   - 0 on success, negative on error\n  */\n@@ -69,6 +69,20 @@ int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);\n \n /**\n  * @internal\n+ * Release the specified ethdev port in the local process.\n+ * Only set ethdev state to unused, but not reset shared data since\n+ * it assume other processes is still using it. typically it is\n+ * called by a secondary process.\n+ *\n+ * @param eth_dev\n+ * Device to be detached.\n+ * @return\n+ *   - 0 on success, negative on error\n+ */\n+int rte_eth_dev_release_port_secondary(struct rte_eth_dev *eth_dev);\n+\n+/**\n+ * @internal\n  * Release device queues and clear its configuration to force the user\n  * application to reconfigure it. It is for internal use only.\n  *\ndiff --git a/lib/librte_ethdev/rte_ethdev_pci.h b/lib/librte_ethdev/rte_ethdev_pci.h\nindex f652596f4..c22022e4f 100644\n--- a/lib/librte_ethdev/rte_ethdev_pci.h\n+++ b/lib/librte_ethdev/rte_ethdev_pci.h\n@@ -135,9 +135,14 @@ rte_eth_dev_pci_allocate(struct rte_pci_device *dev, size_t private_data_size)\n static inline void\n rte_eth_dev_pci_release(struct rte_eth_dev *eth_dev)\n {\n-\tif (rte_eal_process_type() == RTE_PROC_PRIMARY)\n-\t\trte_free(eth_dev->data->dev_private);\n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY) {\n+\t\teth_dev->device = NULL;\n+\t\teth_dev->intr_handle = NULL;\n+\t\trte_eth_dev_release_port_secondary(eth_dev);\n+\t}\n \n+\t/* primary process */\n+\trte_free(eth_dev->data->dev_private);\n \teth_dev->data->dev_private = NULL;\n \n \t/*\ndiff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map\nindex 38f117f01..acc407f86 100644\n--- a/lib/librte_ethdev/rte_ethdev_version.map\n+++ b/lib/librte_ethdev/rte_ethdev_version.map\n@@ -220,6 +220,13 @@ DPDK_18.08 {\n \n } DPDK_18.05;\n \n+DPDK_18.11 {\n+\tglobal:\n+\n+\trte_eth_dev_release_port_secondary;\n+\n+} DPDK_18.08;\n+\n EXPERIMENTAL {\n \tglobal:\n \n",
    "prefixes": [
        "v14",
        "1/6"
    ]
}