From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0049.outbound.protection.outlook.com [104.47.32.49]) by dpdk.org (Postfix) with ESMTP id 946512BB2 for ; Mon, 26 Dec 2016 13:47:16 +0100 (CET) Received: from BN3PR03CA0093.namprd03.prod.outlook.com (10.174.66.11) by BY2PR0301MB0743.namprd03.prod.outlook.com (10.160.63.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.11; Mon, 26 Dec 2016 12:47:15 +0000 Received: from BN1BFFO11FD038.protection.gbl (2a01:111:f400:7c10::1:198) by BN3PR03CA0093.outlook.office365.com (2603:10b6:400:4::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.11 via Frontend Transport; Mon, 26 Dec 2016 12:47:14 +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 BN1BFFO11FD038.mail.protection.outlook.com (10.58.144.101) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.789.10 via Frontend Transport; Mon, 26 Dec 2016 12:47:13 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id uBQCl90I011201; Mon, 26 Dec 2016 05:47:10 -0700 From: Shreyansh Jain To: CC: , , Shreyansh Jain Date: Mon, 26 Dec 2016 18:20:32 +0530 Message-ID: <1482756644-13726-1-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1481893853-31790-1-git-send-email-shreyansh.jain@nxp.com> References: <1481893853-31790-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131272300340260940; (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)(336005)(7916002)(39860400002)(39450400003)(39850400002)(39410400002)(39840400002)(39380400002)(39400400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(356003)(97736004)(92566002)(2906002)(5660300001)(626004)(85426001)(305945005)(230783001)(68736007)(47776003)(104016004)(38730400001)(48376002)(50466002)(69596002)(86362001)(189998001)(77096006)(2351001)(8936002)(50226002)(105606002)(110136003)(4326007)(8676002)(81156014)(81166006)(33646002)(5003940100001)(106466001)(15395725005)(2950100002)(5890100001)(6916009)(76176999)(6666003)(36756003)(8656002)(50986999)(7059030)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB0743; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD038; 1:99ibv8wrKP898YI2dy4CW/Hk8xDvg4Oqea+UCUn9jaF0HvZ+FMtRngJc0lbeEF6Nl05MSdmUunRKk0A9hyziQii2EYmHnmK2E6kuxA0PKOjLiWmHC0asSXdxsGE0+hlJwAajiOaMfpU0hMruoQx6UmHMOB5IWPZy+KGkeZR1FQETiKsBx1oZXYPkTcPIOJxV3wwFX5gLqNkSI0nUDA2VA2khfhqOdKumSo9/f+R8K/9ozyrRPuc+kl4zdjJ+Da1LK7C/HH1aDtEVuIsnKUEUjuxGICz7ad50AMMiJ81APQcgIaSEP7IJQcZJUhu3NGKxhAsEelOKUZhz06NCTWxr4QzfiUd5V1nnWJlskQHClfRI2pU3PwEaxBa5bLhyHnvLVLY3M4GFOTXpTcEV3XE08LVnDUCi9CQyVNgHC1hmPqOd1G1HerjJZvoI5hwOnCIasLHgBAS/e0iWbds9MNeClxVJXv+BsXiEh5bOcIrYWVKNMsJLbG6i4zkkhSYdCW7uG+WoYHEjTZMpjpqvdXIpY3ep+sD/C6scZgUHzuKiVQb6GUr7z3h+KsOCQZqIyzogQzzxqffGUnO1G28Wu6/52o18yxDc+4HZb+76fT7qPXQyVzJ5Aie8k/JiGRgXdQ3XQP25ezCD0F1jHmr35V1TdcHmMgmhIQHTN4pT46TfVbo9DwE8vK9NgsU16UOxG/150DeUOkKruoSpz9/pi3r7hKpUd42VAAbCykI8jfndG/s= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 57c1660b-b80e-40fb-253c-08d42d8d5105 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY2PR0301MB0743; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0743; 3:qfIKxmjIbXhcunThcy8cwla9UPEGkVWehIo/TgEc+0LSJZwyXxOVSVMNIXmVpCZrVKW1s9rFt7QeGjR7UN1xPHtaK7R/oxK0u3aMI2xToasWO9G6i3TeMBGpwwd0c7ZlccZSpDhSNgBgsLehYbV16fbKxyATTxHSK8OsVQG6UFWzS9QP/DOsYp4XtXjU4Qo52eeihMlA3MEJMn1qonsg9D5FhWry2tkaQPTjZ2rKxtArQr65unj38/5PXrB2sUtNHGIEfLwLivkdg6AZVXAjXTOXn78oiukxHcYBwpAqqPIy5zLX3gdCHq4H0w94VZn7nqCNwdU4zF8QsiRoq9d9qe6YTE9WqOkq/T8e1PXH++4=; 25:KvP+cKtbTCPXQ3j8f0eYv3/tz7lQIu3DlU5DN44jfl9jnT+hjEiC09RzLM6VDob3+8KVVTn/xDmuXOMZSELv3DZb86+D91GQz5Y4i+tjE7kyKL/ulINAsvoybbjSwckC0XwejHGNOCGS0WEmvaGtfth8L9THGIwfzF8YjLqfytob4XHkVYqc4dEK9J1j5OiN+g8QHT+cg0PvKhmaLXMOIRYl76l1WYPMkYBwOy9zood3pTdU21Ebw8V9+ayG+qfFE8dEn/Iy7lbi0IFSCTiFfQgeGnN5mD8zkkwQrDxnOu+vVnVvwMniVrMscZnze7M3bJuBY0Qho1PpC6WYV15DAWBODDskcAcvM6S79oGKuHaaToCCnvslrYg6qBfmfG0JUtTVqXA3vjLN9kGcGyL/kP2QiGALba2l5fv5pGpEfD367BF7lMaxopTHWpvup66IJbLwp2cF09DZef2jH1JAoQ== X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0743; 31:dlsznWs6jGcQuUs79L4+4UaLjXTpjBzDdjSD1GphRQ1SL0Wj7Pc4p+Vl96HO+4bFP3eB4ZfHadAXMckV4Yun72sM6+PGc+8yIIRjtKkQdkrali+cFnhJRcniovxx0x7wn3GPWB7seBV4GOcFWKPqGKVU+bVhU/dlKLM9+5pjULvHYvKc09RBTs3AGr+YNuR+dvmrqEX7Qkc1KIiNU91mdV1tBqg2cEfc7R2xw7PM1D+n1RoFoNzS03efdZvsZCs3F4wbaxS8iLZGd0P6aSPxbkaOA/V75+HBFFgBBSkBlqc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13017025)(13015025)(13018025)(13023025)(13024025)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6096035)(20161123565025)(20161123563025)(20161123559025)(20161123556025)(20161123561025); SRVR:BY2PR0301MB0743; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB0743; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0743; 4:XBn8bJo8JalCNWDc3dfDdvp2akiI7a9/GRC4jaXDrIbDpA+Ee1EtsiyXvPrTyoneXPqQBxr9FmEKEuqELDM75lyhBhfkyzUx3tQ5bmQ0Z41Dk0+IxNaU4TuEfAr3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etadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0743; 7:FKCp7+6q5n1+hs+N3vG05U/dR7wycEPppOo4312841+pWn8Aq4TOT/MPayRx3C05ngk5mb8Yo9T8y6vncjIxzfg3YW/b6pbgwafOZm9vq0u2q6cjvMLL9P2GYuJMrIfJu7CMGf4NPew6aZ4Ehyll3FZ49k/Ftuhe4pO7WDOLaq/ylqKjxhNgkoGtGndy57xwpD1PbvkZ24BFw6Q4vUScq7SyoLd23cg4/btXD1RXRZhYGmNEtMzCvrcO8ztAlZrLMBV+WFFeOIc2HhJdIKf8Q/S2AKPjBVXrxdXoC7ze+iWnTCUUflI0NDeYgcDMVIndkeFqJK+Q8GitSSAv7Kb2L8O/HtluHum4zwx0kVp99UpNnbFYXgUrnN2fomJV9BK3TL1KYTObQ9I8BwVhU4qy/3h2tqyNfWfE6B6T46eS2XpXTLtWGnF7YAk9MFnj9T0KbqF7eDDvOuFaEX/Vf+x3Rg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2016 12:47:13.6672 (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: BY2PR0301MB0743 Subject: [dpdk-dev] [PATCH v4 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: Mon, 26 Dec 2016 12:47:17 -0000 Link to v1: [10] Link to v2: [11] Link to v3: [13] :: 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 :: Brief about Patch Layout :: 0001~0002: Introducing the basic Bus model and associated test case 0003~0004: Add scan, match and insert support for devices on bus 0005: Add probe and remove for rte_driver 0006: Enable probing of PCI Bus (devices) from EAL 0007: Split the existing PCI probe into match and probe 0008: Make PCI probe/match work on rte_driver/device rather than rte_pci_device/rte_pci_driver 0009: Patch from Ben [8], part of series [2] 0010: 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. 0011: Change PMDs to integrate with PCI bus 0012: Introduce helper macros for iteration over bus resources :: Pending Changes/Caveats :: 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. - some patches to support this have already been merged into master 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. - It also impacts the point (5) 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. 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? 5. 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 [13] http://dpdk.org/ml/archives/dev/2016-December/052381.html :: Version Changes :: v4: - rebase over master (eac901ce) - Fix a bug in test_bus while setup and cleanup - rename rte_eal_get_bus to rte_eal_bus_get - Add helper (iterator) macros for easy bus,device,driver traversal - removed 0001 patch as it is already merged in master - fix missing rte_eal_bus_insert_device symbol in map file 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 Shreyansh Jain (11): 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 eal/bus: add bus iteration macros app/test/Makefile | 2 +- app/test/test.h | 2 + app/test/test_bus.c | 689 ++++++++++++++++++++++++ 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 | 3 +- drivers/net/mlx5/mlx5.c | 3 +- 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 | 13 +- lib/librte_eal/bsdapp/eal/eal_pci.c | 52 +- lib/librte_eal/bsdapp/eal/rte_eal_version.map | 23 +- lib/librte_eal/common/Makefile | 2 +- lib/librte_eal/common/eal_common_bus.c | 284 ++++++++++ lib/librte_eal/common/eal_common_pci.c | 322 ++++++----- lib/librte_eal/common/eal_private.h | 14 +- lib/librte_eal/common/include/rte_bus.h | 293 ++++++++++ lib/librte_eal/common/include/rte_dev.h | 14 + lib/librte_eal/common/include/rte_pci.h | 58 +- lib/librte_eal/linuxapp/eal/Makefile | 1 + lib/librte_eal/linuxapp/eal/eal.c | 13 +- lib/librte_eal/linuxapp/eal/eal_pci.c | 84 ++- lib/librte_eal/linuxapp/eal/rte_eal_version.map | 23 +- 39 files changed, 1847 insertions(+), 289 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