Show a patch.

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

{
    "id": 41943,
    "url": "http://patches.dpdk.org/api/patches/41943/?format=api",
    "web_url": "http://patches.dpdk.org/patch/41943/",
    "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"
    },
    "msgid": "<1530267871-7161-6-git-send-email-jia.guo@intel.com>",
    "date": "2018-06-29T10:24:27",
    "name": "[V4,5/9] bus: add helper to handle sigbus",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c2ced96eb83c657d5ac2cd4048029a7f1ac70a3f",
    "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/patch/41943/mbox/",
    "series": [
        {
            "id": 314,
            "url": "http://patches.dpdk.org/api/series/314/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=314",
            "date": "2018-06-29T10:24:22",
            "name": "hot plug failure handle mechanism",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/314/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/41943/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/41943/checks/",
    "tags": {},
    "headers": {
        "X-Mailer": "git-send-email 2.7.4",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Precedence": "list",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Date": "Fri, 29 Jun 2018 18:24:27 +0800",
        "X-Mailman-Version": "2.1.15",
        "Delivered-To": "patchwork@dpdk.org",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "Cc": "jblunck@infradead.org, shreyansh.jain@nxp.com, dev@dpdk.org,\n\tjia.guo@intel.com, helin.zhang@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, bernard.iremonger@intel.com",
        "Errors-To": "dev-bounces@dpdk.org",
        "References": "<1530267871-7161-1-git-send-email-jia.guo@intel.com>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "From": "Jeff Guo <jia.guo@intel.com>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,285,1526367600\"; d=\"scan'208\";a=\"241324447\"",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 1FFEF1B52A;\n\tFri, 29 Jun 2018 12:27:11 +0200 (CEST)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id EEC151B51F\n\tfor <dev@dpdk.org>; Fri, 29 Jun 2018 12:27:06 +0200 (CEST)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t29 Jun 2018 03:27:06 -0700",
            "from jeffguo-z170x-ud5.sh.intel.com (HELO localhost.localdomain)\n\t([10.67.104.10])\n\tby fmsmga005.fm.intel.com with ESMTP; 29 Jun 2018 03:27:03 -0700"
        ],
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Amp-File-Uploaded": "False",
        "Subject": "[dpdk-dev] [PATCH V4 5/9] bus: add helper to handle sigbus",
        "In-Reply-To": "<1530267871-7161-1-git-send-email-jia.guo@intel.com>",
        "Message-Id": "<1530267871-7161-6-git-send-email-jia.guo@intel.com>",
        "X-ExtLoop1": "1",
        "X-BeenThere": "dev@dpdk.org",
        "X-Original-To": "patchwork@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>\n---\nv4->v3:\nsplit patches to be small and clear.\n---\n lib/librte_eal/common/eal_common_bus.c | 34 +++++++++++++++++++++++++++++++++-\n lib/librte_eal/common/eal_private.h    | 11 +++++++++++\n 2 files changed, 44 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c\nindex 0943851..34c4f2d 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@@ -220,7 +221,6 @@ rte_bus_find_by_device_name(const char *str)\n \treturn rte_bus_find(NULL, bus_can_parse, name);\n }\n \n-\n /*\n  * Get iommu class of devices on the bus.\n  */\n@@ -242,3 +242,35 @@ 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+\treturn !(bus->sigbus_handler && bus->sigbus_handler(failure_addr) <= 0);\n+}\n+\n+int\n+rte_bus_sigbus_handler(const void *failure_addr)\n+{\n+\tstruct rte_bus *bus;\n+\tint old_errno = rte_errno;\n+\tint ret = 0;\n+\n+\trte_errno = 0;\n+\n+\tbus = rte_bus_find(NULL, bus_handle_sigbus, failure_addr);\n+\tif (bus == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"No bus can handle the sigbus error!\");\n+\t\tret = -1;\n+\t} else if (rte_errno != 0) {\n+\t\tRTE_LOG(ERR, EAL, \"Failed to handle the sigbus error!\");\n+\t\tret = -1;\n+\t}\n+\n+\t/* if sigbus not be handled, return back old errno. */\n+\tif (ret)\n+\t\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..9517f2b 100644\n--- a/lib/librte_eal/common/eal_private.h\n+++ b/lib/librte_eal/common/eal_private.h\n@@ -258,4 +258,15 @@ int rte_mp_channel_init(void);\n  */\n void dev_callback_process(char *device_name, enum rte_dev_event_type event);\n \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 on success.\n+ *\t-1 on error\n+ */\n+int rte_bus_sigbus_handler(const void *failure_addr);\n #endif /* _EAL_PRIVATE_H_ */\n",
    "prefixes": [
        "V4",
        "5/9"
    ]
}