Show a patch.

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

{
    "id": 40747,
    "url": "http://patches.dpdk.org/api/patches/40747/",
    "web_url": "http://patches.dpdk.org/patch/40747/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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-4-qi.z.zhang@intel.com>",
    "date": "2018-06-07T12:38:30",
    "name": "[dpdk-dev,03/22] ethdev: add function to release port in local process",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4099f5fcf71c81b832e7f0ce796122f413851dc3",
    "submitter": {
        "id": 504,
        "url": "http://patches.dpdk.org/api/people/504/",
        "name": "Zhang, Qi Z",
        "email": "qi.z.zhang@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/patch/40747/mbox/",
    "series": [
        {
            "id": 30,
            "url": "http://patches.dpdk.org/api/series/30/",
            "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/40747/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/40747/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:30 +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=\"62605530\"",
        "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 785E11B1CF;\n\tThu,  7 Jun 2018 14:38:30 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 8CD241B1B9\n\tfor <dev@dpdk.org>; Thu,  7 Jun 2018 14:38:28 +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:28 -0700",
            "from dpdk51.sh.intel.com ([10.67.110.184])\n\tby orsmga001.jf.intel.com with ESMTP; 07 Jun 2018 05:38:26 -0700"
        ],
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "X-Amp-File-Uploaded": "False",
        "Subject": "[dpdk-dev] [PATCH 03/22] ethdev: add function to release port in\n\tlocal process",
        "In-Reply-To": "<20180607123849.14439-1-qi.z.zhang@intel.com>",
        "Message-Id": "<20180607123849.14439-4-qi.z.zhang@intel.com>",
        "X-ExtLoop1": "1",
        "X-BeenThere": "dev@dpdk.org",
        "X-Original-To": "patchwork@dpdk.org"
    },
    "content": "Add driver API rte_eth_release_port_local to support the requirement\nthat an ethdev only be released on secondary process, so only local\nstate be set to unused , share data will not be reset so primary\nprocess can still use it.\n\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n lib/librte_ethdev/rte_ethdev.c        | 24 +++++++++++++++++++++---\n lib/librte_ethdev/rte_ethdev_driver.h | 13 +++++++++++++\n 2 files changed, 34 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex cd4bfd3c6..ec14adb91 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -359,6 +359,23 @@ rte_eth_dev_attach_secondary(const char *name)\n }\n \n int\n+rte_eth_dev_release_port_local(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+\n+\trte_spinlock_lock(&rte_eth_dev_shared_data->ownership_lock);\n+\n+\teth_dev->state = RTE_ETH_DEV_UNUSED;\n+\n+\trte_spinlock_unlock(&rte_eth_dev_shared_data->ownership_lock);\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@@ -370,9 +387,10 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev)\n \n \trte_spinlock_lock(&rte_eth_dev_shared_data->ownership_lock);\n \n-\teth_dev->state = RTE_ETH_DEV_UNUSED;\n-\n-\tmemset(eth_dev->data, 0, sizeof(struct rte_eth_dev_data));\n+\tif (eth_dev->state != RTE_ETH_DEV_UNUSED) {\n+\t\teth_dev->state = RTE_ETH_DEV_UNUSED;\n+\t\tmemset(eth_dev->data, 0, sizeof(struct rte_eth_dev_data));\n+\t}\n \n \trte_spinlock_unlock(&rte_eth_dev_shared_data->ownership_lock);\n \ndiff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h\nindex c9c825e3f..261335426 100644\n--- a/lib/librte_ethdev/rte_ethdev_driver.h\n+++ b/lib/librte_ethdev/rte_ethdev_driver.h\n@@ -70,6 +70,19 @@ int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);\n \n /**\n  * @internal\n+ * Release the specified ethdev port in local process, only set to ethdev\n+ * state to unused, but not reset share data since it assume other process\n+ * is still using it, typically it is called by secondary process.\n+ *\n+ * @param eth_dev\n+ * The *eth_dev* pointer is the address of the *rte_eth_dev* structure.\n+ * @return\n+ *   - 0 on success, negative on error\n+ */\n+int rte_eth_dev_release_port_local(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  *\n",
    "prefixes": [
        "dpdk-dev",
        "03/22"
    ]
}