From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0057.outbound.protection.outlook.com [104.47.40.57]) by dpdk.org (Postfix) with ESMTP id 8737B2C8 for ; Tue, 13 Dec 2016 14:34:33 +0100 (CET) Received: from BN6PR03CA0042.namprd03.prod.outlook.com (10.175.124.28) by BN6PR03MB2465.namprd03.prod.outlook.com (10.168.223.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.771.8; Tue, 13 Dec 2016 13:34:31 +0000 Received: from BL2FFO11FD049.protection.gbl (2a01:111:f400:7c09::148) by BN6PR03CA0042.outlook.office365.com (2603:10b6:404:10c::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.771.8 via Frontend Transport; Tue, 13 Dec 2016 13:34:31 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD049.mail.protection.outlook.com (10.173.161.211) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.761.6 via Frontend Transport; Tue, 13 Dec 2016 13:34:31 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:742; Count:10 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id uBDDYRw4005048; Tue, 13 Dec 2016 06:34:28 -0700 From: Shreyansh Jain To: , CC: , , , Shreyansh Jain Date: Tue, 13 Dec 2016 19:07:00 +0530 Message-ID: <1481636232-2300-1-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480846288-2517-1-git-send-email-shreyansh.jain@nxp.com> References: <1480846288-2517-1-git-send-email-shreyansh.jain@nxp.com> X-IncomingHeaderCount: 10 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131261096718309694; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(7916002)(39860400002)(39410400002)(39850400002)(39380400002)(39840400002)(39400400002)(39450400003)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(105606002)(106466001)(48376002)(36756003)(230783001)(5003940100001)(5001770100001)(189998001)(47776003)(4326007)(86362001)(68736007)(97736004)(2950100002)(8936002)(626004)(104016004)(50986999)(76176999)(2906002)(81166006)(50226002)(33646002)(85426001)(81156014)(6666003)(5660300001)(8666005)(356003)(305945005)(15395725005)(77096006)(92566002)(50466002)(8676002)(38730400001)(7059030)(21314002)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2465; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD049; 1:w71r1vlDk3VvLgYnS2FLJi03d9ju0ajZJiRA2dyAmkA7C5Moff4vAg2IT+uM1m/1JNaDbYCb630rm1Mj2LoVO8Oa/QUujq4HRKN/GpLP6J8VJ74U5EbwNPM8BsAWROp6yx1Ut9BSM75xS9wO3jlz7JONpHIFFMY40WQndMiktYvkE0YMn4FnL6/2uWhjzdQWKVY/OykeJXZ+hfMQKjkDnVJ+uzFOh++nzuOtl/UTMgagYTpe65QLlc5rQqOD5IyB1dJ+vNmFqMriNFnFQsZtZjKaOHVSQCOZ1g2WAem45zRt8b8UNSMH9SGi5TThLluBwZrxcqduTWvKPFnGz9nOTU6zlnLV/SYPAZFae0SKYzAmKv6wzxUfK9aRE9oS1iOHrx2bfMo/L9WkuxBDI9lE+hHI9Pv3to0tfHGr+V4HlrIHYT3bTdXyoDKJOqUdI3yXspmvC+YWsLp/9kPmPWxMWyIwIqvU6L0blc31EkynvAe+0mUeEeOtPTt5bamYRgBGXHNaZIDXMsrQamjs2pYoMDP6yI1W4MFqp6hUR6YwFFYXeSSxMG7nCHfmwB3tJ1fff3L5qhObtnAng3R91MSrCTKeRW6mdrl12yaMWRGN78hDFxqv63CenQOEeJsXzREaMRcBNsWMv7fYnaj08z5/jqgm7/Gvh2oVkm3JgCMrPC9KuYjuvy6ukBrBQXVeRuLjirAyYAze0x0bt2c6MAGJFYoAAwCScm13nfWmkJ/HyA8YvBDyZsn5W6b7pKmlokmh4f16isq3imZYTMxWDw3CwQ== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 3db40bee-500f-40ec-b7e0-08d4235cc52d X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN6PR03MB2465; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2465; 3:QsyB3mCj1pXZ+Vsec/umVkjowQhvH+5MKINtSqyH0QFfu8rnyaFjnv5bSfeVL0akJBjzRXWhIyszGptDkfcl3aOq9I7IW2S3KRwd8KUkFZ7s1bsdJoa7eeBGIGTFV7MTTLl0OCoqv8V4AhIUFDN+tUHFtLGY9mMgWuWGPNXV4Ie+ddIWmSNpPj6G4Mog9RSUgnO8oBa28Uz45gTyMoVBybWV2IjV61Jioucaogk4MrAUkex6Mak4OPMCPvEB8s8hBRxVVjwU+IVlYV3kK0ai4XXf7uSBt1G5/pT6dgYuV5OXZ+QKxajUKRVkpIXX9QwGibCxgW+NgfBu8CoIcaJ+iK1ig4WAakF/M0wlhwO64Zn5Vq632woWlHNGT+tjJhmo X-Microsoft-Exchange-Diag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Oe+ffZX3nj68evk8mmc6f+erRXBi7BX/c2Ja/TySJFHK0NE2D7qTdcbHoF3BJe0VMgzN/CldkAPBD4aXotCOZqF+dSYvrYqhmcM8a1xKgWrpBtF+Q0VivvhX5+bjYqxQgD+LXiQfNPpqEEjuSvGP68dAOvX5u7xOVUO6Tv5go0avh1mGgqfhH46ni2m+muWo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(5005006)(13017025)(8121501046)(13018025)(13023025)(13024025)(13015025)(10201501046)(3002001)(6055026)(6096035)(20161123563025)(20161123559025)(20161123565025)(20161123556025)(20161123561025); SRVR:BN6PR03MB2465; BCL:0; PCL:0; RULEID:(400006); SRVR:BN6PR03MB2465; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2465; 4:rkUjvGVDmbVavlZnKkYqgiIeA7JAj1A6KEZJmwc69TMbfbFbcCPjMWis4yVmhyKlnnuA49SYG9m2sHvRysRThsA7DW5foWZbZtHM+tYm0cq+lZtZZ/gD7LSequBe88+tcxdupA/u/VpOOPd6Av4tJukc1dyD3JdrmbJpWaj1XKmMsNoxhz4Vuoq5iEdad8AT68g6NE94XMnVrB08LHrslqj+0HU+eYawhWLDfTMsr1VgjQRJHBhPmeaIUk4D7abEMBpIj2+77ThpyV8OUpS2qTegqPirp6w6QRwd2tlY9l8zqIUay2OuiMQRBG1VwDx3oG//pvYIblqZKMX/WiTLUUjyDbKmoNny2PMW1rsVa+D0HCoIdKrIDHBSumW13vHDnSp3wT9zR/+j7WqRv78hEp7yz6rHFqESMbLuW25qAwYc4bQLDKKglgiZO5Ya6s6InGDPZ0EvEOhWVRQ8KFbkYZUTKOnMFmSkmVLNdDGdzojYk3CDQlqJPp84oiMJqo+E3nVvV6OggcXB33/m0Ip7ElcLyqH4u7DaioEIW+00sSfl9s+gmJc2DvA1gR0+RRIhcsCbS2yZ/qcuAwxVeaG7hyQfZft9uHxbmf+IUZLleKCQMlOjIS7WRwU7hYB9bOPlxRVAw1V8KhGWsni4y7XiFWQwZf+DIXRxim40piVvY39R8fnXnmN7iq6+anHEhy34OAOonfSvxZnVORxEuiVfng== X-Forefront-PRVS: 01559F388D X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2465; 23:zVEMEZJkkXCb4N5Yn7EXdcncW701aqXPRR77bUhv/?= =?us-ascii?Q?bU5ZSC5B024SFakpt4sNp9Qp1nRdNlnYkB1v2na6zXL4cnR4tcJCLId5QLJ8?= =?us-ascii?Q?Di768sIlOQi73smwD6QxNXg+jGZ0a51IdC4W7LvyCWtj+3VFjSpVdx6aTcFb?= =?us-ascii?Q?KkrpgrNjUlobXREagxC/s2x1aoBhwVTafyXe73XRky1FChl9S4MVUvoKktmO?= =?us-ascii?Q?2kdUp6ruThP52Af1adDhvJj02Zgy/qNwQ/WNxvOJms68a3BokZLR4+WRiaO2?= =?us-ascii?Q?MOWqc9/LkEuwmpZi2oos2lu3TclRoh101tRT+FzD71+gxkdNhQM02HUu4Jy4?= =?us-ascii?Q?h7LR4Z0+JhkceQE6m06w1BeiWGDVUmPnvM8oYovmqd3xTwDWLKFGrfd4CTDy?= =?us-ascii?Q?PluhghWYyQIthDI3EICcuVKWo1GwC+M9t0v6LzTXtkX28gSsnai+ZPfAUmoW?= =?us-ascii?Q?YUsANeVsP59fLewtUjUThw/m7/8DFIE7ubZMtN6mBxQdL0l87QJzVkREEj1C?= =?us-ascii?Q?gw8t1V1gDgCBQDtUg4pQjxLB9piGQ8yurIEqKJjKBL/ufsuj+3YH2IWaAFch?= =?us-ascii?Q?ARXfrPCnVoBElCRi20XjfM1WUA6xp+bZC/8+Enxjcw+ckbj0p+E2jfwTHC87?= =?us-ascii?Q?jzHt2Upd+1v8h1z8ShNLwy5Hj7afQSbJeGjklQeIKrgrA02yTP8scN17Cspw?= =?us-ascii?Q?ESlA7JTwtU/KDhWrgDNZEdGHKryzWR1X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xSEHjwzuSncVclYSnN5dDbwead28Xac6jyJL7O07E+81eIWDLHJs6rJ4R88qg1jiAdmx+LT70ZQAvb1YPIi8TtfrOBOaFFxhc70KZtFaV9fm+NtmVgs4Q0isEsE/rsGNEcc+vJ5qlZOJU9zcVHlKrShM1aCgjQKmuhv9kMeKthxze8azktp8NygWiittYC3k4di9hLdZ; 5:saXeYt0WdlqhLWQp5YIo/fzopkgFr0IWlYwL9nP9wrASNDWPhHymnjB/h8LgvF7lYC3hFWyEgXFyd8Jqp2z788q7QUt1Yhn6FtMe3RtLT8bkH8hEAkFRklznE1nPGVbZi4sjGCQ6Kau9iQtzfWnicOLvIKn7cjPNOhzN2JtGeu5k719G2BHARqou+YtNBljF; 24:/f5yejfhJFC6gt5SOZ9BFOteG/hs9a9rd/FY/xXZhRwxtyyx56HeRTobN/RC9PAN+dJmR9MssB2wCFzFXUun4ygWyd5zShxM1u3kUfZvcgQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2465; 7:VAwODVOiTq8pxCmVrHi4M+ek5CrQBp5L5lzqIwrzBBteyKkm04Ev+HWqesXQe4vBs49nRSUEmRD5VxAgO9N0bXlhHW2pZKYP+S6GSmMfw1Ysti2vLwZulmP2M/ppkJC3MJJx/ZRhxZG3OHO8GaYeR8ivTal91lObdPRfQkxeHjfPOIlmip6qW+MG58Gxb3AIgkZXl9i6QI5PvI6WycEWR3ULOcnIHIIxOGWLGM8xhe2KeYx3XHcUn3j8s0HfgfZM5elZBVB16NuTZm721VCZNU0sToU5SLR7b6S0+hsofvvPvvqzkSFicPLBJ5g+iLBQ/2y0fXD7rmPEusg+Ubgq9tzSGKnh5P9asp6te8vmB2Xz7basdEwYgAYCjCFDz19ieB+yenPCJeqGByvoxNfjckoRCm7syssJaUWfY5lE6RAJ3DFldy3wO96La0/c1Mkb7GrxYhBFSbnVRC2e2eeA/g== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2016 13:34:31.6437 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2465 Subject: [dpdk-dev] [PATCH v2 00/12] Introducing EAL Bus-Device-Driver Model X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Dec 2016 13:34:34 -0000 Link to v1: [10] :: Introduction :: DPDK has been inherently a PCI inclined framework. Because of this, the design of device tree (or list) within DPDK is also PCI inclined. A non-PCI device doesn't have a way of being expressed without using hooks started from EAL to PMD. (Check 'Version Changes' section for changes) :: Overview of the Proposed Changes :: Assuming the below graph for a computing node: device A1 | +==.===='==============.============+ Bus A. | `--> driver A11 \ device A2 `-> driver A12 \______ |CPU | /````` device B1 / | / +==.===='==============.============+ Bus B` | `--> driver B11 device B2 `-> driver B12 - One or more buses are connected to a CPU (or core) - One or more devices are conneted to a Bus - Drivers are running instances which manage one or more devices - Bus is responsible for identifying devices (and interrupt propogation) - Driver is responsible for initializing the device In context of DPDK EAL: - rte_bus, represents a Bus. An implementation of a physical bus would instantiate this class. - Buses are registered just like a PMD - RTE_REGISTER_BUS() `- Thus, implementation for PCI would instantiate a rte_bus, give it a name and provide scan/match hooks. - Currently, priority of RTE_REGISTER_BUS constructor has been set to 101 to make sure bus is registered *before* drivers are. - Each registered bus is part of a doubly list. -- Each device refers to rte_bus on which it belongs -- Each driver refers to rte_bus with which it is associated -- Device and Drivers lists are part of rte_bus -- NO global device/driver list would exist - When a PMD wants to register itself, it would 'add' itself to an existing bus. Which essentially converts to adding the driver to a bus specific driver_list. - Bus would perform a scan and 'add' devices scanned to its list. - Bus would perform a probe and link devices and drivers on each bus and invoking a series of probes `-- There are some parallel work for combining scan/probe in EAL [5] and also for doing away with a independent scan function all together [6]. The view would be almost like: __ rte_bus_list / +----------'---+ |rte_bus | | driver_list------> device_list for this bus | device_list---- | scan() | `-> driver_list for this bus | match() | | probe() | | | +--|------|----+ _________/ \_________ +--------/----+ +-\---------------+ |rte_device | |rte_driver | | *rte_bus | | *rte_bus | | rte_driver | | probe() | | | | remove() | | devargs | | | +---||--------+ +---------|||-----+ || ''' | \ \\\ | \_____________ \\\ | \ ||| +------|---------+ +----|----------+ ||| |rte_pci_device | |rte_xxx_device | ||| | PCI specific | | xxx device | ||| | info (mem,) | | specific fns | / | \ +----------------+ +---------------+ / | \ _____________________/ / \ / ___/ \ +-------------'--+ +------------'---+ +--'------------+ |rte_pci_driver | |rte_vdev_driver | |rte_xxx_driver | | PCI id table, | | | +---------------+ | data | | ... | | probe() | +----------------+ | remove() | +----------------+ In continuation to the RFC posted on 17/Nov [9], A series of patches is being posted which attempts to create: 1. A basic bus model `- define rte_bus and associated methods/helpers `- test infrastructure to test the Bus infra 2. Changes in EAL to support PCI as a bus `- a "pci" bus is registered `- existing scan/match/probe are modified to allow for bus integration `- PCI Device and Driver list, which were global entities, have been moved to rte_bus->[device/driver]_list For v2 as well, I have sanity tested this patch over a XeonD X552 available with me, as well as part of PoC for verifying NXP's DPAA2 PMD (being pushed out in a separate series). Exhaustive testing is still pending. -> Please help in MLX & BSD related changes. :: Brief about Patch Layout :: 0001: Container_of patch from [3] 0002~0003: Introducing the basic Bus model and associated test case 0004~0005: Add scan, match and insert support for devices on bus 0006: Add probe and remove for rte_driver 0007: Enable probing of PCI Bus (devices) from EAL 0008: Split the existing PCI probe into match and probe 0009: Make PCI probe/match work on rte_driver/device rather than rte_pci_device/rte_pci_driver 0010: Patch from Ben [8], part of series [2] 0011: Enable Scan/Match/probe on Bus from EAL and remove unused functions and lists. PMDs still don't work (in fact, PCI PMD don't work after this patch - but without any compilation issues). 0012: Change PMDs to integrate with PCI bus :: Pending Changes/Caveats :: 0. eth_dev still contains rte_pci_device. I am banking on Jan's patches [1] for conversion to a macro (ETH_DEV_PCI_DEV) and subsequent replacement of all pci_dev usage in eth_dev. 1. One of the major changes pending, as against proposed in RFC, is the removal of eth_driver. Being a large change, and independent one, this would be done in a separate series of patches. [] 2. app/test/test_pci.c is still not modified. It is rendered uncompilable as most of the APIs it was calling don't exist anymore. I will push a v2 which would include a complete re-write of test_pci (or, if someone can help me that, it would be awesome). 3. This patchset only moves the PCI into a bus. And, that movement is also currently part of the EAL (lib/librte_eal/linux) - there was an open question in RFC about where to place the PCI bus instance - whether in drivers/bus/... or in lib/librte_bus/... or lib/librte_eal/...; This patch uses the last option. But, movement only impacts placement of Makefiles. Please convey your reservations for current placement. - It also impacts the point (8) about priority use in constructor 4. Though the implementation for bus is common for Linux and BSD, the PCI bus implementation has been done/tested only for Linux. 5. There was a suggestion from Jan Blunk about a helper iterator within the rte_bus. I will send this out in v3. 6. Cyptodev and VDEV changes are still pending. Jan has already conveyed that he would be working on the VDEV part. I will work on the Crypto part and target that for v3. 7. The overall layout for driver probing has changed a little. earlier, it was: rte_eal_init() `-> rte_eal_pci_probe() (and parallel for VDEV) `-> rte_pci_driver->probe() `-> eth_driver->eth_dev_init() now, it would be: rte_eal_init() `-> rte_eal_bus_probe() <- Iterator for PCI device/driver `-> rte_driver->probe() <- devargs handling | old rte_eal_pci_probe() `-> rte_xxx_driver->probe() <- eth_dev allocation `-> eth_driver->eth_dev_init <- eth_dev init Open Questions: Also, rte_driver->probe() creating eth_dev certainly sounds a little wrong - but, I would like to get your opinion on how to lay this order of which layer ethernet device corresponds to. 1) Which layer should allocate eth_dev? `-> My take: rte_driver->probe() 2) which layer should fill the eth_dev? `-> My take: rte_xxx_driver->probe() 3) Is init/uninit better name for rte_xxx_driver()->probe() if all they do is initialize the ethernet device? 8. RTE_REGISTER_BUS has been declared with contructor priority of 101 It is important that Bus is registered *before* drivers are registered. Only way I could find to assure that was via __attribute(contructor(priority)) of GCC. I am not sure how it would behave on other compilers. Any suggestions? - One suggestion from David Marchand was to use global bus object handles, which I have not implemented for now. If that is common choice, I will change in v3. :: ToDo list :: - app/test/test_pci.c compilation is failing, if enabled. - Bump to librte_eal version - Documentation continues to have references to some _old_ PCI symbols - vdev changes - eth_device, eth_driver changes :: References :: [1] http://dpdk.org/ml/archives/dev/2016-November/050186.html [2] http://dpdk.org/ml/archives/dev/2016-November/050622.html [3] http://dpdk.org/ml/archives/dev/2016-November/050416.html [4] http://dpdk.org/ml/archives/dev/2016-November/050567.html [5] http://dpdk.org/ml/archives/dev/2016-November/050628.html [6] http://dpdk.org/ml/archives/dev/2016-November/050415.html [7] http://dpdk.org/ml/archives/dev/2016-November/050443.html [8] http://dpdk.org/ml/archives/dev/2016-November/050624.html [9] http://dpdk.org/ml/archives/dev/2016-November/050296.html [10] http://dpdk.org/ml/archives/dev/2016-December/051349.html :: Version Changes :: v2: - No more bus->probe() Now, rte_eal_bus_probe() calls rte_driver->probe based on match output - new functions, rte_eal_pci_probe and rte_eal_pci_remove have been added as glue code between PCI PMDs and PCI Bus `-> PMDs are updated to use these new functions as callbacks for rte_driver - 'default' keyword has been removed from match and scan - Fix for incorrect changes in mlx* and nicvf* - Checkpatch fixes - Some variable checks have been removed from internal functions; functions which are externally visible continue to have such checks - Some rearrangement of patches: -- changes to drivers have been separated from EAL changes (but this does make PCI PMDs non-working for a particular patch) Ben Walker (1): pci: Pass rte_pci_addr to functions instead of separate args Jan Blunck (1): eal: define container_of macro Shreyansh Jain (10): eal/bus: introduce bus abstraction test: add basic bus infrastructure tests eal/bus: add scan, match and insert support eal: integrate bus scan and probe with EAL eal: add probe and remove support for rte_driver eal: enable probe from bus infrastructure pci: split match and probe function eal/pci: generalize args of PCI scan/match towards RTE device/driver eal: enable PCI bus drivers: update PMDs to use rte_driver probe and remove app/test/Makefile | 2 +- app/test/test.h | 2 + app/test/test_bus.c | 688 ++++++++++++++++++++++++ app/test/test_pci.c | 2 +- drivers/net/bnx2x/bnx2x_ethdev.c | 8 + drivers/net/bnxt/bnxt_ethdev.c | 4 + drivers/net/cxgbe/cxgbe_ethdev.c | 4 + drivers/net/e1000/em_ethdev.c | 4 + drivers/net/e1000/igb_ethdev.c | 8 + drivers/net/ena/ena_ethdev.c | 4 + drivers/net/enic/enic_ethdev.c | 4 + drivers/net/fm10k/fm10k_ethdev.c | 4 + drivers/net/i40e/i40e_ethdev.c | 4 + drivers/net/i40e/i40e_ethdev_vf.c | 4 + drivers/net/ixgbe/ixgbe_ethdev.c | 8 + drivers/net/mlx4/mlx4.c | 4 +- drivers/net/mlx5/mlx5.c | 1 + drivers/net/nfp/nfp_net.c | 4 + drivers/net/qede/qede_ethdev.c | 8 + drivers/net/szedata2/rte_eth_szedata2.c | 4 + drivers/net/thunderx/nicvf_ethdev.c | 4 + drivers/net/virtio/virtio_ethdev.c | 2 + drivers/net/vmxnet3/vmxnet3_ethdev.c | 4 + lib/librte_eal/bsdapp/eal/Makefile | 1 + lib/librte_eal/bsdapp/eal/eal.c | 12 +- lib/librte_eal/bsdapp/eal/eal_pci.c | 52 +- lib/librte_eal/bsdapp/eal/rte_eal_version.map | 22 +- lib/librte_eal/common/Makefile | 2 +- lib/librte_eal/common/eal_common_bus.c | 285 ++++++++++ lib/librte_eal/common/eal_common_pci.c | 341 +++++++----- lib/librte_eal/common/eal_private.h | 14 +- lib/librte_eal/common/include/rte_bus.h | 257 +++++++++ lib/librte_eal/common/include/rte_common.h | 21 + lib/librte_eal/common/include/rte_dev.h | 14 + lib/librte_eal/common/include/rte_pci.h | 59 +- lib/librte_eal/linuxapp/eal/Makefile | 1 + lib/librte_eal/linuxapp/eal/eal.c | 12 +- lib/librte_eal/linuxapp/eal/eal_pci.c | 81 +-- lib/librte_eal/linuxapp/eal/rte_eal_version.map | 22 +- 39 files changed, 1737 insertions(+), 240 deletions(-) create mode 100644 app/test/test_bus.c create mode 100644 lib/librte_eal/common/eal_common_bus.c create mode 100644 lib/librte_eal/common/include/rte_bus.h -- 2.7.4