get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 19426,
    "url": "http://patches.dpdk.org/api/patches/19426/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1484581107-2025-2-git-send-email-shreyansh.jain@nxp.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": "<1484581107-2025-2-git-send-email-shreyansh.jain@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1484581107-2025-2-git-send-email-shreyansh.jain@nxp.com",
    "date": "2017-01-16T15:38:20",
    "name": "[dpdk-dev,v6,1/8] eal/bus: introduce bus abstraction",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "db6404622d06030c8d89cd711a103e2c4e2a63a9",
    "submitter": {
        "id": 497,
        "url": "http://patches.dpdk.org/api/people/497/?format=api",
        "name": "Shreyansh Jain",
        "email": "shreyansh.jain@nxp.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1484581107-2025-2-git-send-email-shreyansh.jain@nxp.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/19426/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/19426/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 03AB4152A;\n\tMon, 16 Jan 2017 16:35:21 +0100 (CET)",
            "from NAM01-BY2-obe.outbound.protection.outlook.com\n\t(mail-by2nam01on0041.outbound.protection.outlook.com [104.47.34.41])\n\tby dpdk.org (Postfix) with ESMTP id 2CA43152A\n\tfor <dev@dpdk.org>; Mon, 16 Jan 2017 16:35:15 +0100 (CET)",
            "from BN6PR03CA0017.namprd03.prod.outlook.com (10.168.230.155) by\n\tCY4PR03MB2470.namprd03.prod.outlook.com (10.168.163.148) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id\n\t15.1.845.12; Mon, 16 Jan 2017 15:35:14 +0000",
            "from BY2FFO11FD019.protection.gbl (2a01:111:f400:7c0c::128) by\n\tBN6PR03CA0017.outlook.office365.com (2603:10b6:404:23::27) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12 via\n\tFrontend Transport; Mon, 16 Jan 2017 15:35:14 +0000",
            "from tx30smr01.am.freescale.net (192.88.168.50) by\n\tBY2FFO11FD019.mail.protection.outlook.com (10.1.14.107) with\n\tMicrosoft SMTP Server (version=TLS1_0,\n\tcipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8\n\tvia Frontend Transport; Mon, 16 Jan 2017 15:35:13 +0000",
            "from tophie.ap.freescale.net ([10.232.14.39])\n\tby tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id\n\tv0GFZ4mh019448; Mon, 16 Jan 2017 08:35:11 -0700"
        ],
        "Authentication-Results": "spf=fail (sender IP is 192.88.168.50)\n\tsmtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed)\n\theader.d=none; nxp.com; dmarc=fail action=none header.from=nxp.com;\n\tnxp.com; \n\tdkim=none (message not signed) header.d=none;",
        "Received-SPF": "Fail (protection.outlook.com: domain of nxp.com does not\n\tdesignate 192.88.168.50 as permitted sender)\n\treceiver=protection.outlook.com; \n\tclient-ip=192.88.168.50; helo=tx30smr01.am.freescale.net;",
        "From": "Shreyansh Jain <shreyansh.jain@nxp.com>",
        "To": "<david.marchand@6wind.com>",
        "CC": "<dev@dpdk.org>, <thomas.monjalon@6wind.com>, Shreyansh Jain\n\t<shreyansh.jain@nxp.com>",
        "Date": "Mon, 16 Jan 2017 21:08:20 +0530",
        "Message-ID": "<1484581107-2025-2-git-send-email-shreyansh.jain@nxp.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1484581107-2025-1-git-send-email-shreyansh.jain@nxp.com>",
        "References": "<1484581107-2025-1-git-send-email-shreyansh.jain@nxp.com>",
        "X-EOPAttributedMessage": "0",
        "X-Matching-Connectors": "131290545137417137;\n\t(91ab9b29-cfa4-454e-5278-08d120cd25b8); ()",
        "X-Forefront-Antispam-Report": "CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI;\n\tSFV:NSPM;\n\tSFS:(10009020)(6009001)(336005)(7916002)(39380400002)(39840400002)(39850400002)(39410400002)(39860400002)(39400400002)(39450400003)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(50986999)(76176999)(50226002)(97736004)(8936002)(33646002)(5003940100001)(6916009)(2950100002)(36756003)(77096006)(5660300001)(68736007)(47776003)(6666003)(4326007)(27001)(38730400001)(2906002)(626004)(48376002)(50466002)(105606002)(110136003)(189998001)(2351001)(92566002)(104016004)(8656002)(106466001)(54906002)(305945005)(81166006)(81156014)(85426001)(86362001)(356003)(8676002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2470;\n\tH:tx30smr01.am.freescale.net; \n\tFPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; ",
        "X-Microsoft-Exchange-Diagnostics": [
            "1; BY2FFO11FD019;\n\t1:4SQXgvE/hhrLKsi2dKKt6j+wq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E8ZAeO08w5g4fZJxvdHxtnORNAuHsGU4gnMJCDdLiw7OA6jPsmExzDbWIbmZgLap3IMNyfpnUPW3MXZavygT8LuWL/1RYOhbG/SpIbE2m2uPhcaD3yE9wi4IL3vvl5poVsktXe14faiiO5/rjXUXUUJrj+ZwLb4WPXFBwHRJ5pGww3wx96YmgQD/RGg27R7G9iTCy4UR/sDSHlMLz7/bmLcnMQOttLxe2KRjI//uJxE2Y1GNUUVKOtQuls1HsEPIDNRxSuqSaKpb0ck2ATGsYcqJbOPWnDZS2SBUzOE1D9h02M4tT2F1fGyaLLk3cdgoFOgICMJmbXt/6Q5dxVOnjWsLn/hbvQRSyoJllZ/gLYsnJ4w=="
        ],
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-MS-Office365-Filtering-Correlation-Id": "87313a97-5248-4dcc-0f7e-08d43e2543aa",
        "X-Microsoft-Antispam": "UriScan:; BCL:0; PCL:0; RULEID:(22001);\n\tSRVR:CY4PR03MB2470; ",
        "X-Microsoft-Antispam-PRVS": "<CY4PR03MB2470D50E336B8E17F5ACD179907D0@CY4PR03MB2470.namprd03.prod.outlook.com>",
        "X-Exchange-Antispam-Report-Test": "UriScan:(185117386973197);",
        "X-Exchange-Antispam-Report-CFA-Test": "BCL:0; PCL:0;\n\tRULEID:(6095060)(601004)(2401047)(5005006)(8121501046)(13017025)(13023025)(13024025)(13015025)(13018025)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123563025)(20161123556025)(20161123561025)(20161123559025);\n\tSRVR:CY4PR03MB2470; BCL:0; PCL:0; RULEID:(400006); SRVR:CY4PR03MB2470;",
        "X-Forefront-PRVS": "01894AD3B8",
        "SpamDiagnosticOutput": "1:99",
        "SpamDiagnosticMetadata": "NSPM",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "16 Jan 2017 15:35:13.4141\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-Id": "5afe0b00-7697-4969-b663-5eab37d5f47e",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;\n\tIp=[192.88.168.50]; \n\tHelo=[tx30smr01.am.freescale.net]",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "CY4PR03MB2470",
        "Subject": "[dpdk-dev] [PATCH v6 1/8] eal/bus: introduce bus abstraction",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/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 introduces the rte_bus abstraction for EAL.\nThe model is:\n - One or more buses are connected to a CPU (or core)\n - One or more devices are conneted to a Bus\n - Drivers are running instances which manage one or more devices\n - Bus is responsible for identifying devices (and interrupt propogation)\n - Driver is responsible for initializing the device\n\nThis patch adds a 'rte_bus' base class which would be extended for\nspecific implementations. It also introduces Bus registration and\nderegistration functions.\n\nAn example implementation would be like:\n\n  .--------------->+-------------------+\n  |                |rte_pci_bus        |\n  |                | +----------------+|\n  |                | |rte_bus         <------.\n  |                | | name           ||     |\n  |                | | scan           ||     |\n  |                | | match          ||     |\n  |                | | probe          ||     |\n  |                | | remove         ||     |\n  |                | | ...            ||     |\n  |                | +----------------+|     |\n  |                | pci_driver_list   |     |\n  |  .-------------->pci_device_list   |     |\n  |  |             | ...               |     |\n  |  |             +-------------------+     |\n  |  |                                       |\n  |  +-------------------+                   |\n  |  |rte_pci_device     |                   |\n  '----bus               |                   |\n     | +----------------+|                   |\n     | |rte_device      ||                   |\n     | | bus --------------------------------'\n     | | ...            ||\n     | +----------------+|\n     | ...               |\n     +-------------------+\n\nSigned-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>\n---\n lib/librte_eal/bsdapp/eal/Makefile              |   1 +\n lib/librte_eal/bsdapp/eal/rte_eal_version.map   |  10 +++\n lib/librte_eal/common/Makefile                  |   2 +-\n lib/librte_eal/common/eal_common_bus.c          |  97 +++++++++++++++++++++\n lib/librte_eal/common/include/rte_bus.h         | 111 ++++++++++++++++++++++++\n lib/librte_eal/common/include/rte_dev.h         |   1 +\n lib/librte_eal/linuxapp/eal/Makefile            |   1 +\n lib/librte_eal/linuxapp/eal/rte_eal_version.map |  10 +++\n 8 files changed, 232 insertions(+), 1 deletion(-)\n create mode 100644 lib/librte_eal/common/eal_common_bus.c\n create mode 100644 lib/librte_eal/common/include/rte_bus.h",
    "diff": "diff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile\nindex a15b762..cce99f7 100644\n--- a/lib/librte_eal/bsdapp/eal/Makefile\n+++ b/lib/librte_eal/bsdapp/eal/Makefile\n@@ -78,6 +78,7 @@ SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_cpuflags.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_string_fns.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_hexdump.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_devargs.c\n+SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_bus.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_dev.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_options.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_thread.c\ndiff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map\nindex 2f81f7c..4dcf653 100644\n--- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map\n+++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map\n@@ -174,3 +174,13 @@ DPDK_16.11 {\n \trte_eal_vdrv_unregister;\n \n } DPDK_16.07;\n+\n+DPDK_17.02 {\n+\tglobal:\n+\n+\trte_bus_list;\n+\trte_bus_dump;\n+\trte_bus_register;\n+\trte_bus_unregister;\n+\n+} DPDK_16.11;\ndiff --git a/lib/librte_eal/common/Makefile b/lib/librte_eal/common/Makefile\nindex 09a3d3a..240995c 100644\n--- a/lib/librte_eal/common/Makefile\n+++ b/lib/librte_eal/common/Makefile\n@@ -38,7 +38,7 @@ INC += rte_per_lcore.h rte_random.h\n INC += rte_tailq.h rte_interrupts.h rte_alarm.h\n INC += rte_string_fns.h rte_version.h\n INC += rte_eal_memconfig.h rte_malloc_heap.h\n-INC += rte_hexdump.h rte_devargs.h rte_dev.h rte_vdev.h\n+INC += rte_hexdump.h rte_devargs.h rte_bus.h rte_dev.h rte_vdev.h\n INC += rte_pci_dev_feature_defs.h rte_pci_dev_features.h\n INC += rte_malloc.h rte_keepalive.h rte_time.h\n \ndiff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c\nnew file mode 100644\nindex 0000000..c891392\n--- /dev/null\n+++ b/lib/librte_eal/common/eal_common_bus.c\n@@ -0,0 +1,97 @@\n+/*-\n+ *   BSD LICENSE\n+ *\n+ *   Copyright(c) 2016 NXP\n+ *   All rights reserved.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ *       notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above copyright\n+ *       notice, this list of conditions and the following disclaimer in\n+ *       the documentation and/or other materials provided with the\n+ *       distribution.\n+ *     * Neither the name of NXP nor the names of its\n+ *       contributors may be used to endorse or promote products derived\n+ *       from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include <stdio.h>\n+#include <string.h>\n+#include <inttypes.h>\n+#include <sys/queue.h>\n+\n+#include <rte_bus.h>\n+#include <rte_devargs.h>\n+#include <rte_debug.h>\n+\n+#include \"eal_private.h\"\n+\n+struct rte_bus_list rte_bus_list =\n+\tTAILQ_HEAD_INITIALIZER(rte_bus_list);\n+\n+/* register a bus */\n+void\n+rte_bus_register(struct rte_bus *bus)\n+{\n+\tRTE_VERIFY(bus);\n+\tRTE_VERIFY(bus->name && strlen(bus->name));\n+\n+\tTAILQ_INSERT_TAIL(&rte_bus_list, bus, next);\n+\tRTE_LOG(INFO, EAL, \"Registered [%s] bus.\\n\", bus->name);\n+}\n+\n+/* unregister a bus */\n+void\n+rte_bus_unregister(struct rte_bus *bus)\n+{\n+\tTAILQ_REMOVE(&rte_bus_list, bus, next);\n+\tRTE_LOG(INFO, EAL, \"Unregistered [%s] bus.\\n\", bus->name);\n+}\n+\n+/* dump one bus info */\n+static int\n+bus_dump_one(FILE *f, struct rte_bus *bus)\n+{\n+\tint ret;\n+\n+\t/* For now, dump only the bus name */\n+\tret = fprintf(f, \" %s\\n\", bus->name);\n+\n+\t/* Error in case of inability in writing to stream */\n+\tif (ret < 0)\n+\t\treturn ret;\n+\n+\treturn 0;\n+}\n+\n+void\n+rte_bus_dump(FILE *f)\n+{\n+\tint ret;\n+\tstruct rte_bus *bus;\n+\n+\tTAILQ_FOREACH(bus, &rte_bus_list, next) {\n+\t\tret = bus_dump_one(f, bus);\n+\t\tif (ret) {\n+\t\t\tRTE_LOG(ERR, EAL, \"Unable to write to stream (%d)\\n\",\n+\t\t\t\tret);\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+}\ndiff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h\nnew file mode 100644\nindex 0000000..2250269\n--- /dev/null\n+++ b/lib/librte_eal/common/include/rte_bus.h\n@@ -0,0 +1,111 @@\n+/*-\n+ *   BSD LICENSE\n+ *\n+ *   Copyright(c) 2016 NXP\n+ *   All rights reserved.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ *       notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above copyright\n+ *       notice, this list of conditions and the following disclaimer in\n+ *       the documentation and/or other materials provided with the\n+ *       distribution.\n+ *     * Neither the name of NXP nor the names of its\n+ *       contributors may be used to endorse or promote products derived\n+ *       from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#ifndef _RTE_BUS_H_\n+#define _RTE_BUS_H_\n+\n+/**\n+ * @file\n+ *\n+ * RTE PMD Bus Abstraction interfaces\n+ *\n+ * This file exposes APIs and Interfaces for Bus Abstraction over the devices\n+ * drivers in EAL.\n+ */\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+#include <stdio.h>\n+#include <sys/queue.h>\n+\n+#include <rte_log.h>\n+#include <rte_dev.h>\n+\n+/** Double linked list of buses */\n+TAILQ_HEAD(rte_bus_list, rte_bus);\n+\n+/**\n+ * A structure describing a generic bus.\n+ */\n+struct rte_bus {\n+\tTAILQ_ENTRY(rte_bus) next;   /**< Next bus object in linked list */\n+\tconst char *name;            /**< Name of the bus */\n+};\n+\n+/**\n+ * Register a Bus handler.\n+ *\n+ * @param bus\n+ *   A pointer to a rte_bus structure describing the bus\n+ *   to be registered.\n+ */\n+void rte_bus_register(struct rte_bus *bus);\n+\n+/**\n+ * Unregister a Bus handler.\n+ *\n+ * @param bus\n+ *   A pointer to a rte_bus structure describing the bus\n+ *   to be unregistered.\n+ */\n+void rte_bus_unregister(struct rte_bus *bus);\n+\n+/**\n+ * Dump information of all the buses registered with EAL.\n+ *\n+ * @param f\n+ *\tA valid and open output stream handle\n+ *\n+ * @return\n+ *\t 0 in case of success\n+ *\t!0 in case there is error in opening the output stream\n+ */\n+void rte_bus_dump(FILE *f);\n+\n+/** Helper for Bus registration. The constructor has higher priority than\n+ * PMD constructors\n+ */\n+#define RTE_REGISTER_BUS(nm, bus) \\\n+static void __attribute__((constructor(101), used)) businitfn_ ##nm(void) \\\n+{\\\n+\t(bus).name = RTE_STR(nm);\\\n+\trte_bus_register(&bus); \\\n+}\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* _RTE_BUS_H */\ndiff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h\nindex b17791f..24c1c00 100644\n--- a/lib/librte_eal/common/include/rte_dev.h\n+++ b/lib/librte_eal/common/include/rte_dev.h\n@@ -122,6 +122,7 @@ struct rte_driver;\n  */\n struct rte_device {\n \tTAILQ_ENTRY(rte_device) next; /**< Next device */\n+\tstruct rte_bus *bus;          /**< Device connected to this bus */\n \tconst struct rte_driver *driver;/**< Associated driver */\n \tint numa_node;                /**< NUMA node connection */\n \tstruct rte_devargs *devargs;  /**< Device user arguments */\ndiff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile\nindex 4e206f0..aa874a5 100644\n--- a/lib/librte_eal/linuxapp/eal/Makefile\n+++ b/lib/librte_eal/linuxapp/eal/Makefile\n@@ -87,6 +87,7 @@ SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_cpuflags.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_string_fns.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_hexdump.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_devargs.c\n+SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_bus.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_dev.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_options.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_thread.c\ndiff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map\nindex 83721ba..b553b13 100644\n--- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map\n+++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map\n@@ -178,3 +178,13 @@ DPDK_16.11 {\n \trte_eal_vdrv_unregister;\n \n } DPDK_16.07;\n+\n+DPDK_17.02 {\n+\tglobal:\n+\n+\trte_bus_list;\n+\trte_bus_dump;\n+\trte_bus_register;\n+\trte_bus_unregister;\n+\n+} DPDK_16.11;\n",
    "prefixes": [
        "dpdk-dev",
        "v6",
        "1/8"
    ]
}