get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 43772,
    "url": "http://patches.dpdk.org/api/patches/43772/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1534503016-31805-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": "<1534503016-31805-2-git-send-email-jia.guo@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1534503016-31805-2-git-send-email-jia.guo@intel.com",
    "date": "2018-08-17T10:50:13",
    "name": "[v6,1/4] ethdev: Add eal device event callback",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "41ca5c9943196d235c8ee0e98f85af91386175cf",
    "submitter": {
        "id": 507,
        "url": "http://patches.dpdk.org/api/people/507/?format=api",
        "name": "Guo, Jia",
        "email": "jia.guo@intel.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1534503016-31805-2-git-send-email-jia.guo@intel.com/mbox/",
    "series": [
        {
            "id": 1009,
            "url": "http://patches.dpdk.org/api/series/1009/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1009",
            "date": "2018-08-17T10:50:12",
            "name": "Install eal event handler in i40e/ixgbe",
            "version": 6,
            "mbox": "http://patches.dpdk.org/series/1009/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/43772/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/43772/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 DE0692A62;\n\tFri, 17 Aug 2018 12:53:24 +0200 (CEST)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby dpdk.org (Postfix) with ESMTP id E825D98\n\tfor <dev@dpdk.org>; Fri, 17 Aug 2018 12:53:21 +0200 (CEST)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t17 Aug 2018 03:53:20 -0700",
            "from jeffguo-z170x-ud5.sh.intel.com (HELO localhost.localdomain)\n\t([10.67.104.10])\n\tby orsmga003.jf.intel.com with ESMTP; 17 Aug 2018 03:53:00 -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,250,1531810800\"; d=\"scan'208\";a=\"76129646\"",
        "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": "Fri, 17 Aug 2018 18:50:13 +0800",
        "Message-Id": "<1534503016-31805-2-git-send-email-jia.guo@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1534503016-31805-1-git-send-email-jia.guo@intel.com>",
        "References": "<1530787185-5915-1-git-send-email-jia.guo@intel.com>\n\t<1534503016-31805-1-git-send-email-jia.guo@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v6 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/unintall APIs in\nEthdev as below:\n - rte_eth_dev_event_handler_install\n - rte_eth_dev_event_handler_uninstall\n\nEach ethdev could call these APIs to install eal event handler in the PMDs,\nwith each callback corresponding to one port, and process the eal device\nevent for the specific port. Especially, it could use for process the\nhotplug event.\n\nSigned-off-by: Jeff Guo <jia.guo@intel.com>\nReviewed-by: Qi Zhang <qi.z.zhang@intel.com>\n---\nv6->v5:\nrefine commit log\n---\n doc/guides/rel_notes/release_18_08.rst   | 12 +++++++\n lib/librte_ethdev/rte_ethdev.c           | 61 ++++++++++++++++++++++++++++++++\n lib/librte_ethdev/rte_ethdev_driver.h    | 32 +++++++++++++++++\n lib/librte_ethdev/rte_ethdev_version.map |  2 ++\n 4 files changed, 107 insertions(+)",
    "diff": "diff --git a/doc/guides/rel_notes/release_18_08.rst b/doc/guides/rel_notes/release_18_08.rst\nindex 95dc1e0..90478cf 100644\n--- a/doc/guides/rel_notes/release_18_08.rst\n+++ b/doc/guides/rel_notes/release_18_08.rst\n@@ -122,6 +122,18 @@ New Features\n   ``rte_dev_hotplug_handle_enable`` and ``rte_dev_hotplug_handle_disable`` are\n   for enable or disable failure handle mechanism for hotplug.\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 4c32025..d68bd4c 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -4417,6 +4417,67 @@ 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       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\tRTE_ETHDEV_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\tRTE_ETHDEV_LOG(INFO, \"The device %s has been added!\\n\",\n+\t\t\t       device_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\t\t eth_dev_event_callback,\n+\t\t\t\t\t\t eth_dev);\n+\tif (result)\n+\t\tRTE_ETHDEV_LOG(ERR, \"device event callback register failed \"\n+\t\t\t       \"for 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\t\t   eth_dev_event_callback,\n+\t\t\t\t\t\t   eth_dev);\n+\tif (result)\n+\t\tRTE_ETHDEV_LOG(ERR, \"device event callback unregister failed \"\n+\t\t\t       \"for device:%s!\\n\", eth_dev->device->name);\n+\n+\treturn result;\n+}\n+\n RTE_INIT(ethdev_init_log)\n {\n \trte_eth_dev_logtype = rte_log_register(\"lib.ethdev\");\ndiff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h\nindex c6d9bc1..7e3d085 100644\n--- a/lib/librte_ethdev/rte_ethdev_driver.h\n+++ b/lib/librte_ethdev/rte_ethdev_driver.h\n@@ -81,6 +81,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 38f117f..3cc02b6 100644\n--- a/lib/librte_ethdev/rte_ethdev_version.map\n+++ b/lib/librte_ethdev/rte_ethdev_version.map\n@@ -227,6 +227,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": [
        "v6",
        "1/4"
    ]
}