From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0055.outbound.protection.outlook.com [104.47.34.55]) by dpdk.org (Postfix) with ESMTP id 4ED2B2BA8 for ; Tue, 6 Dec 2016 11:43:09 +0100 (CET) Received: from BN6PR03CA0031.namprd03.prod.outlook.com (10.175.124.17) by DM5PR03MB2476.namprd03.prod.outlook.com (10.168.233.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.9; Tue, 6 Dec 2016 10:43:07 +0000 Received: from BL2FFO11FD047.protection.gbl (2a01:111:f400:7c09::125) by BN6PR03CA0031.outlook.office365.com (2603:10b6:404:10c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.9 via Frontend Transport; Tue, 6 Dec 2016 10:43:07 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=fail action=none header.from=nxp.com; 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 BL2FFO11FD047.mail.protection.outlook.com (10.173.161.209) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.734.4 via Frontend Transport; Tue, 6 Dec 2016 10:43:07 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:869; Count:13 Received: from [10.232.14.87] ([10.232.14.87]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id uB6Ah39n010670; Tue, 6 Dec 2016 03:43:04 -0700 To: References: <1480846288-2517-1-git-send-email-shreyansh.jain@nxp.com> <1480846288-2517-9-git-send-email-shreyansh.jain@nxp.com> CC: , From: Shreyansh Jain Message-ID: Date: Tue, 6 Dec 2016 16:15:52 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1480846288-2517-9-git-send-email-shreyansh.jain@nxp.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-IncomingHeaderCount: 13 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131254945874828025; (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)(2980300002)(1109001)(1110001)(339900001)(336004)(377454003)(24454002)(189002)(199003)(86362001)(110136003)(38730400001)(229853002)(4001350100001)(97736004)(39380400001)(39400400001)(39410400001)(230700001)(31686004)(6666003)(6916009)(2950100002)(85426001)(5660300001)(4326007)(65826007)(626004)(83506001)(2906002)(31696002)(39450400002)(189998001)(77096006)(39860400001)(39840400001)(39850400001)(104016004)(23746002)(47776003)(92566002)(8676002)(76176999)(54356999)(50986999)(65956001)(65806001)(33646002)(7846002)(105606002)(356003)(106466001)(69596002)(36756003)(305945005)(50466002)(64126003)(81156014)(81166006)(2351001)(8936002)(68736007)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2476; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD047; 1:lFgRdcriAMaUMF2aG6YW++kLajNHX5cRYjnKjWNCfmZXbCl6HC0bb5pr+iCDDJMrvY1onf9jo7gYwICG7C6GCGGw8lh3x+YyBjy2GN9NnTfOuyQ+Zgf8ewyJKW+SiN38ZXTy6BVYTSkN0dYm9m1eSoC+Tnyzx9szi/saVttZcJx6WW8GG9wIh1Vr90SyrST2zm/WKsbpejqme9MQmLqMJz5FhnYR6NYtx39btVtep+tYWX/jR/QrhmXBoXNsV3vO0AWJyrxbgVaHVmmfV5ibzCrPMSFicNAyf05Pkp5vQGhbyk+dl7AgrDD1+toWAdilmVhKVwyrZ54apQukTVHCOx4FPJ8JX4n4ztKB0XklvBajgq7vKi7C47uoTKPK76jpnGF8K6qzcBT5MPsZu3Jq9y0Jtj+XTUIHMKvL4OoZwhlWzq176xhHImOrLhlyM3n/GxIPT9Zp3u2M/fmO5eNRxInw7mQcm3PfllBTTcp4cuHgkST6KtLQm5TSDzjPthzsj3QnwJvX2SHcv4GY1UmsKBAeB8A4SItW4O+gSogF9X1gUKUY4yWxh03RBMK1a7qIoKwpj6d6NTbh/qvgHIWZyxT4pfyn8R4Tzih0mILrHoY= X-MS-Office365-Filtering-Correlation-Id: dd2e8de4-4da5-4600-799a-08d41dc4aa56 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DM5PR03MB2476; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2476; 3:eHNdlg4nYY2NJs7ieLntJZFM6GySx/SGFpdybDiD4oSCYe/veYl8WKfWWJ6AKTt2I6bjl7TAEoeMONhni3d+/RGbbsQfvfmwJ59pnHAMJCgCUJqRavoqtQ7WZ1HJV9JS6YHtuSM4TbIDRtBXO1wc8MosKKBkRBWC6L1g+rqNqIQvk7MkLc5K8yhzgB0u1rq4MVY3MqSmBQl8rXSXjemRX634QotXm0CqCiTRff5ngIQfbv9M2Q47F9Cu/qjxeeIwe3NEcdSR4P9rHIsx8/1l+4wfZ1FpagU7fo7Tg76YHntXnDsvJ3bD8/30h0Qu8pnjfQmlQATp1zklqxcSsfD2w9mwy4qMPxEKjtl556j412hsF00pX3OTrNqwoNZOoFb0; 25:gPYoiHCT3YeQwW6iASHkcuq16x/ReTMISwFP+GT0DEGXrngzRRxLPH1dZr/6EzEQGoT4l8zZ7n8S/QjMyTvoAtb2zlHYfoCubYSbe6PG0mIE5s6XXhBGTsO1fCKxHwuEJDTCi0THrrQuTQ6kN84PWLTxxVGwe81r/mNFypR6nwvigjsW24M52ZXxUMqKx9w0MzLETjNFPzPa8jsx5Gd7i/PVQ25n1n9CmSbOXLUOnl+5/J3p0WV95LywCcWjMRA81D81PKgviSrBwYQNL4XS91WaoEC0nxXm7B1KpysL8CXTogcbHmRAYPuUzAvLNyvyggYq9IHZM8LlKElc1WDEPURQeEm6bH3gufwTJx6xxmNfpo7QcO+OqzCM+6Y4aPf1dKaOiEXOq1eyHwBodGlH4HxD8RLx54IIRYtWytKnuP7ZhW/tzWV786yFMkcAMCkjHGoq25jChj141FPU5fc5lQ== X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2476; 31:TlM2IAQZTHXemnVu8Zu9ZVWvpYIHX56kgDSooBZb0OKnA8qGdgAO0g+D49xnaWMmJKj1N6fkFvwE9GH57VxKja8JQIjBoj0hLknoOM/r1GLweMvUTFdFVOfP+tFigcT9KHFB+Yd96+nEIRw39avijPIgyJW3oDntn6UNe2BI7l6E7Rg5v02fff96Kfv4PN0Oeizd9TtUzehKO0oFLYeOdZ6NGSaJ3V1bVBEdf3nMY+qJjgf/cbSQ4PRH7ecPLwRwrKZWZxPSI8yqG61921cEz+ZNhgkh76KJE64DXZpuZ00= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13017025)(13015025)(13024025)(13018025)(13023025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6096035)(20161123556025)(20161123561025)(20161123563025)(20161123565025)(20161123559025); SRVR:DM5PR03MB2476; BCL:0; PCL:0; RULEID:(400006); SRVR:DM5PR03MB2476; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2476; 4:0pM4DH651zPkj1FHh1TEvlQ2Ewpaz0hQ87/dTgxhIZdVSMfc8tFxO8nCBDKXltE0z6fusbNf515qkpE3mvb0GAwTxDbhnmbYDWlaGQC6DwHrWFR6QMHBs8tKzNjX1BbF+IXuXjDMJPiWROobAxS730VOVurxtUVzDM2LmJhbJkANKl2Es6pdLUiHp6T/jABMLHTRtEEjKBv76NMuaDR5Ylc9q9mjTt45PyJWU+RCKeMi1quXj3ICxBwosqRj5yGFsS5YIvfTWMu429ywiMuV4RiPSMX45aMUXUaLpRMxD++hFC/b9+5arhFYVhiAgWHBqzDws8To5JjDP4+SVdPJZcnGx0IZaoBAnwCPDMVL4vOhPEqt7SW1B4qis9B/Vi8/r5rQbv9Rzy8JxNBbAc7Sj5VsVRfAETQk1uHn0vrWC7l7LA0w7y78ACWmYHWqXcLt7wT76XiIjEcAk4lDm/fX2pvrQNlC6732dIA3zfW1UIVEAHkI7hXgWWa2nd3ELa0Ftd+NFYsHmLXxYqxnP2dpjWC59IDY1lvyp2wF1s0LfX0gPYVOIBSe0sy8/8PfFRVd9vPjFx0iZmddw4EeVkveH7FLO7BEuOtUky+cpX1esp9vuUjbki/YeMXYzyY11UQOgVvEXoapem8qHNZMo4SbCPqsceXXZVYex/1ETy4e8ixjgBXMQC1hjCcBe/aXW0c3ddzbG04xif5zpUI28WAyfMoRgyIZ8bXpL2W6ooIHExLj3TyyDozy2hmo+4+SHzVT X-Forefront-PRVS: 01480965DA X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; DM5PR03MB2476; 23:uZQzADZpCXO7achqmeOFncnhEW6dtxK3rFLA9?= =?Windows-1252?Q?kOLLOSJ723iI8YQdG0OB36f/FToU1HlXVI6BS9Qce/z5YtfxdgFnYLyq?= =?Windows-1252?Q?zSIfqCqvg4Y8Y1tAN/3J2ezR1kdl0aRUrMLwdZagwRHSSTmsbJMZY5e8?= =?Windows-1252?Q?DbWgfZFOhsNa9fRMxEue4mkf3GdUtSfyioHVQkawl6TItNlFzV+S6qvJ?= =?Windows-1252?Q?AtNE1Hk1/+14jrozj0/MNeu1/4mx1xQ4YqEtj8x/IjGxpfdopFE3MlIy?= =?Windows-1252?Q?nxPOeBAIzVjIuZNQZtDI05blfA2l5GbFw1ktqDpwFt5qyYOr19Ku0w5G?= =?Windows-1252?Q?+JOT22IkbEvsSPGMQ0PllProiq5Zm6WXBOSvf3lRaxLB6GSJjZdHZxpU?= =?Windows-1252?Q?fuUu9HkOt+dmOnSP6L2i08BquUjpSVLv2adTYLX+hhPc6k2s1vI99RdV?= =?Windows-1252?Q?CyD+9GByKa6/qkR2wV6YFSDr628gLasygfplD2MnFVAlk45IY+LgHh8D?= =?Windows-1252?Q?goLc9lNDg6SFk0HVnQzKBQ/dteQ8pvLLo4ub+2inFeFq496hs4GyJRTb?= =?Windows-1252?Q?a4+PBqDwGSNGb84UHnXV25SW+YIHFLUskrBX9enb0DQlJ76TjNkopRne?= =?Windows-1252?Q?YOxNgKPj7gVP+YJ+k372JEWz0RmVyboxJKHXL494BLxrtJRe0Yy6F8Td?= =?Windows-1252?Q?Cn9DCHspNcsZkWZhOzlEHWfbDNFTwLff0LdiOWmz4mJxfOVs1VX0Hdsv?= =?Windows-1252?Q?o9Xvb776PJKC2XG58mMb47BfXwPEAsfYq4h0gL+M2ua9AJU3gCMvh4JB?= =?Windows-1252?Q?6wuk8/ysobdgfZbvg4FWiPlKib1IxMWV39nwwj+WoHTyrggT154Z7eO3?= =?Windows-1252?Q?1L4dcTH7ltFTnpTknSjdW3loWVyDiiheXMG7OvrJUeRAjrGHqmfHP1+T?= =?Windows-1252?Q?lcu7slH1IB1s2Hp60X6PrhBFrv9zutkRqLwrvX47jxsS9Ld9pa3zslYC?= =?Windows-1252?Q?zTFhlJTorNY0PHa8n+Vic/JxGbJ9Ylqaa6aTCGS8tUYZt+hYXFJDaDA8?= =?Windows-1252?Q?fEIz6D5aUUMwwq56+I+saBEWWgKvx9OBaVZyPTF5Oxvyrd5oucavO4Ao?= =?Windows-1252?Q?w/YxeIlq8YFR6otM4Z8QQ7H2F6hBpJKwzWT3IBDKVWvHnHL8TlbXNDpk?= =?Windows-1252?Q?M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J; 5:+H8kDSnsF070BU8kIFw9MvN8eXPeU/gc2rDJ0WiycSMcO2Im6q8/eGorFXyifccwgBCU4wZAPzEQ/ueCcsOsdjJ7stj8MPWCGdQkR0JI5Gxnp7FjusafYJ/ZunUhzKPB2qZPVHURrgAIhjruKpOhrm37d6LX22n54X8n2dE68puVID9uQ2UEyJwPh1ciAlYg; 24:eH6B56RYg/cClkzopX72LoUUMcyXAMX4w5g+3IZmx6s58FhofORXxXPfGKw0uvcwAoisvS9K3EbK7ZAqYj81XuJ+bXnjZraMoPR+snrr+r8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2476; 7:UN1TQbkmK5Z+m4kMYPGye5AaZ3BP48y1n6qpJVxwgo+D7Srq60oKfJv+Mz3kydZE9EkPAMIPDVraJpfhV5oq1B+hQ+265I7xW6OuVzT0FILa48A4wKtatM/I1sHPt5HJGxJAD/J7C+xy8KCj8qAT1mnAQ4Pa11GzF9b+YMOeJQlRp9L57X3F1vf4piiZg+El1e2rlxUz9bXjgtYXkSiaZS8SmcPnCctUInkQ5kq4hRvS32diPVD/boSHk+FRh7xS+O9kOZW/W+hravUyGCewnx6ReG3zGcIBLObMbECtBdFNNLv0S9ukMXNN/O+mu+a5FcvIz1ZLyTbJ3QsQ8UMjM5rw9i16zSmzolDCnTGXnkKcsu6uVppF+u8N5SRUNnq9gn3g1ugs4Kc6oVXAXMZArRckDwF8jr/JLct+Fm4AqCUiFVGMXEOiXe3Pb1M2ynxIKB7QegB5tFZqOYk5P10rFQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2016 10:43:07.2488 (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: DM5PR03MB2476 Subject: Re: [dpdk-dev] [PATCH 08/13] eal: enable probe and remove from bus infrastructure 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: Tue, 06 Dec 2016 10:43:09 -0000 On Sunday 04 December 2016 03:41 PM, Shreyansh Jain wrote: > The model is: > rte_eal_init > `--> calls rte_eal_bus_probe() > This iterates over all the drivers and devices and matches them. For > matched bus specific device-driver: > `--> bus->probe() > This would be responsible for generic work, equivalent to > rte_eal_pci_probe - specific to the bus. Handles over control > to, > `--> rte_driver->probe() > which works equivalent to rte_eth_dev_pci_probe for alloc- > -ating a ethernet device. This would hand over the control > to, > `--> rte_xxx_driver->probe() > Calls driver specific initialization of the eth_dev > Similar to what eth_dev_init of eth_driver does. > In further changes, eth_driver would be removed. > > Signed-off-by: Shreyansh Jain > --- > lib/librte_eal/common/eal_common_bus.c | 50 +++++++++++++++++++++++++++++++++- > 1 file changed, 49 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c > index 67b808b..469abac 100644 > --- a/lib/librte_eal/common/eal_common_bus.c > +++ b/lib/librte_eal/common/eal_common_bus.c > @@ -195,11 +195,59 @@ rte_eal_bus_scan(void) > return 0; > } > > +static int > +perform_probe(struct rte_bus *bus __rte_unused, struct rte_driver *driver, > + struct rte_device *device) > +{ > + int ret; > + > + if (!driver->probe) { > + RTE_LOG(ERR, EAL, "Driver (%s) doesn't support probe.\n", > + driver->name); > + /* This is not an error - just a badly implemented PMD */ > + return 0; > + } > + > + ret = driver->probe(driver, device); Just noticed an issue here: It is unlike what I have stated in the patch headline. bus->probe() is not getting called. Just to open a debate: eal=> rte_bus->probe() => rte_driver->probe() => rte_pci_driver->probe() is debatable. 1) bus never probes and 2) it just looks very odd. But, if bus->probe() doesn't happen, which layer is responsible for things like devargs which currently rte_eal_pci_probe() does in EAL. If rte_driver->probe() does the devargs layer, eth_dev allocation might be shifted to rte_pci_driver->probe() - and subsequently calling rte_eth_dev->eth_dev_init(). I do need to get my head around this. Suggestions would be really appreciated. > + if (ret < 0) > + /* One of the probes failed */ > + RTE_LOG(ERR, EAL, "Probe failed for (%s).\n", driver->name); > + > + /* In either case, ret <0 (error), ret > 0 (not supported) and ret = 0 > + * success, return ret > + */ > + return ret; > +} > + > /* Match driver<->device and call driver->probe() */ > int > rte_eal_bus_probe(void) > { > - /* Until driver->probe is available, this is dummy implementation */ > + int ret; > + struct rte_bus *bus; > + struct rte_device *device; > + struct rte_driver *driver; > + > + /* For each bus registered with EAL */ > + TAILQ_FOREACH(bus, &rte_bus_list, next) { > + TAILQ_FOREACH(device, &bus->device_list, next) { > + TAILQ_FOREACH(driver, &bus->driver_list, next) { > + ret = bus->match(driver, device); > + if (!ret) { > + ret = perform_probe(bus, driver, > + device); > + if (ret < 0) > + return ret; > + > + /* ret == 0 is success; ret >0 implies > + * driver doesn't support the device. > + * in either case, continue > + */ > + } > + } > + } > + } > + > return 0; > } > >