get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 19429,
    "url": "http://patches.dpdk.org/api/patches/19429/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1484581107-2025-4-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-4-git-send-email-shreyansh.jain@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1484581107-2025-4-git-send-email-shreyansh.jain@nxp.com",
    "date": "2017-01-16T15:38:22",
    "name": "[dpdk-dev,v6,3/8] pci: split match and probe function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2fee7339c3ee813035d9bfc32309b9b43c4611af",
    "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-4-git-send-email-shreyansh.jain@nxp.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/19429/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/19429/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 711D737B0;\n\tMon, 16 Jan 2017 16:35:32 +0100 (CET)",
            "from NAM02-SN1-obe.outbound.protection.outlook.com\n\t(mail-sn1nam02on0089.outbound.protection.outlook.com [104.47.36.89])\n\tby dpdk.org (Postfix) with ESMTP id 2F2F85320\n\tfor <dev@dpdk.org>; Mon, 16 Jan 2017 16:35:29 +0100 (CET)",
            "from BN3PR03CA0095.namprd03.prod.outlook.com (10.174.66.13) by\n\tMWHPR03MB2477.namprd03.prod.outlook.com (10.169.200.147) 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:27 +0000",
            "from BL2FFO11OLC010.protection.gbl (2a01:111:f400:7c09::175) by\n\tBN3PR03CA0095.outlook.office365.com (2603:10b6:400:4::13) 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 via Frontend Transport; Mon, 16 Jan 2017 15:35:21 +0000",
            "from tx30smr01.am.freescale.net (192.88.168.50) by\n\tBL2FFO11OLC010.mail.protection.outlook.com (10.173.160.154) with\n\tMicrosoft\n\tSMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id\n\t15.1.803.8 via Frontend Transport; Mon, 16 Jan 2017 15:35:21 +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\tv0GFZ4mj019448; Mon, 16 Jan 2017 08:35:18 -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:22 +0530",
        "Message-ID": "<1484581107-2025-4-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": "131290545212303574;\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)(39850400002)(39400400002)(39450400003)(39840400002)(39860400002)(39410400002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(5003940100001)(626004)(50466002)(4326007)(92566002)(36756003)(8656002)(48376002)(33646002)(86362001)(54906002)(2906002)(27001)(85426001)(97736004)(77096006)(6916009)(6666003)(110136003)(2950100002)(356003)(5660300001)(38730400001)(305945005)(106466001)(8936002)(8676002)(189998001)(81166006)(50226002)(47776003)(68736007)(104016004)(76176999)(50986999)(105606002)(2351001)(81156014);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2477;\n\tH:tx30smr01.am.freescale.net; \n\tFPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; ",
        "X-Microsoft-Exchange-Diagnostics": [
            "1; BL2FFO11OLC010;\n\t1:+Hn11W3ofGy7J7YiljEFMjmx3i5ItmHi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dnjFTduRMyLwSR9s8U6Ktp9WMm9Med5oTSF478t9mPOeQYOE4zrd4ojufq0+79HuS1j2ZwpSbd+wrlYbqDBTKL7/9SGYfGVXJleqCA=",
            "1; MWHPR03MB2477;\n\t4:q3xArsAF4rwnYOlqjpIaMjlS67aFbL2s4qBEcCns+whYsUWTcmDbYhjrmTWwZF2D2f45VQkrDJee78OWG9T45UtJ6GALpg9pAvuLMurQr/vlPzPZDyKZeMWxI92FtMh6qOONABur1B/aUW1lGBey2CCpNMuVelr/UbCaK32E2LWEoPWMSsyQ7fit11+sIBr6woJObtAw3zN+qKjQmE//mM6P4dSSDRvQVnAEgzeQfroMd203kQPnR8UZcqNc8MO07l6NNyFxcUqZR8VL0h/L8lLP+UKDPz5ePop7G4AL6vYhKvv3UUnmwcLe1/MDdDCoEwH1linWrgJ3dlWV6CVDZDR4bZcCiW4JGO1mb+IByU0gH4T7tb9gZWjHh8feaCl46UFV8WLq5RVr4LdFi8GgjOfbvvn1hbgSPG8LkyA3y7Zz5900Y4EpmW4cSs+zxERQeMHL9gImbFJI0MiDysuWnsNAdnx1a/D95FHi9UPzb4rKSc+yeAP1xREeZMbv5sRIYGoz2C4fZrztENtRg6aaIKDhawVB7bK3kU9be8yhC5WQhrDRScnFOppt/JlOn28xZjpJnemtUxS/Geo1lW6qIRbfxM7nvEqAXggFYmDkpIUtu7e7VXhJBEr0iO2f99MGqLTG+oG3ktvHnCGnGPVVtkJOkXEzh8A3XeN6MmBN/gfJSLHTfhGAiwe9/sbsa7LtZukQCOsWflL6qRexWTGosQkIhZltOFwbYqKhgp24rZgt2FqvG/53sOEMnRjq9cig",
            "=?us-ascii?Q?1; MWHPR03MB2477;\n\t23:axW9Ny5D9zI3Mfp9cD9X/W/o78enslRbyTVC6YSMg?=\n\t89DNhsXi6jirMjNFMMhzbEonBIyqLINC2Tb02FFQCsFqqte/MVnPLP87qRrtzjYpKWOoFKJk2l8GUv/y029FwF5e2yVRB8XsbMxry6mgfnhA6h4kXietIJJ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MVf2F0ShJr5Aq3aV6V2WDICxu52TKTMbVQte94JUN+RN+eDm/JSRl4f7gqw==",
            "1; MWHPR03MB2477;\n\t6:5q96SA+FfWJffW9J0dpxVyZW97nBABXvxWWvF0nxZyPPWxnJCOOnesERsti4fmdeFKdrnAEymcJvfjXICa95ACklATaXP3xYMsk/mHEeoHOlbLAqRLkg04CZYsGPVHcMj6DDXsR9j4WoO6+Df54NpUANPaekpLURKWsUcQ4UqV7O00g9eT5f66ZanEpesSek7oQhpKx73BcG5R8uNZ71l1cvVaD9KUnRv7fnZhoFF73t8fwLs0abWGUag1Hzfp2lh9yoQsqJsAQAoJU0esjZCU/xtTC6LQ1oOQRtq+3tJEtOVKyQXox05nss/ivbRQBFnQfIFKrmLEJEJdJIKaV0VF/fWMQwlOcvvvhWRD9UTW3D9RxG8e8N9TkllsV93CVG7VHAdp+aQ33nCEZcZNIjnnYmBXMXVnX4PJrYJeyb/kBxshic5cSz/cAQ2ub/5gS1;\n\t5:0aY33WmfqUKXitSOpJf4+5vkyCDKk8aFMkap7Jfo7s/S4qoa7m0BAXC3ehAh7cKH6YlSkRDKewAb0rXoVZRCZeu0l+z27ryTwBM4ldiyj8lO+oXcyI8JCyTyRjysIfJhCaHEOELcyICk2J9lAyi59qcAhRZDSRKfwi6uXurkoBWleGaeQJAT1XUBi6aF72A9;\n\t24:OJHrPnEcLjtccA709M01X5R4ACd3/H5JXL3njjITCxo4SAdX45XBZq1tspTZ5WhfiBDy1/S0L4hnWS3XwSXYJoVm8T7XFlJCVYr6W7NpD94=",
            "1; MWHPR03MB2477;\n\t7:2FLJ2gWcwetlgbmj2DId8zIuCcx17xFjEMieqq/TJXaMOzDPM4glqEgO+xFXnH2kC4kBV+VETGbFewaqQeeMjTK/ouCE68mwEzUFx9DxHApkTNtkfNbHUuPIaCtlk966IuJ1xvZ/1wRLln8BZetXCyW6BP93OkSOOppgCz+NQqk23Du3uCtu+At9s37cfVDzptbw12KAmv5BWuN815joq0XCsmiwAjl9uMDhjRDzRJ2CFYoeZb/jrl4zeXloVkVQulokm3rNvdcW05iceyylIUDh6ctrHFWqPu3GP7IM4oAFeH42klywu1uGABodNSyAfujE/OmUMXxevu2cO/PH0+1axa12JaLVi1XHtfMC2E0ic/GJv6fzHs+OGIfBEzaF+yoPDKaw42j6C0PGSTmdJCDRBQ6IQXb48g+y/A6Ka+Wo1svte222ogycEr/4OIulyyJF/bG59CGgLFOHmDQbGg=="
        ],
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-MS-Office365-Filtering-Correlation-Id": "1c9e9faf-8798-474f-28d6-08d43e254836",
        "X-Microsoft-Antispam": "UriScan:; BCL:0; PCL:0; RULEID:(22001);\n\tSRVR:MWHPR03MB2477; ",
        "X-Microsoft-Antispam-PRVS": "<MWHPR03MB24776BB7CF0209096C2FA3EA907D0@MWHPR03MB2477.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:MWHPR03MB2477; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2477;",
        "X-Forefront-PRVS": "01894AD3B8",
        "SpamDiagnosticOutput": "1:99",
        "SpamDiagnosticMetadata": "NSPM",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "16 Jan 2017 15:35:21.0119\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": "MWHPR03MB2477",
        "Subject": "[dpdk-dev] [PATCH v6 3/8] pci: split match and probe function",
        "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": "Matching of PCI device address and driver ID table is being done at two\ndiscreet locations duplicating the code. (rte_eal_pci_probe_one_driver\nand rte_eal_pci_detach_dev).\n\nSplitting the matching function into a public fn rte_pci_match.\n\nSigned-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>\n---\n lib/librte_eal/bsdapp/eal/rte_eal_version.map   |   1 +\n lib/librte_eal/common/eal_common_pci.c          | 189 +++++++++++++-----------\n lib/librte_eal/common/include/rte_pci.h         |  15 ++\n lib/librte_eal/linuxapp/eal/rte_eal_version.map |   1 +\n 4 files changed, 121 insertions(+), 85 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map\nindex 4dcf653..c015889 100644\n--- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map\n+++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map\n@@ -182,5 +182,6 @@ DPDK_17.02 {\n \trte_bus_dump;\n \trte_bus_register;\n \trte_bus_unregister;\n+\trte_pci_match;\n \n } DPDK_16.11;\ndiff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c\nindex 72547bd..0d799be 100644\n--- a/lib/librte_eal/common/eal_common_pci.c\n+++ b/lib/librte_eal/common/eal_common_pci.c\n@@ -152,129 +152,148 @@ pci_unmap_resource(void *requested_addr, size_t size)\n \t\t\t\trequested_addr);\n }\n \n-/*\n- * If vendor/device ID match, call the probe() function of the\n- * driver.\n- */\n-static int\n-rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *dev)\n+int\n+rte_pci_match(struct rte_pci_driver *pci_drv,\n+\t\t  struct rte_pci_device *pci_dev)\n {\n-\tint ret;\n+\tint match = 1;\n \tconst struct rte_pci_id *id_table;\n \n-\tfor (id_table = dr->id_table; id_table->vendor_id != 0; id_table++) {\n+\tif (!pci_drv || !pci_dev || !pci_drv->id_table) {\n+\t\tRTE_LOG(DEBUG, EAL, \"Invalid PCI Driver object\\n\");\n+\t\treturn -1;\n+\t}\n \n+\tfor (id_table = pci_drv->id_table; id_table->vendor_id != 0;\n+\t     id_table++) {\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\tif (id_table->vendor_id != pci_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\tif (id_table->device_id != pci_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 != dev->id.subsystem_vendor_id &&\n-\t\t\t\tid_table->subsystem_vendor_id != PCI_ANY_ID)\n+\t\tif (id_table->subsystem_vendor_id !=\n+\t\t    pci_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 != dev->id.subsystem_device_id &&\n-\t\t\t\tid_table->subsystem_device_id != PCI_ANY_ID)\n+\t\tif (id_table->subsystem_device_id !=\n+\t\t    pci_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\tif (id_table->class_id != pci_dev->id.class_id &&\n \t\t\t\tid_table->class_id != RTE_CLASS_ANY_ID)\n \t\t\tcontinue;\n \n-\t\tstruct rte_pci_addr *loc = &dev->addr;\n-\n-\t\tRTE_LOG(INFO, EAL, \"PCI device \"PCI_PRI_FMT\" on NUMA socket %i\\n\",\n-\t\t\t\tloc->domain, loc->bus, loc->devid, loc->function,\n-\t\t\t\tdev->device.numa_node);\n-\n-\t\t/* no initialization when blacklisted, return without error */\n-\t\tif (dev->device.devargs != NULL &&\n-\t\t\tdev->device.devargs->type ==\n-\t\t\t\tRTE_DEVTYPE_BLACKLISTED_PCI) {\n-\t\t\tRTE_LOG(INFO, EAL, \"  Device is blacklisted, not initializing\\n\");\n-\t\t\treturn 1;\n-\t\t}\n-\n-\t\tRTE_LOG(INFO, EAL, \"  probe driver: %x:%x %s\\n\", dev->id.vendor_id,\n-\t\t\t\tdev->id.device_id, dr->driver.name);\n-\n-\t\tif (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) {\n-\t\t\t/* map resources for devices that use igb_uio */\n-\t\t\tret = rte_eal_pci_map_device(dev);\n-\t\t\tif (ret != 0)\n-\t\t\t\treturn ret;\n-\t\t}\n-\n-\t\t/* reference driver structure */\n-\t\tdev->driver = dr;\n-\n-\t\t/* call the driver probe() function */\n-\t\tret = dr->probe(dr, dev);\n-\t\tif (ret) {\n-\t\t\tdev->driver = NULL;\n-\t\t\tif (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING)\n-\t\t\t\trte_eal_pci_unmap_device(dev);\n-\t\t}\n-\n-\t\treturn ret;\n+\t\tmatch = 0;\n+\t\tbreak;\n \t}\n-\t/* return positive value if driver doesn't support this device */\n-\treturn 1;\n+\n+\treturn match;\n }\n \n /*\n- * If vendor/device ID match, call the remove() function of the\n+ * If vendor/device ID match, call the probe() function of the\n  * driver.\n  */\n static int\n-rte_eal_pci_detach_dev(struct rte_pci_driver *dr,\n-\t\tstruct rte_pci_device *dev)\n+rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr,\n+\t\t\t     struct rte_pci_device *dev)\n {\n-\tconst struct rte_pci_id *id_table;\n+\tint ret;\n+\tstruct rte_pci_addr *loc;\n \n \tif ((dr == NULL) || (dev == NULL))\n \t\treturn -EINVAL;\n \n-\tfor (id_table = dr->id_table; id_table->vendor_id != 0; id_table++) {\n+\tloc = &dev->addr;\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 != dev->id.subsystem_vendor_id &&\n-\t\t\t\tid_table->subsystem_vendor_id != PCI_ANY_ID)\n-\t\t\tcontinue;\n-\t\tif (id_table->subsystem_device_id != dev->id.subsystem_device_id &&\n-\t\t\t\tid_table->subsystem_device_id != PCI_ANY_ID)\n-\t\t\tcontinue;\n+\tRTE_LOG(INFO, EAL, \"PCI device \"PCI_PRI_FMT\" on NUMA socket %i\\n\",\n+\t\t\tloc->domain, loc->bus, loc->devid, loc->function,\n+\t\t\tdev->device.numa_node);\n \n-\t\tstruct rte_pci_addr *loc = &dev->addr;\n+\t/* The device is not blacklisted; Check if driver supports it */\n+\tret = rte_pci_match(dr, dev);\n+\tif (ret) {\n+\t\t/* Match of device and driver failed */\n+\t\tRTE_LOG(DEBUG, EAL, \"Driver (%s) doesn't match the device\\n\",\n+\t\t\tdr->driver.name);\n+\t\treturn 1;\n+\t}\n+\n+\t/* no initialization when blacklisted, return without error */\n+\tif (dev->device.devargs != NULL &&\n+\t\tdev->device.devargs->type ==\n+\t\t\tRTE_DEVTYPE_BLACKLISTED_PCI) {\n+\t\tRTE_LOG(INFO, EAL, \"  Device is blacklisted, not\"\n+\t\t\t\" initializing\\n\");\n+\t\treturn 1;\n+\t}\n \n-\t\tRTE_LOG(DEBUG, EAL, \"PCI device \"PCI_PRI_FMT\" on NUMA socket %i\\n\",\n-\t\t\t\tloc->domain, loc->bus, loc->devid,\n-\t\t\t\tloc->function, dev->device.numa_node);\n+\tRTE_LOG(INFO, EAL, \"  probe driver: %x:%x %s\\n\", dev->id.vendor_id,\n+\t\tdev->id.device_id, dr->driver.name);\n \n-\t\tRTE_LOG(DEBUG, EAL, \"  remove driver: %x:%x %s\\n\", dev->id.vendor_id,\n-\t\t\t\tdev->id.device_id, dr->driver.name);\n+\tif (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) {\n+\t\t/* map resources for devices that use igb_uio */\n+\t\tret = rte_eal_pci_map_device(dev);\n+\t\tif (ret != 0)\n+\t\t\treturn ret;\n+\t}\n \n-\t\tif (dr->remove && (dr->remove(dev) < 0))\n-\t\t\treturn -1;\t/* negative value is an error */\n+\t/* reference driver structure */\n+\tdev->driver = dr;\n \n-\t\t/* clear driver structure */\n+\t/* call the driver probe() function */\n+\tret = dr->probe(dr, dev);\n+\tif (ret) {\n \t\tdev->driver = NULL;\n-\n \t\tif (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING)\n-\t\t\t/* unmap resources for devices that use igb_uio */\n \t\t\trte_eal_pci_unmap_device(dev);\n+\t}\n \n-\t\treturn 0;\n+\treturn ret;\n+}\n+\n+/*\n+ * If vendor/device ID match, call the remove() function of the\n+ * driver.\n+ */\n+static int\n+rte_eal_pci_detach_dev(struct rte_pci_driver *dr,\n+\t\tstruct rte_pci_device *dev)\n+{\n+\tint ret;\n+\tstruct rte_pci_addr *loc;\n+\n+\tif ((dr == NULL) || (dev == NULL))\n+\t\treturn -EINVAL;\n+\n+\tret = rte_pci_match(dr, dev);\n+\tif (ret) {\n+\t\t/* Device and driver don't match */\n+\t\treturn 1;\n \t}\n \n-\t/* return positive value if driver doesn't support this device */\n-\treturn 1;\n+\tloc = &dev->addr;\n+\n+\tRTE_LOG(DEBUG, EAL, \"PCI device \"PCI_PRI_FMT\" on NUMA socket %i\\n\",\n+\t\t\tloc->domain, loc->bus, loc->devid,\n+\t\t\tloc->function, dev->device.numa_node);\n+\n+\tRTE_LOG(DEBUG, EAL, \"  remove driver: %x:%x %s\\n\", dev->id.vendor_id,\n+\t\t\tdev->id.device_id, dr->driver.name);\n+\n+\tif (dr->remove && (dr->remove(dev) < 0))\n+\t\treturn -1;\t/* negative value is an error */\n+\n+\t/* clear driver structure */\n+\tdev->driver = NULL;\n+\n+\tif (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING)\n+\t\t/* unmap resources for devices that use igb_uio */\n+\t\trte_eal_pci_unmap_device(dev);\n+\n+\treturn 0;\n }\n \n /*\ndiff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h\nindex 8557e47..6c9ec39 100644\n--- a/lib/librte_eal/common/include/rte_pci.h\n+++ b/lib/librte_eal/common/include/rte_pci.h\n@@ -371,6 +371,21 @@ rte_eal_compare_pci_addr(const struct rte_pci_addr *addr,\n int rte_eal_pci_scan(void);\n \n /**\n+ * Match the PCI Driver and Device using the ID Table\n+ *\n+ * @param pci_drv\n+ *\tPCI driver from which ID table would be extracted\n+ * @param pci_dev\n+ *\tPCI device to match against the driver\n+ * @return\n+ *\t0 for successful match\n+ *\t!0 for unsuccessful match\n+ */\n+int\n+rte_pci_match(struct rte_pci_driver *pci_drv,\n+\t      struct rte_pci_device *pci_dev);\n+\n+/**\n  * Probe the PCI bus for registered drivers.\n  *\n  * Scan the content of the PCI bus, and call the probe() function for\ndiff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map\nindex b553b13..5ed2589 100644\n--- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map\n+++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map\n@@ -186,5 +186,6 @@ DPDK_17.02 {\n \trte_bus_dump;\n \trte_bus_register;\n \trte_bus_unregister;\n+\trte_pci_match;\n \n } DPDK_16.11;\n",
    "prefixes": [
        "dpdk-dev",
        "v6",
        "3/8"
    ]
}