From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0087.outbound.protection.outlook.com [104.47.34.87]) by dpdk.org (Postfix) with ESMTP id 71F1C2B84 for ; Mon, 24 Oct 2016 14:07:05 +0200 (CEST) Received: from BY2PR03CA079.namprd03.prod.outlook.com (10.141.249.52) by CO2PR03MB2375.namprd03.prod.outlook.com (10.166.93.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.679.12; Mon, 24 Oct 2016 12:07:03 +0000 Received: from BN1AFFO11FD012.protection.gbl (2a01:111:f400:7c10::110) by BY2PR03CA079.outlook.office365.com (2a01:111:e400:2c5d::52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.16 via Frontend Transport; Mon, 24 Oct 2016 12:07:03 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; rehivetech.com; dkim=none (message not signed) header.d=none;rehivetech.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 BN1AFFO11FD012.mail.protection.outlook.com (10.58.52.72) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.669.7 via Frontend Transport; Mon, 24 Oct 2016 12:07:01 +0000 Received: from [10.232.14.87] ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u9OC6wfp016360; Mon, 24 Oct 2016 05:06:59 -0700 To: Jan Viktorin References: <1473410639-10367-1-git-send-email-shreyansh.jain@nxp.com> <1476539108-13170-1-git-send-email-shreyansh.jain@nxp.com> <1476539108-13170-12-git-send-email-shreyansh.jain@nxp.com> <20161016025658.5182b5b9@jvn> CC: "dev@dpdk.org" , "thomas.monjalon@6wind.com" , "david.marchand@6wind.com" From: Shreyansh Jain Message-ID: <78be76eb-2ce5-59be-5a74-fd7670364710@nxp.com> Date: Mon, 24 Oct 2016 17:38:29 +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: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131217844219545286; (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)(13464003)(24454002)(199003)(377454003)(105606002)(50986999)(33646002)(54356999)(76176999)(8676002)(81156014)(23746002)(6666003)(356003)(19580395003)(19580405001)(81166006)(93886004)(305945005)(7846002)(31686004)(97736004)(2906002)(83506001)(4001350100001)(77096005)(36756003)(65956001)(85426001)(65806001)(65826007)(230700001)(4326007)(8936002)(50466002)(2950100002)(92566002)(47776003)(5660300001)(86362001)(189998001)(626004)(68736007)(110136003)(64126003)(31696002)(586003)(106466001)(11100500001)(6916009)(104016004)(87936001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2375; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD012; 1:d98A7dpUyrYvMpr+Uj9VQBnp8Cnh9JO1BI2mTU7fWAm/LySHneuRYziphQNT90IwqRf83acNgDChVc46ipRgr97TVrfmZSHIhiHmqoUVAEp9GKbAPLgszKnrkhqv4sfKpzb3THw+vYAD7TDI2tjP7e7ZQPqyxgCGcGn8dN5/v3X18cT++DyQv4Ta/Y+fs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DjMTI1Dd7gxcOhZePqXejvXR7Jr33JU5hmgtmiDvbyInGSEsQ3mwFSK37MquZxHRdJHuTK0Vtndwr8ftmVfC7taxBj6CwkGysTYAF7OzeBcXT1poFA49BD5QSliiL9a6wrtDscHNSWLTfOSoMvtRzUaDjwWx7EQLQ75+JlOIxmt2jUy9DfOVCw5/6yX6RyrD58w8/rCb5zTxKOCW/0BGlL4kRAa+1BKMxKYEyeDMaNjRJ+v5QKHqki6viYgZnzlCEgRp1A2EQ9oN/CR5nlI07dnfWB X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13023025)(13015025)(13017025)(13018025)(13024025)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:CO2PR03MB2375; BCL:0; PCL:0; RULEID:(400006); SRVR:CO2PR03MB2375; X-Forefront-PRVS: 0105DAA385 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; CO2PR03MB2375; 23:jh9DVLVXQ6TuNwd6u2KYAWc/VBDt2aW6v5BME?= =?Windows-1252?Q?+At+rVhK1QHhcxZkllsUoAMbOwdvX7uLP+QObFX2VtmglUADdGKWWQ0L?= =?Windows-1252?Q?ztSgoy0FrLa5p0S75slVEc9EMg0I66Tq1CZKwMNvHrluNvhKVK1EanOI?= =?Windows-1252?Q?3ghiXW+UKm11KBcqEpe9noYQAdJAkLHu0jiCv9eDPcfxksKFqMn8/Xtc?= =?Windows-1252?Q?krN7RVfFWAGWoNsGCB/iRiab0tpgGVwgu2Z6vdfjBmZBW+5bcP6epw9f?= =?Windows-1252?Q?8AbJ4xpKVDSSyj0cRpVJ/rhMnZpZMpp8lH05AdvvLFfXiRsci/i+1w8R?= =?Windows-1252?Q?sCbAvxGFgJigV3c+3GzueUliNdI6KkBDiBPSCGrDmyc00QaRBYTc7dfl?= =?Windows-1252?Q?hHwmqFRihDsPcDNuHFQd1QxJbQo/B520oyAaT5GnhxNBKXQxmLPwr9DG?= =?Windows-1252?Q?b0O5kjOZZyTtHfFDuLAUvC6LO5X4FpWVMRRL7cMxTxBtB/2Syx3EFP0q?= =?Windows-1252?Q?HuFNn/DliIs+VlCZxjYtQ2/XWUMkB0E3ZffenmydKRMzsPyiist2Iu6L?= =?Windows-1252?Q?27NIc83FrH7RNfpF7EKvinkcrPhur3XtrWUENOikp1M2y7ifvpBEHgU0?= =?Windows-1252?Q?YrxdsYPXR+HoTccx4TOHZtnsjgainrikr1gSOQ1zd64F8MICzhsmkRAT?= =?Windows-1252?Q?7ULnHk3a24IrCs1148+WnNU6SvlQTCGRO3RDqgNga0msD7aCHMi2F7EK?= =?Windows-1252?Q?FRiYnNaTjLCYBZdp0sGpL9FmDucs5OtEpKTxhq5fuAEExdPz/buqFirS?= =?Windows-1252?Q?uOljO4HKOtcHlVvwnVtZUYVuVfvV4jOcW1k5TZ/G6tbFbCDrnWZyWXUn?= =?Windows-1252?Q?xw8jtE6sNntxGth2bijXRh0UmK7D9CQvEpcIlMZT6TmuFimOtcCGoxBs?= =?Windows-1252?Q?AzhRXm6gmBF7vZN6BTW0ir6/PSXbLhve7TfJjT9VABsjD5rN6JtTzL4E?= =?Windows-1252?Q?h6cG1R6D9PUbhoPumv52LYX7WI75pClCLmXupLSe1lqy9K/ErqwF7Bh6?= =?Windows-1252?Q?uNwaWeOUvYxr1utIOXlYeyHmoL4stHcCMYbhkYbjD+ON1wdle75b0pg/?= =?Windows-1252?Q?Mh1qnIEmxQVHGK1rUElH0GEuWhP2GiDJ29H1+FB/j37ju3bjwhmQjh3K?= =?Windows-1252?Q?iiC1AutnuNORp3/9F82hkSUzcnaifd/NZtm5d3P/X7ag0aovfW2CIj+I?= =?Windows-1252?Q?q7If/+FkVgyFy2kaDY3h3jsXSHEU4MIhIozsgFRyU17dfJf1wKuGr+uz?= =?Windows-1252?Q?vJquqxNc5NK5q8CCPkl3W5QA0xmO0h1ZRoeESnPkxQI9456JrzAGic/Q?= =?Windows-1252?Q?q5SM4yUJaKU/Y4gs2PQlqdBWJLp223nYoVwnOk9d9v3hDCwZLcl/InMz?= =?Windows-1252?Q?gKqRIVwUWC0KxHYUfFsj3liYvIDuc++WlyS0tUk6xn1dR/UgFjbqF/3R?= =?Windows-1252?Q?ioaTiJ17/vSNRIHhs4mavwUcLMz?= X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2375; 6:hdZ6lFAjp8SRga6rBlMPZ873/FnmB7zA/zny1uGfZhURSjhR5qrj4avY42MZbHlxRJ/NEDAsH9rU9iUMHqO4uAabtaSyrFslLVYTcF+6CQ2uL+uEIYVOF34jrI4EoCc3kOTIMD0F/WDQyxVO4RWQaL0+nQgiW+DDee3AtpYgyaLjm6ezHpWBpF0yb/3hPl0OV2pT0DNr4NTZQETuG9WV1Tjk+7NQOhts6zq4/J9ALZEXF04qnD3Ie1CjnsjAemc2ibcudotvQ/B6jVaaFU9791Z+lvAapSqbEImucQqODdc0hbbexmBrK5Hx07tVNXIF; 5:wUs+9mP10KJAnnw00o5/a6iSfj4lGHGcX1vja+8AWdZKdqfLNQq8cKlYAjmyCEmx+dq7gyXRzC0oDFS9frf05WkbhimgUiPb/SsDC2V45ocY2hW8TnGWhnKIyAfnnS9hlkVV3SxyQYVuJvt93j+FkBO3Wa6A3gELA83DWPeLTXSwSFjHS5HE7hrnmHGL/DKp; 24:1z6yapSiwZAH9B6E1RvvdKtDIjDYuK2oKPTh4ciGHwpWj4VLF+p7gOioBCpTmXfMrq73GV+VatnUHNjeQ5PzBoxhRFFzu6dlxaNRG6E6G3I= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2375; 7:bbIbXfeJ/zk707U7FrV2xhJJVPJD1LZC6aCzaGF5xrqhjNBgDiE7imsyQB8rd+xkZDd143JdSZfnuOcj5QV8a8FMcrQUqiIhHbmarb1qzLxabN2QHcFZkirdRYKUBoYNjqgMDM7osDV/O667T0aJl4r/eNVaVHXloJ4EN+b3xrk82YD15Gkh/lYLymjuPPrVIiFJQwr/nJ9Hr5gu3kpf6OSHKNMpq5jU2EQO+6/H7v3bX+/QhHxu4m+41XwZPPt4trxwzD3v0CKGpjC6uCpD0qeowaktezovNm6ejSlTCwLFc1c5VJ3XPcq0Zyy3Nz5kzl1lrVQ0g+p8uykcTg6itzjKXeyL4aLZNiyQqFSR4aQ= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2016 12:07:01.7205 (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: CO2PR03MB2375 Subject: Re: [dpdk-dev] [PATCH v4 11/17] eal/soc: add default scan for Soc devices 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: Mon, 24 Oct 2016 12:07:06 -0000 Hi Jan, On Sunday 16 October 2016 12:42 PM, Shreyansh Jain wrote: > Hi Jan, > >> -----Original Message----- >> From: Jan Viktorin [mailto:viktorin@rehivetech.com] >> Sent: Sunday, October 16, 2016 6:27 AM >> To: Shreyansh Jain >> Cc: dev@dpdk.org; thomas.monjalon@6wind.com; david.marchand@6wind.com >> Subject: Re: [PATCH v4 11/17] eal/soc: add default scan for Soc devices >> >> On Sat, 15 Oct 2016 19:15:02 +0530 >> Shreyansh Jain wrote: >> >>> From: Jan Viktorin >>> >>> Default implementation which scans the sysfs platform devices hierarchy.. >>> For each device, extract the ueven and convert into rte_soc_device. >>> >>> The information populated can then be used in probe to match against >>> the drivers registered. >>> >>> Signed-off-by: Jan Viktorin >>> [Shreyansh: restructure commit to be an optional implementation] >>> Signed-off-by: Shreyansh Jain >> >> [...] >> >>> + >>> +int >>> +rte_eal_soc_scan(void) >> >> What about naming it rte_eal_soc_scan_default? This would underline the >> fact that this function can be replaced. > > Yes, that would be in sync with match default. I will do it. In v5 I have replaced the name with rte_eal_soc_platform_bus(). This is long but it does exactly what the name states - scan for platform bus. This is still a helper. > >> >> Second, this is for the 7/17 patch: >> >> -/* register a driver */ >> void >> rte_eal_soc_register(struct rte_soc_driver *driver) >> { >> + /* For a valid soc driver, match and scan function >> + * should be provided. >> + */ >> + RTE_VERIFY(driver != NULL); >> + RTE_VERIFY(driver->match_fn != NULL); >> + RTE_VERIFY(driver->scan_fn != NULL); >> >> What about setting the match_fn and scan_fn to default implementations if >> they >> are NULL? This would make the standard/default approach easier to use. >> >> TAILQ_INSERT_TAIL(&soc_driver_list, driver, next); >> } > > I am not in favor of a forced default. What if user never intended it - it would lead to wrong scan being used and only intimation which can provided to user is a log. > Selecting such functions should be a model of PMD - one which is enforced. As mentioned before, I am not in favor of a 'default' implementation. Thus, I would rather call these functions as 'helpers' rather than defaults. [...] - Shreyansh