Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/42617/?format=api
http://patches.dpdk.org/api/patches/42617/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1531136777-9815-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": "<1531136777-9815-2-git-send-email-jia.guo@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1531136777-9815-2-git-send-email-jia.guo@intel.com", "date": "2018-07-09T11:46:14", "name": "[v3,1/4] ethdev: Add eal device event callback", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "4a8154016d2b9895083986e69de82d844faa0a06", "submitter": { "id": 507, "url": "http://patches.dpdk.org/api/people/507/?format=api", "name": "Guo, Jia", "email": "jia.guo@intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1531136777-9815-2-git-send-email-jia.guo@intel.com/mbox/", "series": [ { "id": 472, "url": "http://patches.dpdk.org/api/series/472/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=472", "date": "2018-07-09T11:46:13", "name": "Enable eal hotplug event detect for i40e/ixgbe", "version": 3, "mbox": "http://patches.dpdk.org/series/472/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/42617/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/42617/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 97B5F1B293;\n\tMon, 9 Jul 2018 13:48:45 +0200 (CEST)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 86EE01B1CC\n\tfor <dev@dpdk.org>; Mon, 9 Jul 2018 13:48:41 +0200 (CEST)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t09 Jul 2018 04:48:41 -0700", "from jeffguo-z170x-ud5.sh.intel.com (HELO localhost.localdomain)\n\t([10.67.104.10])\n\tby fmsmga002.fm.intel.com with ESMTP; 09 Jul 2018 04:48:37 -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,330,1526367600\"; d=\"scan'208\";a=\"65345347\"", "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, \n\tarybchenko@solarflare.com, wenzhuo.lu@intel.com", "Cc": "jblunck@infradead.org, shreyansh.jain@nxp.com, dev@dpdk.org,\n\tjia.guo@intel.com, helin.zhang@intel.com", "Date": "Mon, 9 Jul 2018 19:46:14 +0800", "Message-Id": "<1531136777-9815-2-git-send-email-jia.guo@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1531136777-9815-1-git-send-email-jia.guo@intel.com>", "References": "<1530787185-5915-1-git-send-email-jia.guo@intel.com>\n\t<1531136777-9815-1-git-send-email-jia.guo@intel.com>", "Subject": "[dpdk-dev] [PATCH v3 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 eal device event callback \"rte_eth_dev_event_callback\"\nin ethdev, it could let pmd driver have chance to manage the eal\ndevice event, such as process hotplug event.\n\nSigned-off-by: Jeff Guo <jia.guo@intel.com>\n---\nv3->v2:\nadd new callback in ethdev\n---\n doc/guides/rel_notes/release_18_08.rst | 8 ++++++++\n lib/librte_ethdev/rte_ethdev.c | 37 ++++++++++++++++++++++++++++++++++\n lib/librte_ethdev/rte_ethdev_driver.h | 20 ++++++++++++++++++\n 3 files changed, 65 insertions(+)", "diff": "diff --git a/doc/guides/rel_notes/release_18_08.rst b/doc/guides/rel_notes/release_18_08.rst\nindex bc01242..2326058 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,14 @@ 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 callback in ethdev for hotplug.**\n+\n+ Implement a eal device event callback in ethdev, it could let pmd driver\n+ have chance to manage the eal device event, such as process hotplug event.\n+\n+ * ``rte_eth_dev_event_callback`` for driver use to register it and process\n+ eal device event.\n+\n \n API Changes\n -----------\ndiff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex a9977df..36f218a 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -4518,6 +4518,43 @@ rte_eth_devargs_parse(const char *dargs, struct rte_eth_devargs *eth_da)\n \treturn result;\n }\n \n+void __rte_experimental\n+rte_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+\tif (type >= RTE_DEV_EVENT_MAX) {\n+\t\tfprintf(stderr, \"%s called upon invalid event %d\\n\",\n+\t\t\t__func__, type);\n+\t\tfflush(stderr);\n+\t}\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 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..fed5afa 100644\n--- a/lib/librte_ethdev/rte_ethdev_driver.h\n+++ b/lib/librte_ethdev/rte_ethdev_driver.h\n@@ -82,6 +82,26 @@ 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 rte eth eal device event callbacks for the specific device.\n+ *\n+ * @param device_name\n+ * Pointer to the name of the rte device.\n+ * @param event\n+ * Eal device event type.\n+ * @param ret_param\n+ * To pass data back to user application.\n+ *\n+ * @return\n+ * void\n+ */\n+void __rte_experimental\n+rte_eth_dev_event_callback(char *device_name,\n+\t\tenum rte_dev_event_type event, void *cb_arg);\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": [ "v3", "1/4" ] }{ "id": 42617, "url": "