Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/42824/?format=api
http://patchwork.dpdk.org/api/patches/42824/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1531305717-15504-6-git-send-email-jia.guo@intel.com/", "project": { "id": 1, "url": "http://patchwork.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": "<1531305717-15504-6-git-send-email-jia.guo@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1531305717-15504-6-git-send-email-jia.guo@intel.com", "date": "2018-07-11T10:41:55", "name": "[v9,5/7] bus: add helper to handle sigbus", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "f62603db93f3217e456f77d2518e741c3b2e26e1", "submitter": { "id": 507, "url": "http://patchwork.dpdk.org/api/people/507/?format=api", "name": "Guo, Jia", "email": "jia.guo@intel.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1531305717-15504-6-git-send-email-jia.guo@intel.com/mbox/", "series": [ { "id": 517, "url": "http://patchwork.dpdk.org/api/series/517/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=517", "date": "2018-07-11T10:41:50", "name": "hotplug failure handle mechanism", "version": 9, "mbox": "http://patchwork.dpdk.org/series/517/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/42824/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/42824/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 8247D1B575;\n\tWed, 11 Jul 2018 12:44:40 +0200 (CEST)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 10DDC1B560\n\tfor <dev@dpdk.org>; Wed, 11 Jul 2018 12:44:33 +0200 (CEST)", "from fmsmga008.fm.intel.com ([10.253.24.58])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t11 Jul 2018 03:44:31 -0700", "from jeffguo-z170x-ud5.sh.intel.com (HELO localhost.localdomain)\n\t([10.67.104.10])\n\tby fmsmga008.fm.intel.com with ESMTP; 11 Jul 2018 03:44:27 -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=\"54202527\"", "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": "Wed, 11 Jul 2018 18:41:55 +0800", "Message-Id": "<1531305717-15504-6-git-send-email-jia.guo@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1531305717-15504-1-git-send-email-jia.guo@intel.com>", "References": "<1498711073-42917-1-git-send-email-jia.guo@intel.com>\n\t<1531305717-15504-1-git-send-email-jia.guo@intel.com>", "Subject": "[dpdk-dev] [PATCH v9 5/7] bus: add helper to handle sigbus", "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": "This patch aim to add a helper to iterate all buses to find the\ncorresponding bus to handle the sigbus error.\n\nSigned-off-by: Jeff Guo <jia.guo@intel.com>\nAcked-by: Shaopeng He <shaopeng.he@intel.com>\n---\nv9->v8:\nno change\n---\n lib/librte_eal/common/eal_common_bus.c | 43 ++++++++++++++++++++++++++++++++++\n lib/librte_eal/common/eal_private.h | 12 ++++++++++\n 2 files changed, 55 insertions(+)", "diff": "diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c\nindex 0943851..62b7318 100644\n--- a/lib/librte_eal/common/eal_common_bus.c\n+++ b/lib/librte_eal/common/eal_common_bus.c\n@@ -37,6 +37,7 @@\n #include <rte_bus.h>\n #include <rte_debug.h>\n #include <rte_string_fns.h>\n+#include <rte_errno.h>\n \n #include \"eal_private.h\"\n \n@@ -242,3 +243,45 @@ rte_bus_get_iommu_class(void)\n \t}\n \treturn mode;\n }\n+\n+static int\n+bus_handle_sigbus(const struct rte_bus *bus,\n+\t\t\tconst void *failure_addr)\n+{\n+\tint ret;\n+\n+\tif (!bus->sigbus_handler)\n+\t\treturn -1;\n+\n+\tret = bus->sigbus_handler(failure_addr);\n+\n+\t/* find bus but handle failed, keep the errno be set. */\n+\tif (ret < 0 && rte_errno == 0)\n+\t\trte_errno = ENOTSUP;\n+\n+\treturn ret > 0;\n+}\n+\n+int\n+rte_bus_sigbus_handler(const void *failure_addr)\n+{\n+\tstruct rte_bus *bus;\n+\n+\tint ret = 0;\n+\tint old_errno = rte_errno;\n+\n+\trte_errno = 0;\n+\n+\tbus = rte_bus_find(NULL, bus_handle_sigbus, failure_addr);\n+\t/* can not find bus. */\n+\tif (!bus)\n+\t\treturn 1;\n+\t/* find bus but handle failed, pass on the new errno. */\n+\telse if (rte_errno != 0)\n+\t\treturn -1;\n+\n+\t/* restore the old errno. */\n+\trte_errno = old_errno;\n+\n+\treturn ret;\n+}\ndiff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h\nindex bdadc4d..2337e71 100644\n--- a/lib/librte_eal/common/eal_private.h\n+++ b/lib/librte_eal/common/eal_private.h\n@@ -258,4 +258,16 @@ int rte_mp_channel_init(void);\n */\n void dev_callback_process(char *device_name, enum rte_dev_event_type event);\n \n+/**\n+ * Iterate all buses to find the corresponding bus, to handle the sigbus error.\n+ * @param failure_addr\n+ *\tPointer of the fault address of the sigbus error.\n+ *\n+ * @return\n+ *\t 0 success to handle the sigbus.\n+ *\t-1 failed to handle the sigbus\n+ *\t 1 no bus can handler the sigbus\n+ */\n+int rte_bus_sigbus_handler(const void *failure_addr);\n+\n #endif /* _EAL_PRIVATE_H_ */\n", "prefixes": [ "v9", "5/7" ] }{ "id": 42824, "url": "