From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0053.outbound.protection.outlook.com [104.47.36.53]) by dpdk.org (Postfix) with ESMTP id 083E628F3 for ; Wed, 9 Nov 2016 14:33:45 +0100 (CET) Received: from BN3PR0301CA0077.namprd03.prod.outlook.com (10.160.152.173) by MWHPR03MB2895.namprd03.prod.outlook.com (10.175.136.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.707.6; Wed, 9 Nov 2016 13:33:44 +0000 Received: from BL2FFO11FD045.protection.gbl (2a01:111:f400:7c09::132) by BN3PR0301CA0077.outlook.office365.com (2a01:111:e400:401e::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.707.6 via Frontend Transport; Wed, 9 Nov 2016 13:33:44 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; 6wind.com; dkim=none (message not signed) header.d=none;6wind.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 BL2FFO11FD045.mail.protection.outlook.com (10.173.161.207) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.707.3 via Frontend Transport; Wed, 9 Nov 2016 13:33:43 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:909; Count:13 Received: from [10.232.14.87] ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id uA9DXeTr005705; Wed, 9 Nov 2016 06:33:41 -0700 To: Thomas Monjalon References: <1477581467-12588-1-git-send-email-shreyansh.jain@nxp.com> <1477657598-826-1-git-send-email-shreyansh.jain@nxp.com> <15406748.TzsDne6LfD@xps13> CC: , , From: Shreyansh Jain Message-ID: Date: Wed, 9 Nov 2016 19:06:00 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <15406748.TzsDne6LfD@xps13> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-IncomingHeaderCount: 13 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131231720240164906; (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)(1109001)(1110001)(339900001)(24454002)(377424004)(51744003)(199003)(377454003)(189002)(356003)(305945005)(86362001)(31696002)(7846002)(33646002)(5890100001)(2950100002)(83506001)(5660300001)(50466002)(104016004)(189998001)(4001350100001)(4001150100001)(85426001)(76176999)(65826007)(50986999)(87936001)(345774005)(97736004)(54356999)(230700001)(586003)(8676002)(110136003)(68736007)(8936002)(105606002)(92566002)(6916009)(6666003)(2906002)(47776003)(23746002)(81166006)(81156014)(4326007)(36756003)(626004)(561944003)(65956001)(106466001)(65806001)(77096005)(64126003)(31686004)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2895; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD045; 1:mTaned33BrMXAFsE2Y/9+hM84bXM+OPPJ8Kjgiv0ZOEH3lmnaFjfQtHID2Nz2UWKWakpeG1cCVLuNMWrp8BZCwOvBT/YrPVXvPRlMWZmEz37stM3nGa43Odmp8IGpWCsa5ND8b4nl26ItvXv/lWRb8bMlmas/bF9VQo/9X4cC5hEZn/ie8U57pmvCxRoyJ6XuBj3xn+B3dwrsT6QKtxcmlNIhO1KUKzGMNs0YCc6Spw1OO2mMPPoUE2maI//mP2ECiVmCed3v3THGyYn2APO9leMDEWnJvUKOiTCuF861g7TDO8vJaKieXJ7nWGTNedBd8/0eAyGIw1QZjNtbUDGHAwE9zC2+y6IcyDwfN6C3l+oZMFAvYIt4setnRJc+LfC7+nNok0nnLehtUWIzNwOkljQGIf9JSGjiAqwYSjq6hYE4EouwrHfyX0Cv81D8ZPPir7WcnuKHIPcHUszn6N6lfADllLJqcjTQEr3CoO32/jq8iHqR2qSbzZjLO3e1rAiCqmWgFfHmFXoP9qhjt2ChY/8PYjH5yqaVaKDIxAGDEMKj9bcjWGAIPqr5nTicM5Bixdge5f+YiOEoFsjBsR3q6V1y72zFfSrr4B5+VElu8I= X-MS-Office365-Filtering-Correlation-Id: 6c766864-fa60-419c-b02a-08d408a506a4 X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2895; 2:01j2XCWQEk0IK4LgvGD3LiSbVi2x6r5cmN3Ov5HSVPpK/Zv7NSM2Xg226ii0kWB6A2CGLWp566YantNyMWIabKhTv+9DlHWbhkNo66aHAVS8CZoAeqPq/+VUxfEqtGbD9IYdp4vMQLg9/95A9UFUuyCdNPuHPw00khGP7+H0xADQi1Bfm+2aqOXwPtGW7BAG8KnSXUtsAMZGq7HysIajDQ==; 3:cyLAvCZ2zJaUQyaTrRJyDFSMP3v/b4Qc/zRkxcjdZA1QvnFHZtzrSnK/7OthLEp3C2AtqTNUxh5foZwuM4tE3npv4E0WMw+r1dzFGBuLojLGYpw0bW+1+AFp2y1vxZsY9CCPguhNk0P8CAjiquxMQts3+2nyA8VLkdrn0TAF0OkVdThwH2p99NgmPXf/BnLCxrBcOvxx1NtBHNL0dUib+j/no497pFGdUBEp1k35XBB6+9ez3uCNuEBLzBPiyNHi X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:MWHPR03MB2895; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2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9n6QVabQjP/I7wTpN4xxbgsk93wl1RnwFJcaiJgzINthz+y2Mm3aWnSn8kRIOky9BQkO2hmqe8eIrt0dKniNsis6k=; 4:6SYZfcVsdroylB7C/DbVbddSjEi0W/Q7+Zloi/LuVLnljJv40IfrKSC67v4/8RmjeppFxtSZZiY7WfxmGXuKRr0ACb17csT6orkOAmX+adOLA9tCJhKoTndJGNyQdoN/oG4dQKgiLAYlTl+/6TFs7yYrUMHMrDOWX15TB7/7Arki9/bChQ02J9cDe8LrqimdNanmVDo/TDRA6Nb4NLOrg7H3Pdi+GCwNwrS7y74Nw5N8MgU7U2i4hFRc3HEY4yxV/rnQ3lNrbRq96MKCVKN6N/2FkXdkzDytz+iU3dq3z0QXQWEpSC0IlFtazlHs5xT44pO5WryfyLysr4GnHvJtC5nHMeZYdQy9RbdCVhJV/+l0RIOCsyNEfsfsaUEgxCL9Mg5/iyvoXS3iuUWapSclBHpkDag+mNmL5D2HsRsWy15EMLJNx0ZAzqYBT6g6gzHxzTsgKnDv2ShzY0TNieCOnRIrxOCCu3Lz9IA05bsPQ7VRnFE+VSkugk1pDL/Ymrc5xm4NPvN3XgWOVp7AemBwPw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13024025)(13017025)(13018025)(5005006)(13015025)(8121501046)(13023025)(3002001)(10201501046)(6055026); SRVR:MWHPR03MB2895; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2895; X-Forefront-PRVS: 0121F24F22 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; MWHPR03MB2895; 23:eKHDpoKsklTCP2i2RuNgb7wgNMZx5mYmB0PTa?= =?Windows-1252?Q?gJ9sjGyfaafdMh4yB85N2Siua+e74qV2cH3879S6aYnsGYS1ULP18rXJ?= =?Windows-1252?Q?V3W2qLYCO1IQHd9nEVj0mithvO6LXEI0kUDwtjcqkMPcgT8ifi1qQanC?= =?Windows-1252?Q?1Z3oNiHDARBfgozeBWk5B88Djzk9vC9ch9JUQW4+1YrRwoNvRN63B8rb?= =?Windows-1252?Q?DDs8OTsCctjSPG2/XHxo8WNfhBdIw3qC0ih2t6w5x/gW7XK/x7F/pJbv?= =?Windows-1252?Q?jTUGlUn6DjCgEi4GjOKkPP5ilhwS4iZLBMSQdbHJFtRjHxkARiZgSo7b?= =?Windows-1252?Q?gN9ibLNZlrajnWWPVz8y1bpL/Ebvm6jB/jr+1bNZpK79Ka8WXebpu2bu?= =?Windows-1252?Q?Igl4P9yN/M+s6HTjgrGxXZHc5pS4bGjVmCnwBltC5EC/AsAeHamRzBn8?= =?Windows-1252?Q?zfieLAukWU1+xpsEgrtG17vtASVAtxq9Z9ATFM7om5+sweCCykGhFFWz?= =?Windows-1252?Q?SkjRB4ijjxIIiYLiihAvsCmzFYINPzDau8c6z1O+0yqCPmYtPJ6xa4VI?= =?Windows-1252?Q?zOMI7aZfhyzmWk4PWat0VM0zfsZJraf9DovyG2UYxlGWxUZlIMhLTa+8?= =?Windows-1252?Q?KUHoKw1HSYloAjzPsAsbDO5H/fiSdim0b8GQADOO5UxVLv/ZheGiBUQ+?= =?Windows-1252?Q?pGc+9ddc/Duc0Zzv3DIpRxd2Fyt9Mu1XJpUlD9mUAHseJCBTlm6k9+Rv?= =?Windows-1252?Q?zoTcZizcDglB78UWc1yLJoydqoS4E8feEz3GLpx2x36YU7obUH6rvQFG?= =?Windows-1252?Q?e6esI2bTs9rXGveXSTydg02lM4upoHxu332F3nkLEE2gP3xLrhBj1kOt?= =?Windows-1252?Q?vGoSxMGTbKIWzutktJuQzh6G7x2xh2detcPzDttUamn6ccKZfIBvD+7+?= =?Windows-1252?Q?KqzyrlT6kovK+PibeD/nK8GN4kxf/mxHnAdo5NaLnLdb0AVgJlegaglQ?= =?Windows-1252?Q?hIvgL9LpgPWHw0IrWdYvZcJlQc0193X01es6FrmjzJe+SJ8clmiOlFO/?= =?Wind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bcoENkuEmJu920ykCSFrSoqpcqYxneM3ka5B5pSeO0TYxZLhIenEUuLJoPfBy3m1vbvY45SAxik3pyrblbl; 24:X/lhU4TfCUjn1XeMuobuKuwrJq3fAXppfyRa3TIlrmKzp3GRWy/rTsWu/mRv5y53ptbPLr56RAttHc7gFDlFYg8nQr6jamj4FfIilesuhcg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2895; 7:Eu7y9N/YzP3QtogknoTImWvA6YriLYxFLE4M9r18O2hKWsmUl6NlQgt4ezfSXNVs4QK9T4zALqQTNTYo6ZbgV9jgBE/AZWR8i6pTbZxKLhqfR19dlIvx5QPZeOA9q+Fx52K4e6gccWTjDo9XVWmPBUyAUggYcLcHlF7HkeltK/uJmqO3THpmiUgG6lLvICFKDsmoC3IEAsP8OWshoaJf70AQIuEI8AQqcvT57R/nyOa5zm0IReSaReU/saNRfTUBZHG2NhH13taMadL0b2vQ7IOkhCJhgpVXTgYne7TNFMdcMzSpYAqb3jn1Qkq6xFRHf4ewqAsPy7lQ9/PjBA8906xbBpeO63vbBGV6KGwiPeo= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2016 13:33:43.8448 (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: MWHPR03MB2895 Subject: Re: [dpdk-dev] [PATCH v7 00/21] Introduce SoC device/driver framework for EAL 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, 09 Nov 2016 13:33:46 -0000 Hello Thomas, On Wednesday 09 November 2016 03:47 PM, Thomas Monjalon wrote: > Hi Shreyansh, > > I realize that we had a lot of off-list discussions on this topic > and there was no public explanation of the status of this series. Thanks for your email. (and all the suggestions you have given offline/IRC etc.) I was beginning to wonder that probably only Jan and me were the ones interested in this. Ironically, I felt that being EAL changes, a lot of people would come and be critic of it - giving an opportunity to get it widely accepted. > > 2016-10-28 17:56, Shreyansh Jain: > [...] >> As of now EAL is primarly focused on PCI initialization/probing. > > Right. DPDK was PCI centric. > We must give PCI its right role: a bus as other ones. > A first step was done in 16.11 (thanks to you Shreyansh, Jan and David) > to have a better device model. > The next step is to rework the bus abstraction. Or, this change can be broken into multiple steps: 1. Create a PCI parallel layer for non-PCI devices. (call it SoC, or whatever else - doesn't really matter. More below). 2. Generalize this 'soc' changeset into common 3. Complete generalization by introducing a Linux like model of bus<=>device<=>driver. Which was what my current approach was - expecting that SoC patchset would allow me to introduce NXP PMD and parallel to it I can keep pushing EAL generic changes towards generic bus arch. > > It seems a bus can be defined with the properties scan/match/notify, > leading to initialize the devices. 'notify' is something which I am not completely clear with - but, in principle, agree. > > More comments below your technical presentation. > > [...] >> This patchset introduces SoC framework which would enable SoC drivers and >> drivers to be plugged into EAL, very similar to how PCI drivers/devices are >> done today. >> >> This is a stripped down version of PCI framework which allows the SoC PMDs >> to implement their own routines for detecting devices and linking devices to >> drivers. >> >> 1) Changes to EAL >> rte_eal_init() >> |- rte_eal_pci_init(): Find PCI devices from sysfs >> |- rte_eal_soc_init(): Calls PMDs->scan_fn >> |- ... >> |- rte_eal_memzone_init() >> |- ... >> |- rte_eal_pci_probe(): Driver<=>Device initialization, PMD->devinit() >> `- rte_eal_soc_probe(): Calls PMDs->match_fn and PMDs->devinit(); >> >> 2) New device/driver structures: >> - rte_soc_driver (inheriting rte_driver) >> - rte_soc_device (inheriting rte_device) >> - rte_eth_dev and eth_driver embedded rte_soc_device and rte_soc_driver, >> respectively. >> >> 3) The SoC PMDs need to: >> - define rte_soc_driver with necessary scan and match callbacks >> - Register themselves using DRIVER_REGISTER_SOC() >> - Implement respective bus scanning in the scan callbacks to add necessary >> devices to SoC device list >> - Implement necessary eth_dev_init/uninint for ethernet instances > > These callbacks are not specific to a SoC. Agree; this is just a note - it exactly what a PCI PMD does. > By the way a SoC defines nothing specific. You are using the SoC word > as an equivalent of non-PCI. Yes, primarily because SoC is a very broad word which can encompass a variety of devices (buses/drivers). So, we have PCI set, VDEV set, and everything else represented by 'SoC'. The complete set is based on this principle: to have a generic subsystem _parallel_ to PCI (so as not to impact it) which can represent all devices not already included in PCI set'. - Actually, it is _nothing_ specific. > We must have a bus abstraction like the one you are defining for the SoC > but it must be generic and defined on top of PCI, so we can plug any > bus in it: PCI, vdev (as a software bus), any other well-defined bus, > and some driver-specific bus which can be implemented directly in the > driver (the NXP case AFAIK). Indeed - that is an ideal approach. And honestly, true attribution, it is not my original idea. It is yours, from our IRC discussion. And it was ironic as well because Declan came up with similar suggestion much earlier but no one commented on it. > >> 4) Design considerations that are same as PCI: >> - SoC initialization is being done through rte_eal_init(), just after PCI >> initialization is done. >> - As in case of PCI, probe is done after rte_eal_pci_probe() to link the >> devices detected with the drivers registered. >> - Device attach/detach functions are available and have been designed on >> the lines of PCI framework. >> - PMDs register using DRIVER_REGISTER_SOC, very similar to >> DRIVER_REGISTER_PCI for PCI devices. >> - Linked list of SoC driver and devices exists independent of the other >> driver/device list, but inheriting rte_driver/rte_driver, these are >> also part of a global list. >> >> 5) Design considerations that are different from PCI: >> - Each driver implements its own scan and match function. PCI uses the BDF >> format to read the device from sysfs, but this _may_not_ be a case for a >> SoC ethernet device. >> = This is an important change from initial proposal by Jan in [2]. >> Unlike his attempt to use /sys/bus/platform, this patch relies on the >> PMD to detect the devices. This is because SoC may require specific or >> additional info for device detection. Further, SoC may have embedded >> devices/MACs which require initialization which cannot be covered >> through sysfs parsing. >> `-> Point (6) below is a side note to above. >> = PCI based PMDs rely on EAL's capability to detect devices. This >> proposal puts the onus on PMD to detect devices, add to soc_device_list >> and wait for Probe. Matching, of device<=>driver is again PMD's >> callback. > > These PCI considerations can be described as a PCI bus implementation in EAL. Yes. Or, we can continue as it is for PCI and allow more buses to plug in. And eventually, make the whole bus thing generic. Step-by-Step. > >> 6) Adding default scan and match helpers for PMDs >> - The design warrrants the PMDs implement their own scan of devices >> on bus, and match routines for probe implementation. >> This patch introduces helpers which can be used by PMDs for scan of >> the platform bus and matching devices against the compatible string >> extracted from the scan. >> - Intention is to make it easier to integrate known SoC which expose >> platform bus compliant information (compat, sys/bus/platform...). >> - PMDs which have deviations from this standard model can implement and >> hook their bus scanning and probe match callbacks while registering >> driver. > > Yes we can have EAL helpers to scan sys/bus/platform or other common formats. > Then the PMD can use them to implement its specific bus. And: - Framework/Developers should be able to 'register/unregister' buses. -- Just like drivers/net -- So, probably a drivers/bus/pci, drivers/bus/xxx folder structure -- and compatible compilation routine -- Or maybe librte_bus? --- I still haven't got around solving this. - RTE_PMD_REGISTER_BUS probably. - just EAL helpers are not enough - or at least, not generic enough. - Drivers should be able to 'lookup' buses -- PCI PMDs find a 'pci' bus during registration, for example. -- Unlike Linux, a device tree doesn't exist to solve this issue of which PMD is connected to which bus. This needs to solved using explicit APIs -- Once found, drivers can 'associate' with a bus. - Not just bus<->device<->driver, there is pending work with respect ethernet devices. -- Removing eth_driver->pci_driver linkage. Making it generic. -- Multiple places assume eth device to be PCI, rewriting that part. -- device_insert changes for vdev > > I know that David, you and me are on the same page to agree on this generic > design. I hope you will be able to achieve this work soon. I agree with your suggestion in principle - bus model is nice to have. There is always a better design. It is about how to achieve it. I still think that current SoC patchset is a decent first step without completely discounting any future changes. (Obviously, assuming it is not NACK'd by someone because of some currently unforeseen technical argument). Because: 1. It doesn't break the existing PCI subsystem anywhere. It is disabled by default. 2. It is independent - in the sense that changes are limited to SoC specific files, with only a few changes in EAL. But, clean patches make it easier to validate. 3. It would allow more people to check/validate the overall proposal of non-PCI device existence. 4. It paves way for cleaner transit to Bus architecture - rte_device/driver inheritance is complete after SoC patchset. Except changes in eth_dev/driver which is a completely parallel change with little overlap (but wide impact) - rte_soc_driver introduces 'scan/match' which can then be generalized to rte_driver in next step. -- This is very similar to what happened in rte_device/driver change where PCI things were generalized to common. > The goal is to be able to plug a SoC driver in DPDK 17.02 with a clean design. I am already working on that - now on a higher priority. Hopefully within next few days I will send a RFC out. There are still some grey ares for me (lack of DPDK internal understand, probably) - but I am hoping I would get good support from others - at least this time. Then, probably for 17.02, we can have either candidate - and we can integrate whatever looks best (in terms of design and impact, both). > My advice to make reviews and contributions easier, is to split the work in > few steps: > - clean PCI code (generalize non-PCI stuff) > - add generic bus functions > - plug PCI in generic bus abstraction > - plug vdev in generic bus abstraction > - plug the new NXP driver I agree with above. > > Thanks > Thank you for your time and suggestions. - Shreyansh