Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/45846/?format=api
http://patches.dpdk.org/api/patches/45846/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1538483561-96182-5-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": "<1538483561-96182-5-git-send-email-jia.guo@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1538483561-96182-5-git-send-email-jia.guo@intel.com", "date": "2018-10-02T12:32:38", "name": "[v12,4/7] bus/pci: implement sigbus handler ops", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "259268b89f26361ece27b31bb514d85ca7922b6e", "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/1538483561-96182-5-git-send-email-jia.guo@intel.com/mbox/", "series": [ { "id": 1635, "url": "http://patches.dpdk.org/api/series/1635/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1635", "date": "2018-10-02T12:32:35", "name": "hot-unplug failure handle mechanism", "version": 12, "mbox": "http://patches.dpdk.org/series/1635/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/45846/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/45846/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 CD2374CC3;\n\tTue, 2 Oct 2018 14:29:24 +0200 (CEST)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id 0AF3D2C37\n\tfor <dev@dpdk.org>; Tue, 2 Oct 2018 14:29:16 +0200 (CEST)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 Oct 2018 05:29:15 -0700", "from jeffguo-s2600wt2.sh.intel.com (HELO localhost.localdomain)\n\t([10.67.110.10])\n\tby fmsmga005.fm.intel.com with ESMTP; 02 Oct 2018 05:29:09 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.54,331,1534834800\"; d=\"scan'208\";a=\"267734662\"", "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,\n\tanatoly.burakov@intel.com, jerin.jacob@caviumnetworks.com", "Cc": "jblunck@infradead.org, shreyansh.jain@nxp.com, dev@dpdk.org,\n\tjia.guo@intel.com, helin.zhang@intel.com", "Date": "Tue, 2 Oct 2018 20:32:38 +0800", "Message-Id": "<1538483561-96182-5-git-send-email-jia.guo@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1538483561-96182-1-git-send-email-jia.guo@intel.com>", "References": "<1498711073-42917-1-git-send-email-jia.guo@intel.com>\n\t<1538483561-96182-1-git-send-email-jia.guo@intel.com>", "Subject": "[dpdk-dev] [PATCH v12 4/7] bus/pci: implement sigbus handler ops", "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 implements the ops for the PCI bus sigbus handler. It finds the\nPCI device that is being hot-unplugged and calls the relevant ops of the\nhot-unplug handler to handle the hot-unplug failure of the device.\n\nSigned-off-by: Jeff Guo <jia.guo@intel.com>\nAcked-by: Shaopeng He <shaopeng.he@intel.com>\n---\nv12->v11:\nno change.\n---\n drivers/bus/pci/pci_common.c | 53 ++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 53 insertions(+)", "diff": "diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c\nindex d286234..f313fe9 100644\n--- a/drivers/bus/pci/pci_common.c\n+++ b/drivers/bus/pci/pci_common.c\n@@ -405,6 +405,36 @@ pci_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,\n \treturn NULL;\n }\n \n+/**\n+ * find the device which encounter the failure, by iterate over all device on\n+ * PCI bus to check if the memory failure address is located in the range\n+ * of the BARs of the device.\n+ */\n+static struct rte_pci_device *\n+pci_find_device_by_addr(const void *failure_addr)\n+{\n+\tstruct rte_pci_device *pdev = NULL;\n+\tint i;\n+\n+\tFOREACH_DEVICE_ON_PCIBUS(pdev) {\n+\t\tfor (i = 0; i != RTE_DIM(pdev->mem_resource); i++) {\n+\t\t\tif ((uint64_t)(uintptr_t)failure_addr >=\n+\t\t\t (uint64_t)(uintptr_t)pdev->mem_resource[i].addr &&\n+\t\t\t (uint64_t)(uintptr_t)failure_addr <\n+\t\t\t (uint64_t)(uintptr_t)pdev->mem_resource[i].addr +\n+\t\t\t pdev->mem_resource[i].len) {\n+\t\t\t\tRTE_LOG(INFO, EAL, \"Failure address \"\n+\t\t\t\t\t\"%16.16\"PRIx64\" belongs to \"\n+\t\t\t\t\t\"device %s!\\n\",\n+\t\t\t\t\t(uint64_t)(uintptr_t)failure_addr,\n+\t\t\t\t\tpdev->device.name);\n+\t\t\t\treturn pdev;\n+\t\t\t}\n+\t\t}\n+\t}\n+\treturn NULL;\n+}\n+\n static int\n pci_hot_unplug_handler(struct rte_device *dev)\n {\n@@ -433,6 +463,28 @@ pci_hot_unplug_handler(struct rte_device *dev)\n }\n \n static int\n+pci_sigbus_handler(const void *failure_addr)\n+{\n+\tstruct rte_pci_device *pdev = NULL;\n+\tint ret = 0;\n+\n+\tpdev = pci_find_device_by_addr(failure_addr);\n+\tif (!pdev) {\n+\t\t/* It is a generic sigbus error, no bus would handle it. */\n+\t\tret = 1;\n+\t} else {\n+\t\t/* The sigbus error is caused of hot-unplug. */\n+\t\tret = pci_hot_unplug_handler(&pdev->device);\n+\t\tif (ret) {\n+\t\t\tRTE_LOG(ERR, EAL, \"Failed to handle hot-unplug for \"\n+\t\t\t\t\"device %s\", pdev->name);\n+\t\t\tret = -1;\n+\t\t}\n+\t}\n+\treturn ret;\n+}\n+\n+static int\n pci_plug(struct rte_device *dev)\n {\n \treturn pci_probe_all_drivers(RTE_DEV_TO_PCI(dev));\n@@ -463,6 +515,7 @@ struct rte_pci_bus rte_pci_bus = {\n \t\t.parse = pci_parse,\n \t\t.get_iommu_class = rte_pci_get_iommu_class,\n \t\t.hot_unplug_handler = pci_hot_unplug_handler,\n+\t\t.sigbus_handler = pci_sigbus_handler,\n \t},\n \t.device_list = TAILQ_HEAD_INITIALIZER(rte_pci_bus.device_list),\n \t.driver_list = TAILQ_HEAD_INITIALIZER(rte_pci_bus.driver_list),\n", "prefixes": [ "v12", "4/7" ] }{ "id": 45846, "url": "