get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 42708,
    "url": "http://patches.dpdk.org/api/patches/42708/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1531227098-29564-2-git-send-email-jia.guo@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": "<1531227098-29564-2-git-send-email-jia.guo@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1531227098-29564-2-git-send-email-jia.guo@intel.com",
    "date": "2018-07-10T12:51:35",
    "name": "[v4,1/4] ethdev: Add API to enable device event handler",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a09095f6e10a32491cbbdc868d737a8387fda29e",
    "submitter": {
        "id": 507,
        "url": "http://patches.dpdk.org/api/people/507/?format=api",
        "name": "Guo, Jia",
        "email": "jia.guo@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/1531227098-29564-2-git-send-email-jia.guo@intel.com/mbox/",
    "series": [
        {
            "id": 494,
            "url": "http://patches.dpdk.org/api/series/494/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=494",
            "date": "2018-07-10T12:51:34",
            "name": "Enable eal hotplug event handler in ethdev",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/494/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/42708/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/42708/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 DAAE21B3BA;\n\tTue, 10 Jul 2018 14:53:58 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 250861B3B6\n\tfor <dev@dpdk.org>; Tue, 10 Jul 2018 14:53:55 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t10 Jul 2018 05:53:56 -0700",
            "from jeffguo-z170x-ud5.sh.intel.com (HELO localhost.localdomain)\n\t([10.67.104.10])\n\tby fmsmga004.fm.intel.com with ESMTP; 10 Jul 2018 05:53:53 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,334,1526367600\"; d=\"scan'208\";a=\"70159581\"",
        "From": "Jeff Guo <jia.guo@intel.com>",
        "To": "stephen@networkplumber.org, bruce.richardson@intel.com,\n\tferruh.yigit@intel.com, konstantin.ananyev@intel.com,\n\tgaetan.rivet@6wind.com, jingjing.wu@intel.com, thomas@monjalon.net,\n\tmotih@mellanox.com, matan@mellanox.com, harry.van.haaren@intel.com,\n\tqi.z.zhang@intel.com, shaopeng.he@intel.com,\n\tbernard.iremonger@intel.com, arybchenko@solarflare.com",
        "Cc": "jblunck@infradead.org, shreyansh.jain@nxp.com, dev@dpdk.org,\n\tjia.guo@intel.com, helin.zhang@intel.com",
        "Date": "Tue, 10 Jul 2018 20:51:35 +0800",
        "Message-Id": "<1531227098-29564-2-git-send-email-jia.guo@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1531227098-29564-1-git-send-email-jia.guo@intel.com>",
        "References": "<1530787185-5915-1-git-send-email-jia.guo@intel.com>\n\t<1531227098-29564-1-git-send-email-jia.guo@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v4 1/4] ethdev: Add API to enable device event\n\thandler",
        "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": "Implement a couple of eal device event handler install/uninstall APIs\nin ethdev, it could let PMDs have chance to manage the eal device event,\nsuch as register device event callback, then monitor and process the\nhotplug event.\n\nSigned-off-by: Jeff Guo <jia.guo@intel.com>\n---\nv4->v3:\nchange to use eal device event handler install api\n---\n doc/guides/rel_notes/release_18_08.rst | 12 +++++++\n lib/librte_ethdev/rte_ethdev.c         | 59 ++++++++++++++++++++++++++++++++++\n lib/librte_ethdev/rte_ethdev_driver.h  | 32 ++++++++++++++++++\n 3 files changed, 103 insertions(+)",
    "diff": "diff --git a/doc/guides/rel_notes/release_18_08.rst b/doc/guides/rel_notes/release_18_08.rst\nindex bc01242..b6482ce 100644\n--- a/doc/guides/rel_notes/release_18_08.rst\n+++ b/doc/guides/rel_notes/release_18_08.rst\n@@ -46,6 +46,18 @@ New Features\n   Flow API support has been added to CXGBE Poll Mode Driver to offload\n   flows to Chelsio T5/T6 NICs.\n \n+* **Added eal device event process helper in ethdev.**\n+\n+  Implement a couple of eal device event handler install/uninstall APIs in\n+  ethdev, these helper could let PMDs have chance to manage the eal device\n+  event, such as register device event callback, then monitor and process\n+  hotplug event.\n+\n+  * ``rte_eth_dev_event_handler_install`` for PMDs use to install the device\n+    event handler.\n+  * ``rte_eth_dev_event_handler_uninstall`` for PMDs use to uninstall the device\n+    event handler.\n+\n \n API Changes\n -----------\ndiff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex a9977df..09ea02d 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -4518,6 +4518,65 @@ rte_eth_devargs_parse(const char *dargs, struct rte_eth_devargs *eth_da)\n \treturn result;\n }\n \n+static void __rte_experimental\n+eth_dev_event_callback(char *device_name, enum rte_dev_event_type type,\n+\t\t\t     void *arg)\n+{\n+\tstruct rte_eth_dev *eth_dev = (struct rte_eth_dev *)arg;\n+\n+\tswitch (type) {\n+\tcase RTE_DEV_EVENT_REMOVE:\n+\t\tethdev_log(INFO, \"The device: %s has been removed!\\n\",\n+\t\t\t    device_name);\n+\n+\t\tif (!device_name || !eth_dev)\n+\t\t\treturn;\n+\n+\t\tif (!(eth_dev->data->dev_flags & RTE_ETH_EVENT_INTR_RMV))\n+\t\t\treturn;\n+\n+\t\tif (!strcmp(device_name, eth_dev->device->name))\n+\t\t\t_rte_eth_dev_callback_process(eth_dev,\n+\t\t\t\t\t\t      RTE_ETH_EVENT_INTR_RMV,\n+\t\t\t\t\t\t      NULL);\n+\t\tbreak;\n+\tcase RTE_DEV_EVENT_ADD:\n+\t\tethdev_log(INFO, \"The device: %s has been added!\\n\",\n+\t\t\tdevice_name);\n+\t\tbreak;\n+\tdefault:\n+\t\tbreak;\n+\t}\n+}\n+\n+int __rte_experimental\n+rte_eth_dev_event_handler_install(struct rte_eth_dev *eth_dev)\n+{\n+\tint result = 0;\n+\n+\tresult = rte_dev_event_callback_register(eth_dev->device->name,\n+\t\t\t\t\teth_dev_event_callback, eth_dev);\n+\tif (result)\n+\t\tRTE_LOG(ERR, EAL, \"device event callback register failed for \"\n+\t\t\t\"device:%s!\\n\", eth_dev->device->name);\n+\n+\treturn result;\n+}\n+\n+int __rte_experimental\n+rte_eth_dev_event_handler_uninstall(struct rte_eth_dev *eth_dev)\n+{\n+\tint result = 0;\n+\n+\tresult = rte_dev_event_callback_unregister(eth_dev->device->name,\n+\t\t\t\t\teth_dev_event_callback, eth_dev);\n+\tif (result)\n+\t\tRTE_LOG(ERR, EAL, \"device event callback unregister failed for\"\n+\t\t\t\" device:%s!\\n\", eth_dev->device->name);\n+\n+\treturn result;\n+}\n+\n RTE_INIT(ethdev_init_log);\n static void\n ethdev_init_log(void)\ndiff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h\nindex c9c825e..3de1cd4 100644\n--- a/lib/librte_ethdev/rte_ethdev_driver.h\n+++ b/lib/librte_ethdev/rte_ethdev_driver.h\n@@ -82,6 +82,38 @@ int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);\n void _rte_eth_dev_reset(struct rte_eth_dev *dev);\n \n /**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Implement a helper to install the device event handler for the specific\n+ * ether device.\n+ *\n+ * @param dev\n+ *  Pointer to struct rte_eth_dev.\n+ *\n+ * @return\n+ *   - 0 on success, negative on error\n+ */\n+int __rte_experimental\n+rte_eth_dev_event_handler_install(struct rte_eth_dev *dev);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Implement a helper to uninstall the device event handler for the specific\n+ * ether device.\n+ *\n+ * @param dev\n+ *  Pointer to struct rte_eth_dev.\n+ *\n+ * @return\n+ *   - 0 on success, negative on error\n+ */\n+int __rte_experimental\n+rte_eth_dev_event_handler_uninstall(struct rte_eth_dev *dev);\n+\n+/**\n  * @internal Executes all the user application registered callbacks for\n  * the specific device. It is for DPDK internal user only. User\n  * application should not call it directly.\n",
    "prefixes": [
        "v4",
        "1/4"
    ]
}