From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0055.outbound.protection.outlook.com [104.47.36.55]) by dpdk.org (Postfix) with ESMTP id 083FD2BF6 for ; Sun, 4 Dec 2016 11:08:59 +0100 (CET) Received: from BLUPR0301CA0018.namprd03.prod.outlook.com (10.162.113.156) by BY2PR0301MB0742.namprd03.prod.outlook.com (10.160.63.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.747.13; Sun, 4 Dec 2016 10:08:57 +0000 Received: from BN1BFFO11FD003.protection.gbl (2a01:111:f400:7c10::1:197) by BLUPR0301CA0018.outlook.office365.com (2a01:111:e400:5259::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.9 via Frontend Transport; Sun, 4 Dec 2016 10:08:56 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) 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.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1BFFO11FD003.mail.protection.outlook.com (10.58.144.66) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.734.4 via Frontend Transport; Sun, 4 Dec 2016 10:08:55 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:545; Count:8 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id uB4A8pK4019825; Sun, 4 Dec 2016 03:08:52 -0700 From: Shreyansh Jain To: CC: , , Shreyansh Jain Date: Sun, 4 Dec 2016 15:41:15 +0530 Message-ID: <1480846288-2517-1-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 X-IncomingHeaderCount: 8 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131253197361199477; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(339900001)(336004)(199003)(189002)(5003940100001)(86362001)(104016004)(50986999)(356003)(8676002)(2906002)(230783001)(15395725005)(47776003)(50226002)(48376002)(69596002)(81166006)(2351001)(305945005)(81156014)(7846002)(33646002)(105606002)(110136003)(106466001)(36756003)(4326007)(39400400001)(8936002)(8666005)(626004)(189998001)(68736007)(77096006)(97736004)(5660300001)(92566002)(50466002)(38730400001)(6666003)(39380400001)(6916009)(39410400001)(85426001)(39450400002)(7059030)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB0742; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD003; 1:7P2dxfX4ppiuxEEGijaCKAFiX5Y7T3MnMrx+/2Tvq+xXKrZfTQSJ+dAUPh/gWKhSBnMxixW2YUeG/A8YSFvm/d53rUKVXn0Ck4zY0l7NFGAPn6kXX21C44KA2UzAh2bhoLuFZ+1w0lUUAJtsUibsHXPoCwK8KazcBSiHqav8b/IpQBybGiGv/QBKfW1nOgh0uJ0brLnlj6ybbrLiBTJyKjJq8MNB4ah9VYZnGevT7KGaBXm0dtxgQ4gT4crRWi56/mYj0sQUtZMD0Z9o5c6Ay/V5v7GoBAzGltl+uZnb3D5WcPKKlfGojG5FJedBnm3ByABgw5sBgCdsEPePEJnxq7ECk1/kDcxdqFqmp2WfnDamDncU70XHOWVVuMpXrLW+DNdwnWNtdtg5f6p/uzqygxU38bQu0RZ6beVLYAQLnCOtPrATLSrIiQ9IGeZzJkbB+XLzwNFqE+VerxN29e/bDwXl+zK1H6HU/55AaAjcK4yecS7H2d+yL0cWhMZvXh1sm6TL89i2mdTOafj3Zv+lxdZTUoEtoMmzjuR6iChoJ/ClLsRPaMoY/Ut0B9VNgEpk5mksYFcyELjVS084LvUm3yGC8E5L6DnE3dRurPWOv7aUyLi1Z2huhS20qcrJEdk+Vpxi0vcJla0n92hQnA25nScUmRnMfVqnJ4De9j/E895pu0UB3GKhW4QtydSLebGU8y42xoP6RSe5GwerA/kFAC8UdPNqLIlXI8pC8azh22Y= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 96681a9b-24ec-4436-d815-08d41c2d8ecd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY2PR0301MB0742; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0742; 3:1eFuzO+KKZuIFoBu4M/BBuJecR2ljrImNXvnvLYm+zxZWXWDZEVgHSO2gK06idK6Kin4+7OHk8/kjYhnC1XtV+eu4PxeiiQLEG8/aW6nhsgomV0qnZS4PVGrtn8v5ofkeSkFKk5iMDyCk4dmC+g3tTzIT/cKKriF+b3k+iX9R2+lavOhXxPAy0z6CtrJOtHnvgwX57w4yxuMvVb42il07xOxnWJhxdZpJnMIuZ6QiXzgVGhDLeYMwxc40IxwR6r3MK5ILbdrsBNCPBJPx1Zkq6xFgAnD0QOVdQPbAn+Y1Q0sUkU1SNXIBgTwj1uQDHJTKPbV+NhD+eUKIEhvqqYRERbDdY5w4CXJYf6loG1bnOLP8i9kjkIgid1+FyQt5ugX X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0742; 25:V6r2+aR622SgKxScR4osGcWKl5QhCtWhAeHqWnkIoV/k0kvHVpK1G6P5LQPr7P1bGoA+1p4smwVzm1MEWGGLuntCd6PFgFLfmkCOxu2yoaFv0w9k4Na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2LBrmEl4EY2cjSpN6Xc18Q== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13017025)(13024025)(5005006)(13023025)(13015025)(13018025)(8121501046)(3002001)(10201501046)(6055026)(6096035)(20161123556025)(20161123559025)(20161123563025)(20161123565025)(20161123561025); SRVR:BY2PR0301MB0742; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB0742; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0742; 4:+ocGhuHDWc5UR367jpsODMvC0cnw2zyMjdkxpfutX1s3dh8NQxRygO7KGCgyZuakBEhOLhpwaK6S/7azRuycfG7Ni3cVj7eAMY9WVkONDyzrHAOoJuFmfY7Jg4+vgLHXkN/Ug/I8pmobmZZUF+OxAwHwKhZ8NM2RGa/D7fZ15QCW6DMqLGf4JJecpVM2ihw1IOZqeY3m8+r1iKddqoikysRJe5KBWg01HY+He3uwPjmShshfzLyKj1sZRkceZM0giBmfLEEyimg+neMJIsvUHZMogF5E77Lca6R8aiH1VnV9aH0TzxNJm74JmHWtuAzqZAhjVne8ATLUqYl+X3j7XesJEkiFTE6UxsDGWO/slqINfHkoVAYSR+yOznkSx8xNJYK2tIEbDbh4auXthp0Fk3yv2vF1Dv6DZPLP9rZLOd4h6ZztWBa7J02ua6UypJNkA22VhigXdmQ/yYG9GbslkQTmHI36sta3USeeXQvA2mKaec3W9iPwrjIhj230kNucoxfrliNH137EFp9H3OWD5JaSWHkljhDvsrly6Hv5kcbjMDArtUBDs1jk+z8d/lTYC4jjfcMBNl4vO/SFr39fJ01qqRfHbLGckGwrmnM2bdCe/2mIanG9HVMQN3vmE54X3Lz4wSV4j1sNs4kMxKTU3ZhcCDsinc+4fENOM1gdIY9OI1O9cLyvpFkVmbfp+K2jXZQdhCCDVaye4fni6BcuMUOhP29GyfrK/Ls9G1GSJAg= X-Forefront-PRVS: 014617085B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB0742; 23:A9Fuv3vOiijXBTLNy0Dlq6SybfZKCuViDbdkynu?= =?us-ascii?Q?B6dcfZD/cNzwCca6A1ODox5s1uQ3+H+RqAXMLcvDLu2lkHdEeJo22xKvOSGO?= =?us-ascii?Q?v2CJqqUk33grQy8LMauQHhgm5AgMnIR8Z2E+38OycatUznkCjmjXPuyg0MjN?= =?us-ascii?Q?goan+hHtjTHJXapbSo43twKw6+7WvQIRTQYUUNrkn0dkw3GjYhT9lyBGAHzy?= =?us-ascii?Q?w9op89LsnRm795xzw7rgkK0sX1EVhaxGs/iCLj+8orScxaZwfSLkZtj26p/c?= =?us-ascii?Q?+nqdFYJZQVHYrvnb1b7xTOyTt6ustAL8KX3TRq6eauZOs3g2i30BLVhHFYDZ?= =?us-ascii?Q?3gg9jXktVU8nad4rV0AUqzP7HH8EjfHJ2wqivEO2YNazyjI2duPLcGZTwEJi?= =?us-ascii?Q?c42q+Vdzq3EaLngtOvg1zwB2B8tt09zqzm3yFUUYaTSXVHU1Q+cnwotC4fSx?= =?us-ascii?Q?5hLQEj6UmL+JJ5GHJa1j0hMZUJS8+F5EBv4fPAt8gYRe0NY1c9qOZlIG8OY5?= =?us-ascii?Q?MPMsbtFOFEtOBcJRllsmRbhj0V7kLL6KaQirAl+qofxUx4rGcqjM9O3BFftO?= =?us-ascii?Q?chMcqJRVOYCIzpqx4W5qJJfhKxp+sNmqTlol3jsfjOgMGvVH3BNJeXkt7kBZ?= =?us-ascii?Q?7TzRWr9++8cdYXvufkxSdFYw7Xgkj8unFQT7N4UUpdgYe+vwWOn+hNLf5/i+?= =?us-ascii?Q?s8QimYKV8E4DHg1gktmlo4uHrAFikKSz+8BjkHl5qE084MuW4NBsF1G6srUA?= =?us-ascii?Q?R4WTDdrKMDgHb+Wfa2v9dPCRfC4FIinlzRIardl4lULkoTzPXGIMzTwswCcS?= =?us-ascii?Q?lSs12UrAfRCrQ5i7EoX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RHHXEbhPyVzZLXor2VVrdAfCs5/QZUASRHjC8NN3ON+34abmUNGAeB3tMf+iFDHb9M4KtwZcINWFV8frYkmqL+MZrttMRhk6lo41OPHWYAQTuXO48PpcVRWv3tspCyzmjdf1x0VUb5BAhqJh63TFT3XcPV4AzzIC; 24:jXXT944SdJuvFDQ9sIlvT9P6vbUeOPso1bTWomRqd+UxrWzvSocxFHFz7xHp/9VH6IZSynQZYutv/y3VXMXL9YrWXKdLaJ7FBuz0k1K2WRY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0742; 7:GFe0K6HnZuupcRFngO1vm15CV/NDj+0z++CiRPUYP+iqfhNjAqS8P+Zg/L27mUrb6+VE51QyoACDyNTs+fWjVwlGDrVXzvT2gzvBVXsjvbkPIjouooXVhWiB4mPck3OQzENyFEZxU9MsDpIDiTH17iNB+89mrrGxiouSQ4W7ctKrPPCByLGxBnMs8ccW5iknnEA/ecfBQnvKXTsm/5QY90S449Zlew3CW9IgTi7zsfquTXUVXXANyP4f+4j7uNCufqq5zfATRDYub+Y+nKXukYEV1fnEEGSL3dRG8TQFKaikdazCESoSploCvJcXcolDJh3UiXO5DQIl7BIEDfxX1rug/4P+6NICh3hwQ7GQjQpHYqTyspIYdp/QRgJ8s/qekViLi5hgmW8UQrfaYtjdGIqOmuClQDMAboBij0rU+ERF6mJZ2H6BS2D2d8atxigp0MDr/aAV6f3XWOkBVxqtBA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2016 10:08:55.8703 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB0742 Subject: [dpdk-dev] [PATCH 00/13] 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: Sun, 04 Dec 2016 10:09:00 -0000 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. :: 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 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. :: Brief about Patch Layout :: 0001: Container_of patch from [3] 0002~0003: Introducing the basic Bus model and associated test case 0004: Add scan and match callbacks for the Bus and updated test case 0005: Support insertion of device rather than addition to tail 0006: Integrate bus scan/match with EAL, without any effective driver 0007: rte_pci_driver->probe replaced with rte_driver->probe 0008: Integrate probe of drivers with EAL 0009: Split the existing PCI probe into match and probe 0010: Make PCI probe/match work on rte_driver/device rather than rte_pci_device/rte_pci_driver 0011: Patch from Ben [8], part of series [2] 0012~0013: Enable Scan/Match/probe on Bus from EAL and remove unused functions and lists :: 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 v2. 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 v2. 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_bus_probe() `-> bus->prove() (*) <- Iterator for PCI device/driver; | old rte_eal_pci_probe() `-> rte_driver->probe() <- create eth_dev `-> rte_pci_driver->probe() <- PMD init; old eth_dev_init (*) Buses don't do probe. But in DPDK, EAL was doing this. This patch pushes that responsibility a layer down, towards rte_bus. See Patch 0008 for more explanantion 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? :: Some known issues :: - Checkpatch is failing on patch 0001 - app/test/test_pci.c compilation is failing, if enabled. By default it seems to be disabled (CONFIG_RTE_APP_TEST_RESOURCE_TAR) - Bump to librte_eal version :: 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 Ben Walker (1): pci: Pass rte_pci_addr to functions instead of separate args Jan Blunck (1): eal: define container_of macro Shreyansh Jain (11): eal/bus: introduce bus abstraction test: add basic bus infrastructure tests eal/bus: add scan and match support eal/bus: add support for inserting a device on a bus eal: integrate bus scan and probe with EAL pci: replace probe and remove handlers with rte_driver eal: enable probe and remove 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 eal/pci: remove PCI probe and init calls 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 | 12 +- drivers/net/bnxt/bnxt_ethdev.c | 6 +- drivers/net/cxgbe/cxgbe_ethdev.c | 6 +- drivers/net/e1000/em_ethdev.c | 6 +- drivers/net/e1000/igb_ethdev.c | 12 +- drivers/net/ena/ena_ethdev.c | 6 +- drivers/net/enic/enic_ethdev.c | 6 +- drivers/net/fm10k/fm10k_ethdev.c | 6 +- drivers/net/i40e/i40e_ethdev.c | 6 +- drivers/net/i40e/i40e_ethdev_vf.c | 6 +- drivers/net/ixgbe/ixgbe_ethdev.c | 12 +- drivers/net/mlx4/mlx4.c | 6 +- drivers/net/mlx5/mlx5.c | 4 +- drivers/net/nfp/nfp_net.c | 6 +- drivers/net/qede/qede_ethdev.c | 16 +- drivers/net/szedata2/rte_eth_szedata2.c | 6 +- drivers/net/virtio/virtio_ethdev.c | 4 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 6 +- lib/librte_eal/bsdapp/eal/eal.c | 12 +- lib/librte_eal/bsdapp/eal/eal_pci.c | 53 +- lib/librte_eal/bsdapp/eal/rte_eal_version.map | 18 +- lib/librte_eal/common/Makefile | 2 +- lib/librte_eal/common/eal_common_bus.c | 285 ++++++++++ lib/librte_eal/common/eal_common_pci.c | 335 +++++++----- lib/librte_eal/common/eal_private.h | 14 +- lib/librte_eal/common/include/rte_bus.h | 262 +++++++++ lib/librte_eal/common/include/rte_common.h | 20 + lib/librte_eal/common/include/rte_dev.h | 14 + lib/librte_eal/common/include/rte_pci.h | 32 +- lib/librte_eal/linuxapp/eal/Makefile | 1 + lib/librte_eal/linuxapp/eal/eal.c | 12 +- lib/librte_eal/linuxapp/eal/eal_pci.c | 82 +-- lib/librte_eal/linuxapp/eal/rte_eal_version.map | 18 +- lib/librte_ether/rte_ethdev.c | 16 +- lib/librte_ether/rte_ethdev.h | 6 +- 39 files changed, 1717 insertions(+), 291 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