From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0049.outbound.protection.outlook.com [104.47.38.49]) by dpdk.org (Postfix) with ESMTP id C02F7379B for ; Fri, 16 Sep 2016 06:30:00 +0200 (CEST) Received: from BN3PR0301CA0009.namprd03.prod.outlook.com (10.160.180.147) by SN1PR0301MB2016.namprd03.prod.outlook.com (10.163.226.26) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.629.8; Fri, 16 Sep 2016 04:29:59 +0000 Received: from BY2FFO11OLC001.protection.gbl (2a01:111:f400:7c0c::160) by BN3PR0301CA0009.outlook.office365.com (2a01:111:e400:4000::19) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.619.10 via Frontend Transport; Fri, 16 Sep 2016 04:29:59 +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 BY2FFO11OLC001.mail.protection.outlook.com (10.1.15.185) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.619.6 via Frontend Transport; Fri, 16 Sep 2016 04:29:58 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u8G4Trfg029256; Thu, 15 Sep 2016 21:29:54 -0700 From: Shreyansh Jain To: CC: , David Marchand , , Thomas Monjalon , Shreyansh Jain Date: Fri, 16 Sep 2016 09:59:35 +0530 Message-ID: <1474000200-16705-1-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131184737987330604; (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)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(87936001)(92566002)(229853001)(50226002)(104016004)(47776003)(5890100001)(2906002)(2950100001)(105606002)(33646002)(5003940100001)(85426001)(5660300001)(68736007)(106466001)(4326007)(626004)(2351001)(110136003)(8676002)(81156014)(81166006)(76176999)(50986999)(86362001)(575784001)(7846002)(97736004)(586003)(305945005)(50466002)(48376002)(77096005)(19580395003)(15395725005)(36756003)(189998001)(356003)(8666005)(8936002)(11100500001)(15975445007)(7059030)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0301MB2016; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC001; 1:MhvtO3TPi9mUghD+Zj8ieJH1NLKj6GOLiPrerFLBuBp8IfscZchk5PjPFvpTTCAGvh1ALAnqiD+7O1m3zm3ie255sGUgyx8hBvPpzwB0ORwUm9IsFoAFa0vbqHbcvBnrQ06n/Z0I+DffKcEGbjhf2Cxde2M0ZZPEbSVkF8Mb4/dT/xOXPSkDz1SHvvPzykA5Cc/BUqvFe5HQylh60dFjyXk8bY/ihx7crqDxFXRyymZ4Sy7ZafIe6c50E26fbtZae7qbNL5NvOPh4DLorBWsED+OOWe5CFRR/Njpul8veLoK3Au+upN87AvqaTky/LAxYr7K5qKF+i6BuELwjLZsqSdhS4z3CZbU/ooGFfuK1VPjL9hAZEUgZ7BHe8wpk0K9t1JJ0ZdKFi81kxuijI4Ja5W47bR5253rw5LQ2aesnQxF8ycCSOmh5m8IpX8HLYpJOdBrFr+924jCR+pQTPuWC/457d/LgSBobnFSE7dJ0xP+tt/GmBXKetG9G7QAMu3WB6WPhEf7O0unhyCl5hvn8Ikwuoo//pURecaAJPutvvZ0cNy47LxY7JKTq9CSm/8IKZxEmTvi2P1/bVhnA3EAaLfohyUY9doKZCycM79I0mj61+Kq/uOxt+N4J77JC22tvCvBtb9ulWGJu0kf0oojkhFNUMxPaTz0IyKKNBV3vTRvBEbj3zPKwpTzrUQahu6jR0/D2OMrE8QldfHC+QLrTr7sXPhZuq+XszBVHwlWz3s= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 6e528095-5476-4355-022c-08d3ddea1e27 X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB2016; 2:qOSHw213yJxARyPyA0f02KtCyAvrvujL3UyK0oKJ1g4+wPIj4eSA+CWo7eknOQuIhIM4BMNUN0yatrBg+nCJB6GhbATZHp0/EWHDCI3ews6QWR0LvWHscj/ZiH/ma0VHmZGW4xshtYQnwN5B95iU4TR9iYWO6QCPJhiQMZvIP0jUFRjeo5yEeramo5aDAsob; 3:Po1Qxn/Fp4BE+4hYWzdv1+UbcJitckJ98aoABj+4dzdTx/kmRq+8+oD5yGDKlR5HDAg1EdgusIqzYgHhiZ35ptMCVde/q9RA9aOSL7jRX2EOP/gHB/m80KDrJ1mCGab1xVjc7L7DMcfFeuZZ/P9FdtuoX55oQBPhQ+nJVCphgSpjHowDldfUALJBlaa435v6dYpqzPXCVBmVOWNpHyZRB7Pk++xoKxj0rxAmmwD8ypw= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB2016; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB2016; 25:3MZPxEHepXnRYdriu+j7ecoDOf3/bjA6it7nDlIBaXsB+AUO2MSLLWcl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KvyCnvDPtVT66AIywA=; 4:E9yc9qezqSe6SNqe5r5HtLWI2AK3kQoosnFLUvsP6LM0JE4lcz/Ow1sPZUu8aSYodnXhFtbr+81sGG8dImHtJLf/2AUq2hAP4csUmDNCfETY4k9tY1Amg6aLRqpScsw7RDCCrkqQxaZPdhtp0UJwMemZxbbhxzuyslu3VzTG9hZBjNdj4HCmrMPp1WY/YT3dEuUjh3Erznd3hHjwkd4qRkKTW0qfYO+/9+/TOfJFNEf/CkUck7CR+KI2UivQ8FLa8skldL71TQA89RA8dk0NOeRLSjK5XoF6MBUbXGVg64+d62eaK5AfnD8PU4pSnaIiWxW/lWU4laSqSP2taxfEj/S3K62P/1LLBwh0OhpezYl138Z9+y4XCUQoK0+s5B26cHa3zS1PgJEv6vUkUiFXyIXi27Ka3wGmnlaugIMdh1EXDrZi5o45mGlGNkFsBZ5mBec7C/XfmaOIQfZXYg1Ks/BEYDZBAPID26eGAUhAxx29jH2eHOrGAJX9XKX8qevHQ9OFow/0gQTeTMgxRGCkaMcJs3opO3KUWCEEy1YVOLE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(13018025)(13017025)(13015025)(13024025)(13023025)(3002001)(10201501046)(6055026); SRVR:SN1PR0301MB2016; BCL:0; PCL:0; RULEID:(400006); SRVR:SN1PR0301MB2016; X-Forefront-PRVS: 0067A8BA2A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0301MB2016; 23:vGuIXFMTA0iEDaY4Lq4MorQ5oDilZcGfHlzuyRH?= =?us-ascii?Q?7QitNR3xeOS8+R3YbiVArRdyA29EgnKQl0sOYof/p99xzE+GSm/wtlrzVduo?= =?us-ascii?Q?B0TmnHx4iW2b7fuITHIMe1VleKnOssbmFuZ70kLivNXbFOn4/fnjPuAyrLmE?= =?us-ascii?Q?vZBt76Zij0vPo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Cko3rPo0TIzWjy7COCdZKubOVVxbPxIvKgyPKOOZtdqksKwNttg2DZpIQIB9PdnfeZVl2wNntAr/Cw9QIHsEgql2v9k/r0nP5cO6h6+3r35 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2016 04:29:58.5458 (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: SN1PR0301MB2016 Subject: [dpdk-dev] [PATCH v10 00/25] Introducing rte_driver/rte_device generalization X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 04:30:01 -0000 Based on master (58efd680d5e) Background: =========== It includes two different patch-sets floated on ML earlier: * Original patch series is from David Marchand [1], [2]. `- This focused mainly on PCI (PDEV) part `- v7 of this was posted by me [8] in August/2016 * Patch series [4] from Jan Viktorin `- This focused on VDEV and rte_device integration Introduction: ============= This patch series introduces a generic device model, moving away from PCI centric code layout. Key change is to introduce rte_driver/rte_device structures at the top level which are inherited by rte_XXX_driver/rte_XXX_device - where XXX belongs to {pci, vdev, soc (in future),...}. Key motivation for this series is to move away from PCI centric design of EAL to a more hierarchical device model - pivoted around a generic driver and device. Each specific driver and device can inherit the common properties of the generic set and build upon it through driver/device specific functions. Earlier, the EAL device initialization model was: (Refer: [3]) -- Constructor: |- PMD_DRIVER_REGISTER(rte_driver) `- insert into dev_driver_list, rte_driver object rte_eal_init(): |- rte_eal_pci_init() | `- scan and fill pci_device_list from sysfs | |- rte_eal_dev_init() | `- For each rte_driver in dev_driver_list | `- call the rte_driver->init() function | |- PMDs designed to call rte_eth_driver_register(eth_driver) | |- eth_driver have rte_pci_driver embedded in them | `- rte_eth_driver_register installs the | rte_pci_driver->devinit/devuninit callbacks. | |- rte_eal_pci_probe() | |- For each device detected, dev_driver_list is parsed and matching is | | done. | |- For each matching device, the rte_pci_driver->devinit() is called. | |- Default map is to rte_eth_dev_init() which in turn creates a | | new ethernet device (eth_dev) | | `- eth_drv->eth_dev_init() is called which is implemented by `--| individual PMD drivers. -- The structure of driver looks something like: +------------+ ._____. | rte_driver <-----| PMD |___ | .init | `-----` \ +----.-------+ | \ `-. | What PMD actually is \ | | +----------v----+ | | eth_driver | | | .eth_dev_init | | +----.----------+ | `-. | \ | +------------v---+ | rte_pci_driver | | .pci_devinit | +----------------+ and all devices are part of a following linked lists: - dev_driver_list for all rte_drivers - pci_device_list for all devices, whether PCI or VDEV >>From the above: * a PMD initializes a rte_driver, eth_driver even though actually it is a pci_driver * initialization routines are passed from rte_driver->pci_driver->eth_driver even though they should ideally be rte_eal_init()->rte_pci_driver() * For a single driver/device type model, this is not necessarily a functional issue - but more of a design language. * But, when number of driver/device type increase, this would create problem in how driver<=>device links are represented. Proposed Architecture: ====================== A nice representation has already been created by David in [3]. Copying that here: +------------------+ +-------------------------------+ | | | | | rte_pci_device | | rte_pci_driver | | | | | +-------------+ | +--------------+ | | +---------------------------+ | | | | | | | | | | | | rte_eth_dev +---> rte_device +-----> rte_driver | | | | | | char name[] | | | | char name[] | | +-------------+ | | | | | | int init(rte_device *) | | | +--------------+ | | | int uninit(rte_device *) | | | | | | | | +------------------+ | +---------------------------+ | | | +-------------------------------+ - for ethdev on top of vdev devices +------------------+ +-------------------------------+ | | | | | drv specific | | rte_vdev_driver | | | | | +-------------+ | +--------------+ | | +---------------------------+ | | | | | | | | | | | | rte_eth_dev +---> rte_device +-----> rte_driver | | | | | | char name[] | | | | char name[] | | +-------------+ | | | | | | int init(rte_device *) | | | +--------------+ | | | int uninit(rte_device *) | | | | | | | | +------------------+ | +---------------------------+ | | | | int priv_size | | | +-------------------------------+ Representing from above, it would be: +--------------+ | rte_driver | | name | | | +------^-------+ pci_driver_list | / vdev_driver_list `---. <> / / |\____________/_______ / | / \ / +-----------/-----+ +--------/---------+ | rte_pci_driver | | rte_vdev_driver | | pci_probe() | | vdev_devinit() | | pci_remove() | | vdev_devuninit()| | | | | +-----------------+ +------------------+ +--------------+ | rte_device | | name | | | +------^-------+ pci_device_list | / xxx_device_list `---. <> / / |\____________/________ / | / \ / +-----------/-----+ +--------/---------+ | rte_pci_device | | rte_xxx_device | | | | | | | | | | | | | +-----------------+ +------------------+ * Each driver type has its own structure which derives from the generic rte_driver structure. \- Each driver type maintains its own list, at the same time, rte_driver list also exists - so that *all* drivers can be looped on, if required. * Each device, associated with one or more drivers, has its own type derived from rte_device \- Each device _may_ maintain its own list (for example, in current implementation, vdev is not maintaining it). ==Introducing a new device/driver type implies== - creating their own rte_.h file which contains the device/driver definitions. - defining the DRIVER_REGISTER_XXX helpers ==Hotplugging Support== - devices should be able to support attach/detach operations. - Earlier these functions were part of ethdev. They have been moved to eal to be more generic. This patch is part of larger aim to: --------------------+ eth_driver (PMD) |-------------> rte_driver crypto_driver (PMD) | ^ | | --------------------+ | / +-----------------------/+ | rte_pci_driver | | rte_vdev_driver | | rte_soc_driver | | rte_xxx_driver | Where PMD devices (rte_eth_dev, rte_cryptodev_dev) are connected to their drivers rather than explicitly inheriting type specific driver (PCI, etc). About the Patches: ================== There are a large number of patches for this - primarily because the changes are quite varied and keeping them logically separate yet compilable is important. Most of the patches are small and those which are large touch the drivers (PMDs) to accommodate the structure changes: - Patches 0001~0003 are for introducing the container_of function (so that rte_device can be obtained from rte_pci_device, for example), and removing unused code. - Patch 0004 converts the PCI devinit/devuninit method names to probe/ remove and correspondingly updates all drivers where impact it. VDEV based init/uninit have not been modified. - Patches 0005~0007 just perform the ground work for enabling change from rte_driver/eth_driver based PMDs to rte_xxx_driver based PMDs - In patch 0008, all the pdev PMDs are changed to support rte_pci_driver ( including cryptodev, which is eventually generalized with PCI) - Patch 0009~0010 merge the crypto and pci functions for registration and naming. - Patches 0011~0014 deal with hotplugging - hotplug no more invokes scan of complete bus and has been generalized into EAl from ethdev. - Patches 0015 introduces vdev init/uninit into separate C units and enables its compilation. Patch 0016~0017 build on it and remove the remaining legacy support for vdev/pdev distinctions. - Patches 0018~0022 enable the vdev drivers to register using the DRIVER_REGISTER_* operations, and remove their rte_driver->init() - Patch 0023 enables the rte_driver registration into a common driver linked list. - Patches 0024~0025 introduce the rte_device, a generalization of rte_xxx_device, and associated operation of creating rte_device linked list. It also enables the drivers to use rte_device.name/numa_node members rather than rte_xxx_device specific members. Future Work/Pending: =================== - Presently eth_driver, rte_eth_dev are not aligned to the rte_driver/ rte_device model. eth_driver still is a PCI specific entity. This has been highlighted by comments from Ferruh in [9]. - Some variables, like drv_name (as highlighted by Ferruh), are getting duplicated across rte_xxx_driver/device and rte_driver/device. References: =========== [1] http://dpdk.org/ml/archives/dev/2016-January/032387.html [2] http://dpdk.org/ml/archives/dev/2016-April/037686.html [3] http://dpdk.org/ml/archives/dev/2016-January/031390.html [4] http://dpdk.org/ml/archives/dev/2016-July/043645.html [5] http://dpdk.org/ml/archives/dev/2016-June/042439.html [6] http://dpdk.org/ml/archives/dev/2016-June/042444.html [7] http://dpdk.org/ml/archives/dev/2016-July/043172.html [8] http://dpdk.org/ml/archives/dev/2016-August/044941.html [9] http://dpdk.org/ml/archives/dev/2016-August/045947.html Following are Some Review comments: [R1] http://dpdk.org/ml/archives/dev/2016-September/046548.html [R2] http://dpdk.org/ml/archives/dev/2016-September/046549.html [R3] http://dpdk.org/ml/archives/dev/2016-September/046550.html [R4] http://dpdk.org/ml/archives/dev/2016-September/046551.html [R5] http://dpdk.org/ml/archives/dev/2016-September/046399.html [R6] http://dpdk.org/ml/archives/dev/2016-September/046552.html Changes since v9: - Rebased over master (58efd680d5e) - Fix issues reported by checkpatch and check-git-log, including changing headline of the patches to adhere to these scripts. - Corrected the patch author field - Renamed devinit/devuninit for pci_driver to probe/remove as per suggestion from David - Fix for PMD Info gen tool using patch from David - Fixed review comments [R1], some part of [R2], [R3] using patch from David, [R4], [R5] and some inputs from [R6]. Changes since v8: - Some review comments from Ferruh Yigit & Reshma Pattan have been fixed. = Though changes in mlx4/mlx5/szedata2 have been done, I am still unable to verify those in absence of a proper environment at my end. = Comment from Ferruh for eth_driver, drv_name are not fixed yet. - Added a 'Future work' section in Covering letter Changes since v7: - Rebase over master (e22856313fff2) - Merge the patch series by David [1][2] and Jan [4] into a single set hereafter, PCI and VDEV, both are re-factored for rte_device/driver model Changes since v6: - rebase over 16.07 (b0a1419) - DRIVER_REGISTER_PCI macro is now passed pci_drv rather than drv - review comments regarding missing information in log messages - new API additions to 16.11 map objects - review comment in [5] and [7] are not included in this series. Changes since v5: - Rebase over master (11c5e45d8) - Rename RTE_EAL_PCI_REGISTER helper macro to DRIVER_REGISTER_PCI to be in sync with DRIVER_REGISTER_PCI_TABLE. [Probably, in future, both can be merged] - Modifications to bnxt and thunderx driver PMD registration files for using the simplified PCI device registration helper macro Changes since v4: - Fix compilation issue after rebase on HEAD (913154e) in previous series - Retain rte_eth_dev_get_port_by_name and rte_eth_dev_get_name_by_port which were removed by previous patchset. These are being used by pdump library Changes since v3: - rebase over HEAD (913154e) - Update arguments to RTE_EAL_PCI_REGISTER macro as per Jan's suggestion - modify qede driver to use RTE_EAL_PCI_REGISTER - Argument check in hotplug functions Changes since v2: - rebase over HEAD (d76c193) - Move SYSFS_PCI_DRIVERS macro to rte_pci.h to avoid compilation issue Changes since v1: - rebased on HEAD, new drivers should be okay - patches have been split into smaller pieces - RTE_INIT macro has been added, but in the end, I am not sure it is useful - device type has been removed from ethdev, as it was used only by hotplug - getting rid of pmd type in eal patch (patch 5 of initial series) has been dropped for now, we can do this once vdev drivers have been converted David Marchand (13): eal: remove duplicate function declaration pci: no need for dynamic tailq init crypto: no need for a crypto pmd type drivers: align PCI driver definitions eal: introduce PCI device init macros driver: init/uninit common wrappers for PCI drivers drivers: convert all phy drivers as PCI drivers drivers: remove driver register callbacks for crypto/net eal/pci: helpers for device name parsing/update ethdev: do not scan all PCI devices on attach eal: add hotplug operations for PCI and VDEV ethdev: convert to EAL hotplug ethdev: get rid of device type Jan Viktorin (11): eal: define container macro eal: extract vdev infra eal: remove PDEV/VDEV unused code drivers: convert VDRV to use RTE VDEV Driver eal: remove unused PMD types eal: include dev headers in place of PCI headers eal: rename and move RTE PCI Resources eal/pci: inherit RTE driver in PCI driver eal: register EAL drivers explicitly eal: introduce generalized RTE device eal/pci: create RTE device list and fallback on its members Shreyansh Jain (1): eal/pci: replace PCI devinit/devuninit with probe/remove app/test/test_pci.c | 18 +- app/test/virtual_pmd.c | 8 +- drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 7 +- drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 7 +- drivers/crypto/kasumi/rte_kasumi_pmd.c | 7 +- drivers/crypto/null/null_crypto_pmd.c | 7 +- drivers/crypto/qat/qat_qp.c | 2 +- drivers/crypto/qat/rte_qat_cryptodev.c | 18 +- drivers/crypto/snow3g/rte_snow3g_pmd.c | 7 +- drivers/net/af_packet/rte_eth_af_packet.c | 11 +- drivers/net/bnx2x/bnx2x_ethdev.c | 36 +-- drivers/net/bnx2x/bnx2x_rxtx.c | 3 +- drivers/net/bnxt/bnxt_ethdev.c | 17 +- drivers/net/bonding/rte_eth_bond_api.c | 2 +- drivers/net/bonding/rte_eth_bond_pmd.c | 9 +- drivers/net/cxgbe/cxgbe_ethdev.c | 25 +-- drivers/net/cxgbe/cxgbe_main.c | 2 +- drivers/net/cxgbe/sge.c | 7 +- drivers/net/e1000/em_ethdev.c | 17 +- drivers/net/e1000/igb_ethdev.c | 41 +--- drivers/net/ena/ena_ethdev.c | 20 +- drivers/net/enic/enic_ethdev.c | 24 +- drivers/net/fm10k/fm10k_ethdev.c | 30 +-- drivers/net/i40e/i40e_ethdev.c | 31 +-- drivers/net/i40e/i40e_ethdev_vf.c | 26 +-- drivers/net/i40e/i40e_fdir.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 48 +--- drivers/net/mlx4/mlx4.c | 26 +-- drivers/net/mlx5/mlx5.c | 27 +-- drivers/net/mpipe/mpipe_tilegx.c | 18 +- drivers/net/nfp/nfp_net.c | 28 +-- drivers/net/null/rte_eth_null.c | 11 +- drivers/net/pcap/rte_eth_pcap.c | 11 +- drivers/net/qede/qede_ethdev.c | 42 +--- drivers/net/ring/rte_eth_ring.c | 11 +- drivers/net/szedata2/rte_eth_szedata2.c | 29 +-- drivers/net/thunderx/nicvf_ethdev.c | 21 +- drivers/net/vhost/rte_eth_vhost.c | 11 +- drivers/net/virtio/virtio_ethdev.c | 29 +-- drivers/net/virtio/virtio_pci.c | 5 +- drivers/net/virtio/virtio_user_ethdev.c | 10 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 27 +-- drivers/net/vmxnet3/vmxnet3_rxtx.c | 2 +- drivers/net/xenvirt/rte_eth_xenvirt.c | 11 +- examples/ip_pipeline/init.c | 22 -- lib/librte_cryptodev/rte_cryptodev.c | 71 ++---- lib/librte_cryptodev/rte_cryptodev.h | 2 - lib/librte_cryptodev/rte_cryptodev_pmd.h | 45 ++-- lib/librte_cryptodev/rte_cryptodev_version.map | 8 +- lib/librte_eal/bsdapp/eal/Makefile | 1 + lib/librte_eal/bsdapp/eal/eal_pci.c | 54 ++++- lib/librte_eal/bsdapp/eal/rte_eal_version.map | 10 + lib/librte_eal/common/Makefile | 2 +- lib/librte_eal/common/eal_common_dev.c | 95 ++++---- lib/librte_eal/common/eal_common_pci.c | 51 +++-- lib/librte_eal/common/eal_common_vdev.c | 108 +++++++++ lib/librte_eal/common/eal_private.h | 20 +- lib/librte_eal/common/include/rte_common.h | 21 ++ lib/librte_eal/common/include/rte_dev.h | 77 +++++-- lib/librte_eal/common/include/rte_eal.h | 3 + lib/librte_eal/common/include/rte_pci.h | 62 ++++-- lib/librte_eal/common/include/rte_tailq.h | 4 +- lib/librte_eal/common/include/rte_vdev.h | 97 ++++++++ lib/librte_eal/linuxapp/eal/Makefile | 1 + lib/librte_eal/linuxapp/eal/eal.c | 1 + lib/librte_eal/linuxapp/eal/eal_pci.c | 23 +- lib/librte_eal/linuxapp/eal/rte_eal_version.map | 10 + lib/librte_ether/rte_ethdev.c | 279 +++++------------------- lib/librte_ether/rte_ethdev.h | 40 ++-- lib/librte_ether/rte_ether_version.map | 10 +- mk/internal/rte.compile-pre.mk | 2 +- 71 files changed, 825 insertions(+), 1045 deletions(-) create mode 100644 lib/librte_eal/common/eal_common_vdev.c create mode 100644 lib/librte_eal/common/include/rte_vdev.h -- 2.7.4