get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 42830,
    "url": "http://patches.dpdk.org/api/patches/42830/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1531309887-12104-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": "<1531309887-12104-2-git-send-email-jia.guo@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1531309887-12104-2-git-send-email-jia.guo@intel.com",
    "date": "2018-07-11T11:51:24",
    "name": "[v5,1/4] ethdev: Add eal device event callback",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "72744474239b594394ba9d8d2483232665923c22",
    "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/1531309887-12104-2-git-send-email-jia.guo@intel.com/mbox/",
    "series": [
        {
            "id": 519,
            "url": "http://patches.dpdk.org/api/series/519/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=519",
            "date": "2018-07-11T11:51:23",
            "name": "Install eal hotplug event handler in i40e/ixgbe",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/519/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/42830/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/42830/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 C54C31B525;\n\tWed, 11 Jul 2018 13:53:50 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id F14E01B51B\n\tfor <dev@dpdk.org>; Wed, 11 Jul 2018 13:53:47 +0200 (CEST)",
            "from fmsmga007.fm.intel.com ([10.253.24.52])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t11 Jul 2018 04:53:47 -0700",
            "from jeffguo-z170x-ud5.sh.intel.com (HELO localhost.localdomain)\n\t([10.67.104.10])\n\tby fmsmga007.fm.intel.com with ESMTP; 11 Jul 2018 04:53:44 -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,338,1526367600\"; d=\"scan'208\";a=\"53568315\"",
        "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": "Wed, 11 Jul 2018 19:51:24 +0800",
        "Message-Id": "<1531309887-12104-2-git-send-email-jia.guo@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1531309887-12104-1-git-send-email-jia.guo@intel.com>",
        "References": "<1530787185-5915-1-git-send-email-jia.guo@intel.com>\n\t<1531309887-12104-1-git-send-email-jia.guo@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v5 1/4] ethdev: Add eal device event callback",
        "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. Each ethdev install the handler in PMDs, so each callback\ncorresponding with one port, and process the eal device event for specific\nport. If PMDs install the handler when initial device, it could have\nchance to manage the eal device event, such as register device event\ncallback, then monitor and process the hotplug event.\n\nSigned-off-by: Jeff Guo <jia.guo@intel.com>\nReviewed-by: Qi Zhang <qi.z.zhang@intel.com>\n---\nv5->v4:\nrefine some code style and typo\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 lib/librte_ethdev/rte_ethdev_version.map |  2 ++\n 4 files changed, 105 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..4d28db5 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_DEV_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\tethdev_log(ERR, \"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\tethdev_log(ERR, \"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.\ndiff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map\nindex 40cf42b..dbd07a5 100644\n--- a/lib/librte_ethdev/rte_ethdev_version.map\n+++ b/lib/librte_ethdev/rte_ethdev_version.map\n@@ -220,6 +220,8 @@ EXPERIMENTAL {\n \trte_eth_dev_count_total;\n \trte_eth_dev_create;\n \trte_eth_dev_destroy;\n+\trte_eth_dev_event_handler_install;\n+\trte_eth_dev_event_handler_uninstall;\n \trte_eth_dev_get_module_eeprom;\n \trte_eth_dev_get_module_info;\n \trte_eth_dev_is_removed;\n",
    "prefixes": [
        "v5",
        "1/4"
    ]
}