From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0044.outbound.protection.outlook.com [104.47.36.44]) by dpdk.org (Postfix) with ESMTP id 17B421E2B for ; Wed, 2 Nov 2016 10:23:59 +0100 (CET) Received: from BN6PR03CA0047.namprd03.prod.outlook.com (10.175.124.33) by SN1PR0301MB1629.namprd03.prod.outlook.com (10.162.130.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12; Wed, 2 Nov 2016 09:23:57 +0000 Received: from BY2FFO11FD027.protection.gbl (2a01:111:f400:7c0c::160) by BN6PR03CA0047.outlook.office365.com (2603:10b6:404:10c::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.639.5 via Frontend Transport; Wed, 2 Nov 2016 09:23:57 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=fail action=none header.from=nxp.com; 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 BY2FFO11FD027.mail.protection.outlook.com (10.1.15.216) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.693.6 via Frontend Transport; Wed, 2 Nov 2016 09:23:56 +0000 Received: from [127.0.0.1] ([10.214.249.5]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id uA29Nlak010812; Wed, 2 Nov 2016 02:23:52 -0700 To: "Walker, Benjamin" References: <1477332995.71904.36.camel@intel.com> From: Shreyansh Jain Message-ID: Date: Wed, 2 Nov 2016 14:53:46 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1477332995.71904.36.camel@intel.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131225522371762337; (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)(3190300001)(339900001)(199003)(53754006)(189002)(24454002)(377454003)(189998001)(4001350100001)(110136003)(356003)(15975445007)(6666003)(305945005)(7846002)(7126002)(7246003)(31696002)(626004)(19580395003)(92566002)(31686004)(120886001)(86362001)(8676002)(81156014)(81166006)(76176999)(6916009)(97736004)(2950100002)(50986999)(77096005)(50466002)(65826007)(33646002)(54356999)(586003)(64126003)(2906002)(105606002)(555904002)(47776003)(5890100001)(65806001)(65956001)(15395725005)(4326007)(5660300001)(87936001)(230700001)(106466001)(85426001)(104016004)(23676002)(8936002)(36756003)(3480700004)(11100500001)(68736007)(83506001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0301MB1629; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD027; 1:hthsDrsyRHgU8HX8HA3CqBZd8MUQNHz/Pc6kbjkAGIgvtrZd/pVwv6Mw/IUs5fs0fvhiFpvVubHwbyyNhIRFudBwRURPrcky593Qc2H8bcY7fe2D4zvLY2yi1SljPtWAX71KrGmCKbp2PIdrr31RmRntDFNq4ipBE2wd9UDvoDG8vNAsBqbFTHOzSkKEgY6f1gjtCXA711pO//P6zfB1J5o3hTf8dvTqUmqXkQ/sviewD54qPg8gpffdJnF4IQsGI4rG58XKbJytBFkN33BItzTMDCqJIeqTWJnO0xH708LtevqEdM12X2kCnSdX7Zp4dpLYdE/5fLY5EDuRg/fEk4uLm2b2rUo/o1w5HCBiUBANMj6AxqHo/8XGbAVUpIdVD3KhYN1XRaNqCimwa201O/aq4Beo4yzLIL1pm/Lj+PhCfS1ccgqMlDgwTjHMev8Yvpx8G9vdBrFcLNdKlwTb43919J26HwVLWSeukbsUELX/9cT93OYMljCkabdJ484BTmPIOtZhVb0m68BcxbAsNuLrtPh0lKqV4gDQKz0r/P0QPswbWvgwDPbMNqThGn3+ft/miAR1/tCi7mgpdBcaRqZ48JEsc5FfhAtGLuotg3dAhYKTl4Ni57jAkaJ7qirlhTvUNOAlQoJQD940Dfe+Os6LP+HrnzkD2CabBXqg0YE= X-MS-Office365-Filtering-Correlation-Id: 264b8768-5626-4353-b740-08d40301f8e3 X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1629; 2:DmduBkgSTX9cxNZR/LZaVYIeHxD8Cf4EIlSDIF4LRZawYvv0gLIJk7DzlxtOFIyw3BG3lgPXHOi4yp7ycaEzScXaYKVfQUC3DhtOKcBmiDJ6RL/wCqOWxEhrfJMSI1dYscLZqVz9vGiA0wvhub0OmZ5Uqb49246Xa+ie8QpKhTLPGtcy9ho+HBfNWkoB53S+nVZDqYygCH9PblQ1u2Bfrg==; 3:i/RlX7svMUy/A49A9ifXgzGlw1o5zrgb1OB3fG+G6OIoAVj/KxHWGpUN3J1nGDy5iD8KX0Hu4ub+rDVih9a3DePp7d6IBsMf7Heo2My5jiLxZ3iaszxEUzcrIQL3nTuN7wFM5RqvQ/eFaTPg+AVxn3VNBBt3UvenvpuKkGhWUjy4xjDmfuALK5+w1Kux/oUBkiVgMOOeW31b2x4WqKmlxViNaKl8EhEKo4rbM1VtG7Ib7m1vnKu9cZ9prgZjVqGS X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1629; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1629; 25:FX0DiKMIxhZ3USMJlotFil/Yt+tZAPUBFZ1H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FJ8nI8mEvNEJBOHe1ZfpnITbOQgMzFeaNGS+c9QaegJ/aOh5I+VntimAbUnvhb+W1m0nYJ65ss8s5vJbta5dyb7dWK+0wVqhz8Rcg/59JmVlXg9jHxhjvVRc9CAVqTyqfYZb9ZRBBUz2ZEWIg==; 4:Fma3QMbH5sXKPa7FjCXthVNzELA1SdU1vo3jU7yyGSOWL2IxlZ+QVCSuj2AnUQ5dvfTPgrsDcy2DkPPce6fj7hPJyMkkOg2ZHGVItWHEa+c7t54RwP0DQ9tfHhEQ4fnp0ECneay+l+0VbJen7HUhQsKeKB5Q94fBRb8kkcEPV8g7uBgaekVr0C+cCYcgth3wl5cLgZCER96wWRzZJ+W1MKj/ccxIfSMFdovin5dGOjaYLcV8BhMPwZcYMzAcUyXGRFlN2LiD4JEDsepYdcWlykw9RIRmZMxmlfmEPBReUUdAPi3aL//q+wtjmJWsgMNU7HKHiD4ulxZeWq4tr+uuCo/jtv1JBkHXZZGjcXVY0mBF0kGpjDEFxS/Oq+eyDgxKTbied4y2oJgt0ucleGINZSvPV8hBpruw9UEuYQQ0UcN4Ilnii30gaCDbGqPIZ7fiuObVyi7WCHZwJtgfaJ5qH7Z6hU1j0XxR2610DA3MIikc2OF5EXaZ6D++5n8M4FKikqafqM0QhM7AGKlV60KOmX4HGM7VYfnbBgntn2u57IgKJZiDBGXBc9RiTOlY0CpA X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13023025)(13017025)(13015025)(8121501046)(13024025)(5005006)(13018025)(3002001)(10201501046)(6055026); SRVR:SN1PR0301MB1629; BCL:0; PCL:0; RULEID:(400006); SRVR:SN1PR0301MB1629; X-Forefront-PRVS: 0114FF88F6 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjFQUjAzMDFNQjE2Mjk7MjM6MDc2cmF6aER6cDhaelF3cFY5UFdTaDBE?= =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JxVXhoSDlFdlM1NGkzN2lsa3FxaWJnZjV4?= =?utf-8?B?cFFLOTg4b2xDTXJPN0VxYmZVSG0zRjNCM2NaQUMvOWtTbGR5YUtIZmdhSnpD?= =?utf-8?B?RnJrQUNKRVdGaGs5ZjBqMWtUNGpqc1pKdisvK1pTU3hJaVBYMCtTVks4emFG?= =?utf-8?B?TEN3aGYvVlNDKzluOFhobUxHZlk2cFlmS0U1UlVneE45czlqdnZ6djMwRnAr?= =?utf-8?B?VDNGWFlEbkxuL3hqV1p1ZHFDczBpV2dsaDdFdWJrRk80UDQ4TVQ4eGNzTE1S?= =?utf-8?Q?mjZA/GT7+nc6ddJHtokazGySM=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1629; 6:YnUdBe9QR6hzdpfN3tFdIBSs/C3SK4JpZ/k+sa+P2mPX92JpIwoegxb0wgvulcNUe5YPIweDawlKpyxMVUsb+kkZlRhg3pRdzKemnHxmtzuLudnvWra/pzfsx0udVpV0gc6oZVzxtSyk78QR/zLLfpSLXnnYpYqQX+ng3kseW0iQInHSqcSQzZlzysdVujsu8oOk7HeKDbYXc/SzmKR95VjmslKhpzt7gd+S3fEQLap+EehR/gQNkzuPunEkrhypHCE1etsdAGBvbOw89F4aRknzYPj8UBZT06qNoCReKezAvgQGmJjRjdq5Klo4q8DY; 5:lpx2UN2NQT9edGTz0Ir598jUi0K+7htax3iuHP0w82OK1nVMvz4WKPBq3/kNy7aUBs4jlRLPganMJqWCUUq6lO/OXkkhs8AntXplApWhywDcwNtIcPMplXwLU3uZx0Vk8Q/1Vt1CGM3WjTdifAWpoYX5qfvjO6piA5LbWTzJ1egsLZW59pMD0jX40kXk/g2V; 24:9LIHvWFfwO4ieAqmAT5X9n0/iRF9Y8T8ps/hUkuPU28HsBaFMuctJgDtEwtt+eNLriaqxQa2ti75nfP7zmTLTL7tI+khgu/KsN30pqIX9tk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1629; 7:nds+K+vd/EAA/FSiznqW/o5bKCJqVO5FQu3RkGxrawbOYySSQFBAw1Ye3Ud6zOQ6Imn3GhbyRC4L7X1b5/hSKXJ93B3lhch/XruK5sEeAcLtFpKRLsIUXmmX5QaErUwB3sjz6+ObODgVgPI8+mGgOYSKwq07ST5aS/TsUOnNPfOvFJCIUzLzIh3UTPommRu/0DtYwVBacJ2YqjRO2AR+mwjTIwzYsu9fBCNn7YSOt1Q+++Lq/JJ5GydSYiFxBJWEk7LnUHg4SryOgqr2revXEfYDjlSKSSZmgmHUiWuETaSsDC0FwfhAOETIjl8oWeLoMmlmGwboRTfctC8jpZEvpQmpaR8tAaZ3IgRybOJkGi8= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2016 09:23:56.9734 (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: SN1PR0301MB1629 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] PCIe Hot Insert/Remove Support 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: Wed, 02 Nov 2016 09:23:59 -0000 Hello Ben, Apologies for joining this discussion late. On 10/24/2016 11:46 PM, Walker, Benjamin wrote: > Hi all, > > My name is Ben Walker and I'm the technical lead for SPDK (it's like DPDK, but > for storage devices). SPDK relies on DPDK only for the base functionality in the > EAL - memory management, the rings, and the PCI scanning code. A key feature for > storage devices is support for hot insert and remove, so we're currently working > through how best to implement this for a user space driver. While doing this > work, we've run into a few issues with the current DPDK PCI/device/driver > framework that I'd like to discuss with this list. I'm not entirely ramped up on > all of the current activity in this area or what the future plans are, so please > educate me if something is coming that will address our current issues. I'm > working off of the latest commit on the master branch as of today. There has been some work recently ([1], [2]) which generalized the overall DPDK EAL framework to not look at devices as PCI only. In that sense, the attach/detach routines were also generalized. But, dynamically removing device during the application initialization is still something which is grey area (from what I understand). There are some callbacks which the application can register (eal interrupts), but it would entirely depend on drivers ability to handle interrupts generated from device. A complete restructuring of EAL is still open discussion - which might include this point. There is a patch series floated by Jan (and subsequently managed by me) here [3]. I also initiated a discussion on this lines in DPDK User Summit in Ireland (Slide 18 of [4] might interest you). [1] http://dpdk.org/ml/archives/dev/2016-January/031390.html [2] http://dpdk.org/ml/archives/dev/2016-September/047099.html [3] http://dpdk.org/ml/archives/dev/2016-October/049606.html [4] https://dpdksummit.com/Archive/pdf/2016Userspace/Day02-Session03-ShreyanshJain-Userspace2016.pdf > > Today, there appears to be two lists - one of PCI devices and one of drivers. To > update the list of PCI devices, you call rte_eal_pci_scan(), which scans the PCI > bus. That call does not attempt to load any drivers. One scan is automatically > performed when the eal is first initialized. To add or remove drivers from the > driver list you call rte_eal_driver_register/unregister. To match drivers in the > driver list to devices in the device list, you call rte_eal_pci_probe. I agree with this general flow. > > There are a few problems with how the code works for us. First, > rte_eal_pci_scan's algorithm will not correctly detect devices that are in its > internal list but weren't found by the most recent PCI bus scan (i.e. they were > hot removed). DPDK's scan doesn't seem to comprehend hot remove in any way. Indeed. And this not just limited to failure to scan hot-removed, but also those devices which are either ethernet or crypto but not PCI bus compliant. Essentially, the complete DPDK scan model assumes that PCI compliant devices are available *before* scan is performed and across the scan process. Hotplugging is limited to applications ability to attach/detach devices. > Fortunately there is a public API to remove devices from the device list - > rte_eal_pci_detach. That function will automatically unload any drivers > associated with the device and then remove it from the list. There is a similar > call for adding a device to the list - rte_eal_pci_probe_one, which will add a > device to the device list and then automatically match it to drivers. I think if > rte_eal_pci_scan is going to be a public interface (and it is), it needs to > correctly comprehend the removal of PCI devices. Otherwise, make it a private In some parallel discussions, there have been talk of scan being non-PCI centric - which would make this API hidden beneath another layer of generic scan. Either way, clean handling of a hot-plugging case is indeed desirable. See [4] above. > API that is only called in response to rte_eal_init and only expose the public > probe_one/detach calls for modifying the list of devices. My preference is for > the former, not the latter. Generic way of DPDK application is to start, rely on DPDK framework to find devices which have already been attached to the PCI drivers (bind script) and then wait for probing to finish (rte_eal_init) so as to start the I/O (creating pool, queue setup, etc). In the later method suggested by you, this model doesn't bode well. From what I make of it, applications would then be responsible for attaches thereby making them call extra APIs. In that context, I too prefer the former (handling hotplug). > > Second, rte_eal_pci_probe will call the driver initialization functions each > time a probe happens, even if the driver has already been successfully loaded. > This tends to crash a lot of the PMDs. It seems to me like rte_eal_pci_probe is > not safe to call more than once during the lifetime of the program, which is a > real challenge when you have multiple users of the PCI framework. For instance, > an application may manage both storage devices using the rte_eal_pci framework > and NICs, and the initialization routine may go something like: > > register NIC drivers > rte_eal_probe() > ... > register SSD drivers > rte_eal_probe() > > This is almost certainly how any real code is going to function because the code > dealing with NICs is unrelated and probably unaware of the code dealing with the > SSDs. It should be fairly trivial to simply not call the probe() callback for a > device if the driver has already been loaded. Is this a reasonable modification > to make? I saw your patch on this. It sounds fine to me - indeed initialization is a singleton process and it should remain that way at least for a particular device. > > Thanks, > Ben > I am still working on the restructuring. If you would like to collaborate on it or if you have ideas to share, it would be great to chat up on it (ML or offline). In my opinion, DPDK EAL framework should be agnostic of device's type (PCI, nonPCI) and presence (plugged, unplugged, dynamic hotplug etc). - Shreyansh