From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <shreyansh.jain@nxp.com>
Received: from NAM02-BL2-obe.outbound.protection.outlook.com
 (mail-bl2nam02on0068.outbound.protection.outlook.com [104.47.38.68])
 by dpdk.org (Postfix) with ESMTP id 76D03377C
 for <dev@dpdk.org>; Fri, 16 Dec 2016 14:08:19 +0100 (CET)
Received: from CY4PR03CA0017.namprd03.prod.outlook.com (10.168.162.27) by
 BN6PR03MB2468.namprd03.prod.outlook.com (10.168.223.22) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id
 15.1.789.14; Fri, 16 Dec 2016 13:08:18 +0000
Received: from BN1AFFO11FD010.protection.gbl (2a01:111:f400:7c10::192) by
 CY4PR03CA0017.outlook.office365.com (2603:10b6:903:33::27) 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; Fri, 16 Dec 2016 13:08:17 +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
 BN1AFFO11FD010.mail.protection.outlook.com (10.58.52.70) with Microsoft SMTP
 Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.771.7
 via Frontend Transport; Fri, 16 Dec 2016 13:08:16 +0000
X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:;
 SizeAsReceived:743; 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 uBGD8BtB028345;
 Fri, 16 Dec 2016 06:08:12 -0700
From: Shreyansh Jain <shreyansh.jain@nxp.com>
To: <dev@dpdk.org>, <david.marchand@6wind.com>
CC: <thomas.monjalon@6wind.com>, <ferruh.yigit@intel.com>,
 <jianbo.liu@linaro.org>, Shreyansh Jain <shreyansh.jain@nxp.com>
Date: Fri, 16 Dec 2016 18:40:41 +0530
Message-ID: <1481893853-31790-1-git-send-email-shreyansh.jain@nxp.com>
X-Mailer: git-send-email 2.7.4
In-Reply-To: <1481636232-2300-1-git-send-email-shreyansh.jain@nxp.com>
References: <1481636232-2300-1-git-send-email-shreyansh.jain@nxp.com>
X-IncomingHeaderCount: 10
X-EOPAttributedMessage: 0
X-Matching-Connectors: 131263672967710825;
 (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)(7916002)(336005)(39840400002)(39380400002)(39860400002)(39410400002)(39850400002)(39400400002)(39450400003)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(47776003)(8666005)(85426001)(356003)(50226002)(626004)(97736004)(92566002)(33646002)(48376002)(2906002)(8936002)(230783001)(4326007)(305945005)(50466002)(5001770100001)(86362001)(5890100001)(81166006)(8676002)(106466001)(77096006)(38730400001)(105606002)(81156014)(5003940100001)(104016004)(2950100002)(6666003)(76176999)(36756003)(50986999)(5660300001)(68736007)(15395725005)(189998001)(7059030)(21314002)(2101003);
 DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2468; H:tx30smr01.am.freescale.net;
 FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; 
X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD010;
 1:De8LhVvbao7llgfR2eABkXibefJyIMHLTuHa+xVLburs4lXtVX/F6HVP0QeH3HcdBBXVcCBwBR52qrkYtn21/dCGiVwsOQPi2l9/mwNjDlALszilViX4o/SSIKwnMyUKdImJwoUsRn3V4l4WfnP/tF8Tl9Kbs4PI6q4g8S4jyyr8QX3XSVL5OQ0iHHlRd/W1NkzJKqkJmWwOAa1gGstSlh9D8ix6D0F9CKiyogQA2P7EEhL8yYNhKTKqcxmNMRKcHuqwxuPtFRnSuHBIGj1eUuE903ht7SoUf2cUNqmOVrDvtSuQvDh7MSsg6k4cPI2HswDT1BJzk84b+ggOHwxoGhjDGdkJGsjpbiFbAzx9AQBh6cgTktsItyfTHidzR0VZJZ0KPAlfPuHbHLJaWYNOgndPMcMUTCGN9Zcea6iEFxulpx6rvGf4Zs1E033UXkB/6Z0w8Z+bXlmreD3ATthfWoADyfYTt/0BfTs0spYcrNmgXF7JF5ySOn9o3kErxB8OsCYHvDhsVNH/La7ftw50/gmszXi2514Efs2Cqd1RTyFqCaHaArfZ+wsnO6I4AqKqC156qsaRzv3ojBNr6XnCeBZ3LMvB1f74efJ5+yf+os2NJJAqTFCN2l1Fab8y8Q4RBYUtKG6IEeE8mESQgbVQi4jwH0TmBbQ0w8gHP6InwLLktBXDu6C3sIyvXOvx+TDa1BVI55bguVypuPye/jzowhkymgt5RonpPAF7jNThq8pTej4MNSIcX4eDRXYlXC9v/msAWowXbguorO4+4sUHJA==
MIME-Version: 1.0
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: bb93ccd4-4d7a-4e50-e708-08d425b4999b
X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN6PR03MB2468;
X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2468;
 3:JL1tsziD7jSYLuXClivH3yJYGSAXdlVa7LGrtiGjRYGO2IwIiP70IhUT5D/FAbu6cubscmAEPodc4CGYgpcDul5qjQaj1lH/RSo6k529eF2Lxk36gag1rd3xf6G5+E1xJG1rKG04MgRVQomlW3b6itYuS9KdA0uwXblKWaMi0Zd+sBaOJ/Yjtdch7idw5N63p9ivKfAl7WSUMtpd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prod.outlook.com>
X-Exchange-Antispam-Report-Test: UriScan:;
X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0;
 RULEID:(6095060)(601004)(2401047)(13018025)(13015025)(13023025)(13017025)(13024025)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6096035)(20161123556025)(20161123563025)(20161123561025)(20161123565025)(20161123559025);
 SRVR:BN6PR03MB2468; BCL:0; PCL:0; RULEID:(400006); SRVR:BN6PR03MB2468; 
X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2468;
 4:YsO4hu3mV1RRDpuPw6j6WWfTHSVI0r5zJb/Kz+NTlrNq13NQF0/pFgBlpGC3ARfc5CDE1DIHd7KbhdFvbaPUA5M8fznAunlj+FDiT35N0cUYD+g0M4f42OTyaYGXuSk6ZabB925l4Egid5lADEHPLOsCM9lx5b8oQ4ZCtqKBTj810N9J1NrJO1s4jZgAMwFCyLSKLSLbRO8NWbC0wDqanH0Kkwdn557R5bSis512X4Vm+/ZhveOR0EYndX5eQz+0XdcBUbKihjT9V722IVVHCgOR7cnAVFL3DtdZhSWYNK9lBZCnqwbRtDDr325VfpX7Gnvt0tjs1fYr8yPmN3T2z5OVUiKrok2DsXydXLAfUYLJsPS/Rbvx/e4pXmBCKSi48kUu0kyB0s6OSUiFJDXRHSRoeH23cqbbY3NFx2z9F+oq9o8Zng8MNJ8OV2TeUToX/T/LzE6TyYjykEQjlQcBfORJza7JS5wYNBRBxhUDazhKEbbOqWRSI4bDs3gYnKPoHlWsg/HQ4jMSOdZKddtBniMyWs3KLjGXdyFVOCRAn9fzbO97er6yA5MQ7Aih7PhELyG5HjHA8yrkSAvQHckuuw2SpAdNkH2bLyISJKiHHhZmkrtZ8UQK9BXbqePvmu30yZNUwByRpFNTn3YObnoE/5cPY4WhVsi6cWPhbr8oxyrnFa9O89vp7tAAw7xESIjvUMt4Beh6U6Cm5V+920S/qQ==
X-Forefront-PRVS: 01583E185C
X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; B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zUWikSEqLBuA4RQNnQwkMBzwUWGnvIaJZwfVb3pXaheUOBJmnl68w/FVPbX+Vw4SG+im+bI2MYq0nrAezHk0XE/Smyi4p5X;
 5:eHX8bCgCqzgx995g3VIRz+53uyBEcrHqQbaozsUQARhAnyU9MluEiior2CMdI2RhvhPk7MUv2NQCyvWYSHf0VctVamK7+DYQK2dg/PUrQHPpSjUZBeZgrdZKfUWhhTLAhmLmLrD5plrbniCUkN9vwxxNDO9agpjkCQB+YmNLqvF6XvRaxuNHUWcZ6Eym/m69;
 24:GHBogPbiphIAJ8WCEJpOY6RaaAOB/FU0YTLqRE1zMf5n/AQzF2VPe0/ThwSQ81iRFVzQ0tAm8N0K1fz/PVvtTEHK4HLHMcUAGfO2RHM3cWs=
SpamDiagnosticOutput: 1:99
SpamDiagnosticMetadata: NSPM
X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2468;
 7:CtozFTaA5xKZE8Rq95jwYsRAa68Z4lsXkY75AGi72h2Lrb1bVgBGs7ZNOkHorOWWgpOvWsI8sWFD+stib40M63N0fF0KLrygd2w9kNjjPo5qQnAk+vQiZTHOXiCrjtVw9UVcD7T96BLTl9aA8Ui4dBmFvaZxu5hzZTtmhuSHc3T8sXhWzYBC89mfxOBlCcRDyS24ZpTUnpgYGUsQP4F7Bt7bojYacKyvJ/+Vg1HfcZqZ67ACd6Gt0hSYI9KOB+c3BhhulUyZs54uyllA5M7s6a8AWyL/adtLj+fIyCitQEPydQMmVjV8YgN9clZchzKvWU9p0KmNo41H7ghoFjtNu4iPiKdlD+8dW1lpZ40/9k8w/QIrT+Ie+xmfUMlKLYWhyp84ehiVu0850XjMJwXl1GUFqX7hZUhbDCEb36Yr2KSukn88u/gA6GZbsFrV9l3sjFaGouRGz2K/cpvuJ+gHLw==
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2016 13:08:16.2250 (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: BN6PR03MB2468
Subject: [dpdk-dev] [PATCH v3 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 <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <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>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 13:08:19 -0000

Link to v1: [10]
Link to v2: [11]

:: 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,  |    | <probably,     |    | ....          |
            | other driver   |    |  nothing>      |    +---------------+
            | 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). Also, fix PCI test framework to reflect the bus
           integration.
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. 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

3. Though the implementation for bus is common for Linux and BSD, the PCI
   bus implementation has been done/tested only for Linux.

4. There was a suggestion from Jan Blunk about a helper iterator within the
   rte_bus. That is still pending.

5. 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 ::

 - 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
[12] http://dpdk.org/ml/archives/dev/2016-December/052092.html

:: Version Changes ::
v3:
 - rebase over master (c431384c8f)
 - revert patch 0001 changes for checkpatch (container_of macro)
 - qat/rte_qat_cryptodev update for rte_driver->probe
 - test_pci update for using a test_pci_bus for verification
 - some bug fixes based on internal testing.
 -- rte_eal_dev_attach not handling devargs
 -- blacklisting not working

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 and PCI test framework
  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                             | 154 ++++--
 drivers/crypto/qat/rte_qat_cryptodev.c          |   4 +
 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          | 286 ++++++++++
 lib/librte_eal/common/eal_common_pci.c          | 344 +++++++-----
 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      |  20 +
 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           |  84 ++-
 lib/librte_eal/linuxapp/eal/rte_eal_version.map |  22 +-
 40 files changed, 1840 insertions(+), 299 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