From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0072.outbound.protection.outlook.com [104.47.36.72]) by dpdk.org (Postfix) with ESMTP id CFFDB532C for ; Mon, 26 Dec 2016 14:20:39 +0100 (CET) Received: from BN3PR0301CA0017.namprd03.prod.outlook.com (10.160.180.155) by BN1PR0301MB0738.namprd03.prod.outlook.com (10.160.78.145) 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 13:20:37 +0000 Received: from BY2FFO11OLC009.protection.gbl (2a01:111:f400:7c0c::101) by BN3PR0301CA0017.outlook.office365.com (2a01:111:e400:4000::27) 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 13:20:37 +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 BY2FFO11OLC009.mail.protection.outlook.com (10.1.15.0) 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 13:20:34 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id uBQDKVCQ029786; Mon, 26 Dec 2016 06:20:32 -0700 From: Shreyansh Jain To: CC: , , Shreyansh Jain Date: Mon, 26 Dec 2016 18:53:53 +0530 Message-ID: <1482758645-23057-1-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482756644-13726-1-git-send-email-shreyansh.jain@nxp.com> References: <1482756644-13726-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131272320363879618; (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)(336005)(39410400002)(39400400002)(39450400003)(39840400002)(39860400002)(39380400002)(39850400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(15395725005)(47776003)(92566002)(104016004)(5660300001)(8676002)(38730400001)(81166006)(2950100002)(6916009)(36756003)(356003)(50226002)(77096006)(4326007)(6666003)(110136003)(8656002)(2906002)(5890100001)(626004)(76176999)(50986999)(8936002)(81156014)(305945005)(50466002)(48376002)(85426001)(230783001)(69596002)(5003940100001)(2351001)(97736004)(33646002)(189998001)(86362001)(106466001)(105606002)(68736007)(7059030)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0738; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC009; 1:eKAnRln8TSSmMLJVLAa+dm0gVpD9K5Bts6AdwwcCX1+1966ZLxGddrxxQD9/5LTvsDYAl84O2uBhJYZGO9JgSdgZ/XUaetts2v3alc8VXVJbFOat4WKyAxntZfzYwS3AeWiKipjnNaDbqnk9APwZYsBSCm6YEOWV9ZSPITmAvfzmKxqgCQMzHw788RLOoXYxin3P7MJ3D5/bpQYPVdZy8iTJZLkNQ9kzCXOBFb2t2rAQHnMyNTuI5RE4wWlwia+HAZNhRfxEmFo3iD3Axb8j/SitywmNZT3jY49LmQBSVc8G5p6JZgtE9RrOYz4ASRsV4OvIl1OasRJA9b8F0ajnR3Nuff4vxjmOz5UEYRZQMRcSciHQZQvJL0COvrCXpr83l5LxlGEcpd4+bVGSfjbtrT28A+CwEAH4e8xcGatdwM8XzxkHBCiVmawA7bwKGyM0E4fBlfAWNVWGOxuwF5LurbJ6ZaHyem/kbIN6UscN3a3zDSmcZjw5DDOC32nptpXtQyIx1ohxPIHIFTx7OHGg9o8UXHEgCiYPtXXhIm5t1kkr3wFTc5+kk1T8WjOUxuDNJl0HQdfs1j/x+gVbwjcUpiwjyJASYhzqa7nqKn2woI3YcBhsNdszASzT4q3mx1uguFrzc9At5BW9fkGca2+VWpAUdz7RLq0PokqrDPUmNj9GJd7/6QXT851oIMTwX+/tK23CX85QlhMUSrdq20empCPfoJwGrLpWlVy7liMK5lw= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 3645da86-8ebe-4a10-5cc2-08d42d91fa98 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN1PR0301MB0738; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0738; 3:bHlCYSeu1gGkzfsCAI05Iobw99LrnRjF68fTAx0kqEhk99V13mOMYLXDDfAibx7ezFoQmuKUaaEu+5HtQ//1wROrhAhxGcNutIwPMvOLzm/nIkLrt//G2iVv4SIUFP0/J5vF+hKbzSxk62Zo+2ggZOJXFDPbV+JTg85eHCg92RAK0RLpIlNMTi5aZ3vgTqemhiHJaj5TJL/p0O0XJUNlNiajqoURnpb2Qwvr0YOt6D4WifJojbJBNAeXisgU07emSVYQKHjrKKG1cS0/S3h7fq3I5DlPzXuRkBrkWOMA8D8FHkRY+pnsc31sfg5mJ/QLFZIuKrcyQatpM8Cj/H/52POBbX3p5iR4lXpUMks4bmmBFCR4962ahKAb4qMso/Q+; 25:bQDsvxOzP/BiPppoj8zt0og0PeUQq+8wEB8fiS7BjwGlZr4RY8oHqSa9ZJ6MDBa1HRm1RonJlbsyF1gZ9bdUK35yst+yi5y9M2LMlWhCe4FiUfUlxb8TcFVPoB5+9D6NwIbgi+GRzqlR8dOZOXO2T5V72rJQo1FZP4gzxGdCoZnEahAg//QfX5ifgBkzblnYiNuogk+Rxb27a93lzPkIzU8HJoA1i26VuOxqoK1zRR8cz+TCgW1QoEhACmgeAxK81RhgrUEovxwjBcFJgnO6B9ZsWf9CKkiHnHTeLY+LEkMI2rf9HW14rqOMwNqZ6LGxxoNdui4cSIOFlr7jpPnsFI0MFQSGsw9sGxHdQvFyha8GhhAwwn6rCyE9Nr4LyfHpbe3kwE5oNLixfuCCLq4UqLfaigIiKsLR9EH45JtT+DIPKrV733Clm1Ji99XigsUePB9HEqloiWdiAaPWDdAGWQ== X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0738; 31:qwrW2yWLkb8cySpxQEn2SLz62DNcqxhSBpyLR0gNMiDAUMZkOwrSTt/DXhf02A/gaT4jhhfa/yQC5M1FpOuARTuG9S8NbV4GADorJBu3VOL+jDXTxbNHCxIrChpL7rvUly6v6H5Lom3vxMeeVLUyIvQyLMm/eAD8QNi1RYo6NuIia8pL+f4SmwxwDr3+U/rgqGWAFLtEKCwhKzsEjcfvUdOjLRy7GUp2eaLPiSFdjvX19RheIAJjI7WDuHT6R0iO/7ng50mQ38QJhg6OdfkavQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13024025)(13023025)(13015025)(13017025)(13018025)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6096035)(20161123561025)(20161123559025)(20161123556025)(20161123565025)(20161123563025); SRVR:BN1PR0301MB0738; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR0301MB0738; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0738; 4:WKPNvC6NW029afjdzIjWigcmaV7HMNAyw+4MXKycLRMLFB0uzkomDRwxoqkcFyGxr7JpS/c0A/8qRStza/XuDgZyyeCs2Kkltwd6LDUmbZRFjS3gvHbtwKD1fW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X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0738; 7:wKyhNNYZLFkybbsCVRMUghQL7Fvq7IdBTi46fCKq2KnrEiWgCD5a3sZb0it12UbBIey3BZXM3LvnYJWywZJIX6QOAun6LeTsA0qBLkVtTNyOMr0ysDNyHG+u6s2X8Mz7tYsI/hISum4MD6mPzQSsENrAz5R/9OrbOsAbMxlApdyhvozR01SJsQC3L4Hk58xTs3hw8vEbIj4KTmbmgQAd4Cgflxei3TajMdggcpHqC9Z4lacSbtygM4RTFnkJftkzyROBlTIWwo3PjXttYk0CHrvqe0X0ErXtrSBvNGpOkXClODeNfsiLpKZ58oIXoSYMqHwGMTD3Slrd1RLZhxWKUbW9pR/AZ4EpXbGrGT2T3qfBseBL+dz84ofS+h4Qlz7Vgt0+7X4NKAdKE8GkumoQK2pngqxTdSxuhHwKDjvVdHLA5NjmF14PSqAU/csVn4O3s27UW8VDS8AfJA4JT3KstQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2016 13:20:34.8747 (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: BN1PR0301MB0738 Subject: [dpdk-dev] [PATCH v5 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 13:20:40 -0000 Link to v1: [10] Link to v2: [11] Link to v3: [13] Link to v4: [14] :: 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 [14] http://dpdk.org/ml/archives/dev/2016-December/053302.html :: Version Changes :: v5: - Fix checkpatch error in Patch 0003 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