get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 17056,
    "url": "https://patches.dpdk.org/api/patches/17056/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1479360605-20558-4-git-send-email-shreyansh.jain@nxp.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1479360605-20558-4-git-send-email-shreyansh.jain@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1479360605-20558-4-git-send-email-shreyansh.jain@nxp.com",
    "date": "2016-11-17T05:30:02",
    "name": "[dpdk-dev,RFC,3/6] bus: add bus driver layer",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d0b158355bb4679e767112da756bc96b227dd9ce",
    "submitter": {
        "id": 497,
        "url": "https://patches.dpdk.org/api/people/497/?format=api",
        "name": "Shreyansh Jain",
        "email": "shreyansh.jain@nxp.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1479360605-20558-4-git-send-email-shreyansh.jain@nxp.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/17056/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/17056/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 71A4458C8;\n\tThu, 17 Nov 2016 06:29:06 +0100 (CET)",
            "from NAM01-BY2-obe.outbound.protection.outlook.com\n\t(mail-by2nam01on0086.outbound.protection.outlook.com [104.47.34.86])\n\tby dpdk.org (Postfix) with ESMTP id 01FB35599\n\tfor <dev@dpdk.org>; Thu, 17 Nov 2016 06:28:13 +0100 (CET)",
            "from BLUPR0301CA0035.namprd03.prod.outlook.com (10.162.113.173) by\n\tCY1PR0301MB0748.namprd03.prod.outlook.com (10.160.159.154) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.721.10;\n\tThu, 17 Nov 2016 05:28:11 +0000",
            "from BN1AFFO11OLC003.protection.gbl (2a01:111:f400:7c10::181) by\n\tBLUPR0301CA0035.outlook.office365.com (2a01:111:e400:5259::45) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.721.10 via\n\tFrontend Transport; Thu, 17 Nov 2016 05:28:10 +0000",
            "from tx30smr01.am.freescale.net (192.88.168.50) by\n\tBN1AFFO11OLC003.mail.protection.outlook.com (10.58.53.74) with\n\tMicrosoft SMTP Server (version=TLS1_0,\n\tcipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.721.5\n\tvia Frontend Transport; Thu, 17 Nov 2016 05:28:11 +0000",
            "from Tophie.ap.freescale.net ([10.232.14.87])\n\tby tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id\n\tuAH5S1ps018741; Wed, 16 Nov 2016 22:28:08 -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;",
        "X-IncomingTopHeaderMarker": "OriginalChecksum:; UpperCasedChecksum:;\n\tSizeAsReceived:647; Count:10",
        "From": "Shreyansh Jain <shreyansh.jain@nxp.com>",
        "To": "<david.marchand@6wind.com>",
        "CC": "<dev@dpdk.org>, Shreyansh Jain <shreyansh.jain@nxp.com>",
        "Date": "Thu, 17 Nov 2016 11:00:02 +0530",
        "Message-ID": "<1479360605-20558-4-git-send-email-shreyansh.jain@nxp.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1479360605-20558-1-git-send-email-shreyansh.jain@nxp.com>",
        "References": "<1479360605-20558-1-git-send-email-shreyansh.jain@nxp.com>",
        "X-IncomingHeaderCount": "10",
        "X-EOPAttributedMessage": "0",
        "X-Matching-Connectors": "131238340914282498;\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)(7916002)(2980300002)(1109001)(1110001)(339900001)(336004)(43544003)(199003)(189002)(50226002)(8936002)(77096005)(81156014)(81166006)(4326007)(7846002)(2906002)(305945005)(104016004)(92566002)(76176999)(50986999)(8666005)(8676002)(86362001)(356003)(575784001)(5003940100001)(106466001)(105606002)(36756003)(33646002)(2351001)(47776003)(6666003)(2950100002)(6916009)(110136003)(48376002)(50466002)(5660300001)(626004)(68736007)(97736004)(87936001)(189998001)(85426001)(7059030)(21314002)(217873001);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB0748;\n\tH:tx30smr01.am.freescale.net; \n\tFPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; ",
        "X-Microsoft-Exchange-Diagnostics": [
            "1; BN1AFFO11OLC003;\n\t1:rjLmPuwao3AM53Ezim3Ru5/C83HXD2G7b3U//WrYpOIhokvJojnQrSDrYtIg4Mrdcg/QhclMzd95GH1z+qOZ9FCLYrwuJ8hNB6nLHgfZbjFJ0n9VKwQlz0aVvLUC+JW0AYz13vcfUa8JZGWKhFYgdJQ1ctrSDw3iN7h9DAgRzHynNf/yGyGnhA/vjA7yJYYCEnOfuYgQSbql1vgFWx0+kuKo5A3DOqQhJogV9O/x1IWqy8H4Rdm+qgdb89jO4WV4/u+CKfDUK5p9BD1OrZnPUaI0m/cZ1TJG/v33c2azCFCg9B0ow/ZhYkEFoRVtwJqttk+jOdUrFvEsy00YC4+kvlf5x2bV0MXFNQfnYFiW/WNkWYDGx2Dcj5jOuNzZElR2lXlRxdiBAFJ8BHYVmBAkt+E2LqNhG9NvzSTCD/juvIi0WC1b1QKSORiDX3qbh/gfF4czjVKgYOwg/0AQFZCy2nbIQZ2vTaK3Ef73Y4l9c7gfTrOXsxkw9cywZiMCQD3KBEmRSwKsxtQSr0hcRuBtkBns43E2y9a4HLVCAg62gq7TU4689XtMAh6kn6GB6eE2RbN1aQuzN5jTd4bqdN37UaNJHAg77AH0MKBBjmwXGO26IZuyMmUoFMHPsBb7nbLaNDgBBS+0yCtXKETUYKRrMJ+DJZVkBq3p25BfXv5oEiXCUufItY31eglQ2IQop1IIA1D9t+1D+c/fjqvDVuolZugvNwVxz9ryyjvCCbCXPow=",
            "1; CY1PR0301MB0748;\n\t2:ZdtTYvaTJKXNy3UnpBfFTBr7foE9A0DlGof5iIBNs7xmGDRzkcde/I0SwYu8wNBhLpoqYt8Di105DfxHC4GorRnWmvbEqmiVk/m8YmFU3gcVB80eTudQnbDp02/N6QkMeaiavRHu3xwxMlShRGRJbwtceY4HG1dfWnzbzR69VbQ=;\n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ZQUw0CHdqaU=",
            "1; CY1PR0301MB0748;\n\t7:ZuTf5B1BgRiVZM4b9x88gQD4kAFKV8ZhsxvIQDPNbg3QNNvXpG0J9Z2APF1Wpntyg6C4EKbKq/kmMP5hdfaOYFHqxRy9c6EQgWdxHEUkaTB94bmcb7GA5HLXmIjvxo6+7zLGioTvO2bPIy8WrG4Bd6aUIkmg11OeGOGloMmSp8snFTsUDQ3WrtmU/dO9n+/LCOQQteugubuZ6SyeIA+MqkVNAu3R/ONfXob4jn3l5X0I6QioC18u3xwUF3WOcUtBXw4dtz/vFl2pGxJr1RPYuGgUAYqlNXhYFxPe4mNnZ2OohPn7biFxovFQuchaTZBuX0sup9TCynmg63GPKjv04akn403jqTCyT+0JNkSTlBc="
        ],
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-MS-Office365-Filtering-Correlation-Id": "f180d4cb-195c-4d37-7512-08d40eaa857f",
        "X-Microsoft-Antispam": "UriScan:; BCL:0; PCL:0; RULEID:(22001);\n\tSRVR:CY1PR0301MB0748; ",
        "X-Microsoft-Antispam-PRVS": "<CY1PR0301MB074875C023A9F204567CA95190B10@CY1PR0301MB0748.namprd03.prod.outlook.com>",
        "X-Exchange-Antispam-Report-Test": "UriScan:(185117386973197);",
        "X-Exchange-Antispam-Report-CFA-Test": "BCL:0; PCL:0;\n\tRULEID:(6095035)(601004)(2401047)(13023025)(5005006)(8121501046)(13018025)(13024025)(13015025)(13017025)(3002001)(10201501046)(6055026)(6096035);\n\tSRVR:CY1PR0301MB0748; BCL:0; PCL:0; RULEID:(400006);\n\tSRVR:CY1PR0301MB0748; ",
        "X-Forefront-PRVS": "01294F875B",
        "SpamDiagnosticOutput": "1:99",
        "SpamDiagnosticMetadata": "NSPM",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "17 Nov 2016 05:28:11.1318\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": "CY1PR0301MB0748",
        "Subject": "[dpdk-dev] [RFC PATCH 3/6] bus: add bus driver layer",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <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": "A bus is managed using a 'bus driver'. This patch introduces a sample\nPCI bus driver which essentially is the scan and match implementation for\nPCI.\n\nThere are multiple possible alternatives to where such a driver can be\nkept within the DPDK code:\n1. librte_bus\n - For each type of bus, there would a file like 'eal_xxx_bus' which would\n   then be bound with the eal library.\n - Within this way, another possibility was librte_bus_xxx.\n\n2. Within the drivers/* folder:\n - drivers/bus, parallel to drivers/net and drivers/crypto\n - This way, each bus implmentation would be within the drivers/* area and\n   a new implementation would only mean adding a new set of files and\n   corresponding changes to the Makefiles.\n\n3. Problem with (3) is that the naming is misleading. drivers/net and\n   drivers/crypto are essentially two functionalities rather than drivers.\n   Putting driver/bus parallel to these would be misleading in literal\n   terms.\n   Another possibility is to keep the drivers parallel to 'drivers' folder\n   in root of DPDK.\n   This is the implementation preferred in this patch.\n   A new bus would mean adding a new folder structure within 'bus' -\n   including distinction between linuxapp and bsdapp.\n\nIn all the three cases, the bus drivers would be instantiated using a\nconstructor similar to RTE_PMD_REGISTER_XXX. OR, specifically in case of\n(2), it would be a priority based constructor.\n(__attribute__((contructor(XX))) to assure that buses are loaded before\nthe drivers are loaded.\n\nFurther, as of now the 'pci_bus.c' only shows the scan and dump hooks.\nrte_bus also includes hooks for 'dump'ing all devices on the bus and\n'find_dev' for finding a device given its rte_device. Each of these\n'optional' implementation are more like helpers but have implementation\nwhich is specific to the bus. Hooks for finding a device can be used for\nhotplugging (searching before adding a new device, removing existing).\nSimilarly, 'dump' is a way to represent device information in bus specific\nway.\n\nMissing/Grey areas:\n - A lot of PCI specific code is still in EAL - for example mapping. These\n   can be moved into bus. Mapping of memory should be a bus property.\n - PMDINFOGEN symbol support for bus - this patch doesn't take care of\n   that\n - there would be multiple lists for each bus. Would those be shared\n   across various libraries, internal or external, which can be associated\n   with DPDK? Should a tailq registration like method be used?\n\nPending work:\n - The integration of bus/* with librte_eal is not complete. There might\n   be symbol issues.\n - Notification support for drivers over a bus doesn't exist yet. Probably\n   that needs to be integrated with interrupt handling - no work on this\n   has been done yet.\n\nSigned-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>\n---\n bus/Makefile               |  36 ++++\n bus/pci/Makefile           |  37 ++++\n bus/pci/linuxapp/pci_bus.c | 418 +++++++++++++++++++++++++++++++++++++++++++++\n bus/pci/linuxapp/pci_bus.h |  55 ++++++\n 4 files changed, 546 insertions(+)\n create mode 100644 bus/Makefile\n create mode 100644 bus/pci/Makefile\n create mode 100644 bus/pci/linuxapp/pci_bus.c\n create mode 100644 bus/pci/linuxapp/pci_bus.h",
    "diff": "diff --git a/bus/Makefile b/bus/Makefile\nnew file mode 100644\nindex 0000000..cfa548c\n--- /dev/null\n+++ b/bus/Makefile\n@@ -0,0 +1,36 @@\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+include $(RTE_SDK)/mk/rte.vars.mk\n+\n+DIRS-y += pci\n+\n+include $(RTE_SDK)/mk/rte.subdir.mk\ndiff --git a/bus/pci/Makefile b/bus/pci/Makefile\nnew file mode 100644\nindex 0000000..fb6cc44\n--- /dev/null\n+++ b/bus/pci/Makefile\n@@ -0,0 +1,37 @@\n+#   BSD LICENSE\n+#\n+#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\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 Intel Corporation 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+include $(RTE_SDK)/mk/rte.vars.mk\n+\n+DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += linuxapp\n+DIRS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += bsdapp\n+\n+include $(RTE_SDK)/mk/rte.subdir.mk\ndiff --git a/bus/pci/linuxapp/pci_bus.c b/bus/pci/linuxapp/pci_bus.c\nnew file mode 100644\nindex 0000000..b61cb0a\n--- /dev/null\n+++ b/bus/pci/linuxapp/pci_bus.c\n@@ -0,0 +1,418 @@\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 <string.h>\n+#include <dirent.h>\n+\n+#include <rte_log.h>\n+#include <rte_bus.h>\n+#include <rte_pci.h>\n+#include <rte_eal_memconfig.h>\n+#include <rte_malloc.h>\n+#include <rte_devargs.h>\n+#include <rte_memcpy.h>\n+\n+#include \"eal_filesystem.h\"\n+#include \"eal_private.h\"\n+#include \"eal_pci_init.h\"\n+\n+\n+\n+/**\n+ * Default PCI matching function called duing probe for drivers\n+ *\n+ * @param drv\n+ *\tThe PCI driver handle\n+ * @param dev\n+ *\tThe PCI device handle\n+ * @return\n+ *\t0 for successful match\n+ *\t!0 for unsuccessful match\n+ */\n+int rte_eal_pci_match_default(struct rte_pci_driver *drv,\n+\t\t\t      struct rte_pci_device *dev);\n+\n+\n+/*\n+ * split up a pci address into its constituent parts.\n+ */\n+static int\n+parse_pci_addr_format(const char *buf, int bufsize, uint16_t *domain,\n+\t\t      uint8_t *bus, uint8_t *devid, uint8_t *function)\n+{\n+\t/* first split on ':' */\n+\tunion splitaddr {\n+\t\tstruct {\n+\t\t\tchar *domain;\n+\t\t\tchar *bus;\n+\t\t\tchar *devid;\n+\t\t\tchar *function;\n+\t\t};\n+\t\tchar *str[PCI_FMT_NVAL];\n+\t\t/* last element-separator is \".\" not \":\" */\n+\t} splitaddr;\n+\n+\tchar *buf_copy = strndup(buf, bufsize);\n+\tif (buf_copy == NULL)\n+\t\treturn -1;\n+\n+\tif (rte_strsplit(buf_copy, bufsize, splitaddr.str, PCI_FMT_NVAL, ':')\n+\t\t\t!= PCI_FMT_NVAL - 1)\n+\t\tgoto error;\n+\t/* final split is on '.' between devid and function */\n+\tsplitaddr.function = strchr(splitaddr.devid,'.');\n+\tif (splitaddr.function == NULL)\n+\t\tgoto error;\n+\t*splitaddr.function++ = '\\0';\n+\n+\t/* now convert to int values */\n+\terrno = 0;\n+\t*domain = (uint16_t)strtoul(splitaddr.domain, NULL, 16);\n+\t*bus = (uint8_t)strtoul(splitaddr.bus, NULL, 16);\n+\t*devid = (uint8_t)strtoul(splitaddr.devid, NULL, 16);\n+\t*function = (uint8_t)strtoul(splitaddr.function, NULL, 10);\n+\tif (errno != 0)\n+\t\tgoto error;\n+\n+\tfree(buf_copy); /* free the copy made with strdup */\n+\treturn 0;\n+error:\n+\tfree(buf_copy);\n+\treturn -1;\n+}\n+\n+/* parse the \"resource\" sysfs file */\n+static int\n+pci_parse_sysfs_resource(const char *filename,\n+\t\t\t struct rte_pci_device *dev)\n+{\n+\tFILE *f;\n+\tchar buf[BUFSIZ];\n+\tint i;\n+\tuint64_t phys_addr, end_addr, flags;\n+\n+\tf = fopen(filename, \"r\");\n+\tif (f == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Cannot open sysfs resource\\n\");\n+\t\treturn -1;\n+\t}\n+\n+\tfor (i = 0; i<PCI_MAX_RESOURCE; i++) {\n+\n+\t\tif (fgets(buf, sizeof(buf), f) == NULL) {\n+\t\t\tRTE_LOG(ERR, EAL,\n+\t\t\t\t\"%s(): cannot read resource\\n\", __func__);\n+\t\t\tgoto error;\n+\t\t}\n+\t\tif (pci_parse_one_sysfs_resource(buf, sizeof(buf), &phys_addr,\n+\t\t\t\t&end_addr, &flags) < 0)\n+\t\t\tgoto error;\n+\n+\t\tif (flags & IORESOURCE_MEM) {\n+\t\t\tdev->mem_resource[i].phys_addr = phys_addr;\n+\t\t\tdev->mem_resource[i].len = end_addr - phys_addr + 1;\n+\t\t\t/* not mapped for now */\n+\t\t\tdev->mem_resource[i].addr = NULL;\n+\t\t}\n+\t}\n+\tfclose(f);\n+\treturn 0;\n+\n+error:\n+\tfclose(f);\n+\treturn -1;\n+}\n+\n+/* Scan one pci sysfs entry, and fill the devices list from it. */\n+static int\n+pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus,uint8_t devid,\n+\t     uint8_t function)\n+{\n+\tchar filename[PATH_MAX];\n+\tunsigned long tmp;\n+\tstruct rte_pci_device *pci_dev;\n+\tstruct rte_bus *pci_bus;\n+\tstruct rte_device *dev;\n+\tchar driver[PATH_MAX];\n+\tint ret;\n+\n+\t/* Get the PCI bus for device; It it doesn't exist, can't continue */\n+\tpci_bus = rte_eal_get_bus(PCI_BUS_NAME);\n+\tif (!pci_bus) {\n+\t\tRTE_LOG(ERR, EAL, \"Unable to get PCI bus.\\n\");\n+\t\treturn -1;\n+\t}\n+\n+\tpci_dev = malloc(sizeof(*pci_dev));\n+\tif (pci_dev == NULL)\n+\t\treturn -1;\n+\n+\tmemset(pci_dev, 0, sizeof(*pci_dev));\n+\tpci_dev->addr.domain = domain;\n+\tpci_dev->addr.bus = bus;\n+\tpci_dev->addr.devid = devid;\n+\tpci_dev->addr.function = function;\n+\n+\t/* Set Bus */\n+\tpci_dev->device->bus = pci_bus;\n+\n+\t/* get vendor id */\n+\tsnprintf(filename, sizeof(filename), \"%s/vendor\", dirname);\n+\tif (eal_parse_sysfs_value(filename, &tmp) < 0) {\n+\t\tfree(pci_dev);\n+\t\treturn -1;\n+\t}\n+\tpci_dev->id.vendor_id = (uint16_t)tmp;\n+\n+\t/* get device id */\n+\tsnprintf(filename, sizeof(filename), \"%s/device\", dirname);\n+\tif (eal_parse_sysfs_value(filename, &tmp) < 0) {\n+\t\tfree(pci_dev);\n+\t\treturn -1;\n+\t}\n+\tpci_dev->id.device_id = (uint16_t)tmp;\n+\n+\t/* get subsystem_vendor id */\n+\tsnprintf(filename, sizeof(filename), \"%s/subsystem_vendor\",\n+\t\t dirname);\n+\tif (eal_parse_sysfs_value(filename, &tmp) < 0) {\n+\t\tfree(pci_dev);\n+\t\treturn -1;\n+\t}\n+\tpci_dev->id.subsystem_vendor_id = (uint16_t)tmp;\n+\n+\t/* get subsystem_device id */\n+\tsnprintf(filename, sizeof(filename), \"%s/subsystem_device\",\n+\t\t dirname);\n+\tif (eal_parse_sysfs_value(filename, &tmp) < 0) {\n+\t\tfree(pci_dev);\n+\t\treturn -1;\n+\t}\n+\tpci_dev->id.subsystem_device_id = (uint16_t)tmp;\n+\n+\t/* get class_id */\n+\tsnprintf(filename, sizeof(filename), \"%s/class\",\n+\t\t dirname);\n+\tif (eal_parse_sysfs_value(filename, &tmp) < 0) {\n+\t\tfree(pci_dev);\n+\t\treturn -1;\n+\t}\n+\t/* the least 24 bits are valid: class, subclass, program interface */\n+\tpci_dev->id.class_id = (uint32_t)tmp & RTE_CLASS_ANY_ID;\n+\n+\t/* get max_vfs */\n+\tpci_dev->max_vfs = 0;\n+\tsnprintf(filename, sizeof(filename), \"%s/max_vfs\", dirname);\n+\tif (!access(filename, F_OK) &&\n+\t    eal_parse_sysfs_value(filename, &tmp) == 0)\n+\t\tpci_dev->max_vfs = (uint16_t)tmp;\n+\telse {\n+\t\t/* for non igb_uio driver, need kernel version >= 3.8 */\n+\t\tsnprintf(filename, sizeof(filename),\n+\t\t\t \"%s/sriov_numvfs\", dirname);\n+\t\tif (!access(filename, F_OK) &&\n+\t\t    eal_parse_sysfs_value(filename, &tmp) == 0)\n+\t\t\tpci_dev->max_vfs = (uint16_t)tmp;\n+\t}\n+\n+\t/* get numa node */\n+\tsnprintf(filename, sizeof(filename), \"%s/numa_node\",\n+\t\t dirname);\n+\tif (access(filename, R_OK) != 0) {\n+\t\t/* if no NUMA support, set default to 0 */\n+\t\tpci_dev->device.numa_node = 0;\n+\t} else {\n+\t\tif (eal_parse_sysfs_value(filename, &tmp) < 0) {\n+\t\t\tfree(pci_dev);\n+\t\t\treturn -1;\n+\t\t}\n+\t\tpci_dev->device.numa_node = tmp;\n+\t}\n+\n+\t/* parse resources */\n+\tsnprintf(filename, sizeof(filename), \"%s/resource\", dirname);\n+\tif (pci_parse_sysfs_resource(filename, pci_dev) < 0) {\n+\t\tRTE_LOG(ERR, EAL, \"%s(): cannot parse resource\\n\", __func__);\n+\t\tfree(pci_dev);\n+\t\treturn -1;\n+\t}\n+\n+\t/* parse driver */\n+\tsnprintf(filename, sizeof(filename), \"%s/driver\", dirname);\n+\tret = pci_get_kernel_driver_by_path(filename, driver);\n+\tif (ret < 0) {\n+\t\tRTE_LOG(ERR, EAL, \"Fail to get kernel driver\\n\");\n+\t\tfree(pci_dev);\n+\t\treturn -1;\n+\t}\n+\n+\tif (!ret) {\n+\t\tif (!strcmp(driver, \"vfio-pci\"))\n+\t\t\tpci_dev->kdrv = RTE_KDRV_VFIO;\n+\t\telse if (!strcmp(driver, \"igb_uio\"))\n+\t\t\tpci_dev->kdrv = RTE_KDRV_IGB_UIO;\n+\t\telse if (!strcmp(driver, \"uio_pci_generic\"))\n+\t\t\tpci_dev->kdrv = RTE_KDRV_UIO_GENERIC;\n+\t\telse\n+\t\t\tpci_dev->kdrv = RTE_KDRV_UNKNOWN;\n+\t} else\n+\t\tpci_dev->kdrv = RTE_KDRV_NONE;\n+\n+\t/* device is valid, add in list (sorted) */\n+\tif (TAILQ_EMPTY(&pci_bus->device_list)) {\n+\t\trte_eal_bus_add_device(pci_bus, dev->device);\n+\t} else {\n+\t\tstruct rte_device *dev2 = NULL;\n+\t\tstruct rte_pci_device *pci_dev2;\n+\t\tint ret;\n+\n+\t\tTAILQ_FOREACH(dev2, &pci_bus->device_list, next) {\n+\t\t\tpci_dev2 = container_of(dev2, struct rte_pci_device,\n+\t\t\t\t\t\tdevice);\n+\n+\t\t\tret = rte_eal_compare_pci_addr(&pci_dev->addr,\n+\t\t\t\t\t\t       &pci_dev2->addr);\n+\t\t\tif (ret > 0)\n+\t\t\t\tcontinue;\n+\n+\t\t\tif (ret < 0) {\n+\t\t\t\t/* TODO Pending: 'before' handler for\n+\t\t\t\t * bus->device_list\n+\t\t\t\t */\n+\t\t\t\trte_eal_bus_add_device(pci_bus,\n+\t\t\t\t\t\t       pci_dev2->device);\n+\t\t\t} else { /* already registered */\n+\t\t\t\tpci_dev2->kdrv = pci_dev->kdrv;\n+\t\t\t\tpci_dev2->max_vfs = pci_dev->max_vfs;\n+\t\t\t\tmemmove(pci_dev2->mem_resource,\n+\t\t\t\t\tpci_dev->mem_resource,\n+\t\t\t\t\tsizeof(pci_dev->mem_resource));\n+\t\t\t\tfree(pci_dev);\n+\t\t\t}\n+\t\t\treturn 0;\n+\t\t}\n+\t\trte_eal_device_insert(&pci_dev->device);\n+\t\tTAILQ_INSERT_TAIL(&pci_device_list, pci_dev, next);\n+\t}\n+\n+\treturn 0;\n+}\n+\n+/* Default PCI match implementation */\n+int\n+pci_bus_match(struct rte_pci_driver *drv,\n+\t\t\t  struct rte_pci_device *dev)\n+{\n+\tint ret = 1;\n+\tconst struct rte_pci_id *id_table;\n+\n+\tfor (id_table = drv->id_table; id_table->vendor_id != 0; id_table++) {\n+\n+\t\t/* check if device's identifiers match the driver's ones */\n+\t\tif (id_table->vendor_id != dev->id.vendor_id &&\n+\t\t\t\tid_table->vendor_id != PCI_ANY_ID)\n+\t\t\tcontinue;\n+\t\tif (id_table->device_id != dev->id.device_id &&\n+\t\t\t\tid_table->device_id != PCI_ANY_ID)\n+\t\t\tcontinue;\n+\t\tif (id_table->subsystem_vendor_id !=\n+\t\t    dev->id.subsystem_vendor_id &&\n+\t\t    id_table->subsystem_vendor_id != PCI_ANY_ID)\n+\t\t\tcontinue;\n+\t\tif (id_table->subsystem_device_id !=\n+\t\t    dev->id.subsystem_device_id &&\n+\t\t    id_table->subsystem_device_id != PCI_ANY_ID)\n+\t\t\tcontinue;\n+\t\tif (id_table->class_id != dev->id.class_id &&\n+\t\t\t\tid_table->class_id != RTE_CLASS_ANY_ID)\n+\t\t\tcontinue;\n+\t\tret = 0;\n+\t\tbreak;\n+\t}\n+\n+\t/* Returning a >0 value as <0 is considered error by caller */\n+\treturn ret;\n+}\n+\n+/*\n+ * Scan the content of the PCI bus, and the devices in the devices\n+ * list\n+ */\n+int\n+pci_bus_scan(void)\n+{\n+\tstruct dirent *e;\n+\tDIR *dir;\n+\tchar dirname[PATH_MAX];\n+\tuint16_t domain;\n+\tuint8_t bus, devid, function;\n+\n+\t/* for debug purposes, PCI can be disabled */\n+\tif (internal_config.no_pci)\n+\t\treturn 0;\n+\n+\tdir = opendir(pci_get_sysfs_path());\n+\tif (dir == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"%s(): opendir failed: %s\\n\",\n+\t\t\t__func__, strerror(errno));\n+\t\treturn -1;\n+\t}\n+\n+\twhile ((e = readdir(dir)) != NULL) {\n+\t\tif (e->d_name[0] == '.')\n+\t\t\tcontinue;\n+\n+\t\tif (parse_pci_addr_format(e->d_name, sizeof(e->d_name),\n+\t\t\t\t&domain, &bus, &devid, &function) != 0)\n+\t\t\tcontinue;\n+\n+\t\tsnprintf(dirname, sizeof(dirname), \"%s/%s\",\n+\t\t\t\tpci_get_sysfs_path(), e->d_name);\n+\t\tif (pci_scan_one(dirname, domain, bus, devid, function) < 0)\n+\t\t\tgoto error;\n+\t}\n+\tclosedir(dir);\n+\treturn 0;\n+\n+error:\n+\tclosedir(dir);\n+\treturn -1;\n+}\n+\n+struct rte_bus pci_bus = {\n+\t.scan = pci_bus_scan,\n+\t.match = pci_bus_match,\n+\t.dump = NULL,\n+};\n+\n+RTE_PMD_REGISTER_BUS(\"pci_bus\", pci_bus);\ndiff --git a/bus/pci/linuxapp/pci_bus.h b/bus/pci/linuxapp/pci_bus.h\nnew file mode 100644\nindex 0000000..580fa36\n--- /dev/null\n+++ b/bus/pci/linuxapp/pci_bus.h\n@@ -0,0 +1,55 @@\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+/**\n+ * Default PCI matching function called duing probe for drivers\n+ *\n+ * @param drv\n+ *\tThe PCI driver handle\n+ * @param dev\n+ *\tThe PCI device handle\n+ * @return\n+ *\t0 for successful match\n+ *\t!0 for unsuccessful match\n+ */\n+int bus_pci_match(struct rte_pci_driver *drv,\n+\t\t  struct rte_pci_device *dev);\n+\n+/**\n+* Scan the content of the PCI bus, and the devices in the devices\n+* list\n+*\n+* @return\n+*  0 on success, negative on error\n+*/\n+int bus_pci_scan(void);\n",
    "prefixes": [
        "dpdk-dev",
        "RFC",
        "3/6"
    ]
}