From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-eopbgr730045.outbound.protection.outlook.com [40.107.73.45]) by dpdk.org (Postfix) with ESMTP id 2D59A1E2B for ; Mon, 9 Jan 2017 07:25:00 +0100 (CET) Received: from BN6PR03CA0029.namprd03.prod.outlook.com (10.175.124.15) by CY4PR03MB2472.namprd03.prod.outlook.com (10.168.165.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.817.10; Mon, 9 Jan 2017 06:24:58 +0000 Received: from BL2FFO11OLC001.protection.gbl (2a01:111:f400:7c09::180) by BN6PR03CA0029.outlook.office365.com (2603:10b6:404:10c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.829.7 via Frontend Transport; Mon, 9 Jan 2017 06:24:58 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) 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.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 BL2FFO11OLC001.mail.protection.outlook.com (10.173.161.185) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Mon, 9 Jan 2017 06:24:57 +0000 Received: from [10.232.14.87] ([10.232.14.87]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v096OtPb028749; Sun, 8 Jan 2017 23:24:55 -0700 To: Thomas Monjalon References: <1482756644-13726-1-git-send-email-shreyansh.jain@nxp.com> <5088350.GnaeIEgOPh@xps13> <7af56aaf-b4dc-4933-588d-d0c375d23844@nxp.com> <2232398.sT6R6nRinv@xps13> CC: , From: Shreyansh Jain Message-ID: <25261ee3-120f-7821-0217-35bfec3bc0fb@nxp.com> Date: Mon, 9 Jan 2017 11:58:27 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <2232398.sT6R6nRinv@xps13> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131284166977911009; (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)(39450400003)(39380400002)(39860400002)(39850400002)(39400400002)(39410400002)(39840400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(24454002)(377454003)(377424004)(65826007)(626004)(2950100002)(110136003)(77096006)(4326007)(64126003)(50466002)(2906002)(6306002)(23746002)(4001350100001)(38730400001)(97736004)(4001150100001)(229853002)(6916009)(230700001)(6666003)(47776003)(65806001)(83506001)(65956001)(54356999)(86362001)(356003)(76176999)(92566002)(305945005)(31696002)(36756003)(5660300001)(85426001)(104016004)(189998001)(50986999)(105606002)(54906002)(106466001)(31686004)(69596002)(8936002)(8676002)(81156014)(81166006)(33646002)(93886004)(68736007)(15395725005); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2472; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC001; 1:R8cu6c9FnYUMnuNr0rC+ya7wDoBS7JWT3S9ArRIvwSb3eZNlGJq/1RoOI/aSyAUG8swNmKH1aAAGll9KpewkPbb0j9isItO00cXOOGVy7aiKSTrqh6FJa/H5U/WT9YrLe5ubHbEV7BbB+Jqf2+yDJk+B7ylbXOuxr0Ng1fllHyRp2lsZNfZcPELbM+E42GH5/eXlBNXLdJCQLalOUeYY2aTz059ljbt8mdK79XEMqBaGJQIpxqIaVojT0rr9gEpjzfc1xpERBXhOAXngDVr5KmybLKqFbyW5dxo1LHr/Cd1Rh2+wBy2m7hRqFCbbf+C65EOUEj9jZ1SV54RgtSNUi2VWcDvDb4X0Ieg6JFMBLX+v8pmKWhEfmZR7zwKiC0Ev/voU/6wHcXW/EpHGjwohesJuvMQxjtDAiNtnCIwWhYeBe/80Jk1KpS1oKUfdOX2i+8E0Qnv6Oy2qkhnh9znqyyBZR05NsPhAAIrhFRItZ9zC2eaRUYtZacHOuflGexEhKSO1sB5lLr5rW2VvnO5x+/oCCoiimQRYi89MwTMZb+D1aBkmsjOL4rp2pCDD43QG X-MS-Office365-Filtering-Correlation-Id: a8426373-418e-4e25-9788-08d438583bce X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR03MB2472; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2472; 3:EhlIlWKvoi/Ej4QwuZ4MsNsc/9spK1bBBmWFe7aUd3UoxSQ6hpXdVmqmAwIpbmPzD+B/M5JWv68C7ri6B9y4WiNSqOLFNskhO3sw1HhqSbNO3WreM2lB5JelWfGd2H2+WLm/Q6kc7fZL3n7z18oZXPsSb1k+jTKAz9wr0j5NTdkFMhN57at17eHGzz2tG4xntK1EQLW+cQSJGqI6em7NOCr2Ld7v4fnYNXo1QIELmsYXYfR/Cfa14JoxRHVVLy8xbT2C/m2sxsyzdpMKsOk3hogi8wZKo7X9uaM6xzJbfXPd1hmZbPQnF/ih+mgiTCc6nWJ+oCziSeyUCEBPze2C1ghVzYSboiGmjPkRi+Z1Ws8ui/2qbw95UtTHU6xqgOFg; 25:mkHrheBNZTD1NdHtB6gJ0i3QVaWrlat7EnPgU/LUx9dUv2uJos9iSBXVa86wYzaRu9ER7+4vzrN+gwXp6MHWDB61lPLPf3vrjKY7bB7ZRTUHKtSC+8mWkE7/7Qyh30RVTVK3Pf0DGCgFQMLf53ZjL16ltmrxaX91c/nASuy7EXIKQyGGgc8kfrHtbrHAgncch2RPfOCTQm2/CUunj3YDguct0fWrxqJZUl2L+eZpxseOcUHj55H4dr4ZgnZdL/dDG4jlJJfC6U0YE9hlTUVPxYvSe/4hFy6BQ0fMzBa+7em/wLzUzTxbxwAAxKWboXs1z9rKUCi0unGQQ1v7nqDaQWv1broxjuH5QRBr3Qy4QHD3Z4SGPlbV1OcKGVf798WtU6Pz34bmTAY3WubBGt/cHDP7iHKB+4cr/4/4McvgNbOQOZ55hBcul6TgruxrAr6D44aAlORa0MW4wjvMLUgZMA== X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2472; 31:NcbbhyZ5s3uQ6hqEKy5eW8bu81t8U0fMZaeRFDZAPBZtJYbDPRmNEEra0SRrH4A6iqjE0kdIW9UqtJWel7y1ykftr2hjhFdlHfiotL/kbi3cnJteyD9E7FzNM4dPNWJFfogc7UcshMWsiPHumk0C3zs/86YuHxGNGOWzfdQK8VmhDOcWZruHJYtRZugp07TqNG2CprvhEwIKokVe5YyVco7MZWtL10k/wOCSvYCuZrw9HHx3wOiv/LkuKesUe/RYNl8cfGRZRfa//sanSQdBOG50EG8aZ140DCMX5JyAK/c= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13023025)(13017025)(13015025)(13024025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6096035)(20161123561025)(20161123559025)(20161123556025)(20161123563025)(20161123565025); SRVR:CY4PR03MB2472; BCL:0; PCL:0; RULEID:(400006); SRVR:CY4PR03MB2472; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2472; 4:UqV1y6e8WCTf+dEogaFR73eD8N5GeauH+XkK9UtaePqPJRLPVMUshlUZ2iFXAEK0fh26XLSJcFJYsdrIgKCincx2pUttHxUg1FgkxsNu3IlX02Nba0X6y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rz72?= =?Windows-1252?Q?bHvY0WC74OW/NlobXH9t9kr8mUUmUe49kNXkVkVLjBf53n6zr2QQWUml?= =?Windows-1252?Q?u3I1wzeBqhwk1AgDLx6mBawopPUZmkPS2mi/jeWHQBH3IG7b//Venuuv?= =?Windows-1252?Q?3A/FzwmCiFkW5eBaurtzrFOHNjaUFiNWfKPHGHOYU9jAHzMxDtxCDy2c?= =?Windows-1252?Q?f6hHd1a9vti+rUv4JDASUI2AdD9Ex9rdAId1644eWMG0ropc8XBoJAQV?= =?Windows-1252?Q?e4mQk6ARcPcOkw7ioOAIaSn6JlQTcaYEt+sIHRnYGIE4Q7mTtraVGg50?= =?Windows-1252?Q?OvU3ASmekbN8ZATnjI9ODS0aDleZeWPd4qrfLCly3lu7KN2AuClSBMxx?= =?Windows-1252?Q?sm+VMwlUW23Pn6aDflPtu/vY7avnuVqveTHp+jfcb7V+Qs88o8IO1E/h?= =?Windows-1252?Q?axmTl7ll2mk8eHW5dcQ3obWwVjX7gOYabT/aPIkvC7/npfYwuLYbAOTw?= =?Windows-1252?Q?E/7rv61oGxuS1a30+YrJMp+M27HVNffE/IIrc859JDW/URaI2M/4TcRS?= =?Windows-1252?Q?j435gdfVO8R5fDqmkbajYMnXvW7TvYnWhq+/6qrAGq31wJDIE3dsPSXR?= =?Windows-1252?Q?dYtCgwxH8geDWubcH2hf2ob9lGlTv1SEMFMVNOawptGsHEzqNLDqnM1v?= =?Windows-1252?Q?pBKovZ+PlGoFO4VmJKf+TijUS8AsroKMJiQJn/epCIr19tF+a627rIXJ?= =?Windows-1252?Q?Zr7CqSZM7lfWVdIIkuV8GXBnDpGifwKaN9h7KKVXseLTja8vXMomgKcI?= =?Windows-1252?Q?2w8IU7M2tQDcxMUKQqaShY6c3lCfRif8XuVmWFG0+GwLfoj35Oi5y8As?= =?Windows-1252?Q?eWn8FfxtZb8Ri0Y7qKHdk95BEZ6wPD9/Rf2ixBupF2Y0GyFDBCccXchJ?= =?Windows-1252?Q?Te0oQ9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9P/rASosgzCk3gGffT0qFDxi; 5:tsfaAyuRP0o1YJKmFSHYRJQ3Zuvp+S/S2HF9L+ElNshF3p32ZC8htig5qjoqpZQwBkcKy0UbVcSaTh7CvsPll1/O63JvylfXIGNEA6NZCfdYBMOIrH1bxVkyHDxBzuGG4Xac1APWEVKCFL3I086u4wEmBYdwvFxNwgBK7GeIiCWKqkXt3FJrpBC1zgp7h/iZ; 24:GtACRvcQT8d4KIAJ0zKCSoNYrk6GGd8V49SEzcsPMmW6myS34JiiszFeQiPOXWqs6ljI5ntAwQIwhmxaVTMJ2pcy4oMJeHYexJfhPGdXilw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2472; 7:J5cZu94Pdcs8ZidpBpXeMVp5uwWpEZ3hQOoFhr4XA2ovCnkev4ssRPYRWMF6N8YZAOEQbkB77c+tMTSiE/hqmNTI3poGwK+IxPLEs8Wf/rwL987sD5eiSQO6k4HZkwS/9R0lS3P52RObLQBgWGKHb2I4DNV/Gx1zZwE/0TgsspJO9O/Pr5IIT5F5FHn9PLk5Rnv0CfniGIRkMF6CHus2HLXlRMTkjCvGlfACx7YHBZxHFdpFK9BnifsspxV3+9GOk2nx6SEE9oaWAqah8oAmLiAEWWF5gMlyQlcFnlRfhz9vu9Ab3ExS9NSioYoQtwxr29Qm2i7za045H6l1UNT/kFnnEJ0HbzqEp7oYGpyUAOSA8NLlXtiCVJmfSfJaOWGuGmcx4RBR9LgyVRIc307iWd3DI0V0IP/k0UulKoUgwsqo3AkT9MP4MtRQFWa4WEAy2vAR0c5zBlkV7sQdsiWRfA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2017 06:24:57.5571 (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: CY4PR03MB2472 Subject: Re: [dpdk-dev] [PATCH v5 05/12] eal: add probe and remove support for rte_driver 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, 09 Jan 2017 06:25:00 -0000 On Friday 06 January 2017 08:56 PM, Thomas Monjalon wrote: > 2017-01-06 17:14, Shreyansh Jain: >> On Wednesday 04 January 2017 03:35 AM, Thomas Monjalon wrote: >>> 2016-12-26 18:53, Shreyansh Jain: >>>> --- a/lib/librte_eal/common/include/rte_dev.h >>>> +++ b/lib/librte_eal/common/include/rte_dev.h >>>> @@ -152,6 +162,8 @@ struct rte_driver { >>>> struct rte_bus *bus; /**< Bus serviced by this driver */ >>>> const char *name; /**< Driver name. */ >>>> const char *alias; /**< Driver alias. */ >>>> + driver_probe_t *probe; /**< Probe the device */ >>>> + driver_remove_t *remove; /**< Remove/hotplugging the device */ >>>> }; >>> >>> If I understand well, this probe function does neither scan nor match. >>> So it could be named init. >> >> Current model is: >> >> After scanning for devices and populating bus->device_list, >> Bus probe does: >> `-> bus->match() >> `-> rte_driver->probe() for matched driver >> >> For PCI drivers, '.probe = rte_eal_pci_probe'. >> >> For example, igb_ethdev.c: >> >> --->8--- >> static struct eth_driver rte_igb_pmd = { >> .pci_drv = { >> .driver = { >> .probe = rte_eal_pci_probe, >> .remove = rte_eal_pci_remove, >> }, >> ... >> --->8--- > > Yes > I'm just having some doubts about the naming "probe" compared to "init". > And yes I know I was advocating to unify naming to "probe" recently :) > I would like to be sure it is not confusing for anyone. > Do you agree that "init" refers to global driver initialization and > "probe" refers to instantiating a device? Ok. Makes sense as a standardized way of differentiating 'init' from 'probe'. > > If yes, the comment could be changed from "Probe the device" to > "Check and instantiate a device". Now that probe if removed from rte_driver, I think this would no longer be valid. [1] [1] http://dpdk.org/ml/archives/dev/2017-January/054140.html > >>> I think the probe (init) and remove ops must be specific to the bus. >>> We can have them in rte_bus, and as an example, the pci implementation >>> would call the pci probe and remove ops of rte_pci_driver. > > I do not understand clearly what I was saying here :/ :) > >> So, >> --- >> After scanning for devices (bus->scan()): >> Bus probe (rte_eal_bus_probe()): >> `-> bus->match() >> `-> bus->init() - a new fn rte_bus_pci_init() > > I suggest the naming bus->probe(). > It is currently implemented in rte_eal_pci_probe_one_driver(). > >> -> which calls rte_eal_pci_probe() > > Not needed here, this function is converted into the PCI match function. > >> -> and rte_pci_driver->probe() > > Yes, bus->probe() makes some processing and calls rte_pci_driver->probe(). I have made some changes on similar lines. Will share them soon. Then we can discuss again. > > >> and remove rte_driver probe and remove callbacks because they are now >> redundant. (they were added in bus patches itself) >> --- >> >> Is the above correct understanding of your statement? > > I think we just need to move probe/remove in rte_pci_driver. > >> Somehow I don't remember why I didn't do this in first place - it seems >> to be better option than introducing a rte_driver->probe()/remove() >> layer. I will change it (and think again why I rejected this idea in >> first place). Thanks. > > Thanks >