From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0079.outbound.protection.outlook.com [104.47.34.79]) by dpdk.org (Postfix) with ESMTP id 100DD69FC for ; Wed, 11 Jan 2017 05:49:49 +0100 (CET) Received: from DM2PR03CA0004.namprd03.prod.outlook.com (10.141.96.14) by MWHPR03MB2477.namprd03.prod.outlook.com (10.169.200.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Wed, 11 Jan 2017 04:49:48 +0000 Received: from BY2FFO11FD015.protection.gbl (2a01:111:f400:7c0c::189) by DM2PR03CA0004.outlook.office365.com (2a01:111:e400:2428::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12 via Frontend Transport; Wed, 11 Jan 2017 04:49:48 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) 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.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 BY2FFO11FD015.mail.protection.outlook.com (10.1.14.131) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Wed, 11 Jan 2017 04:49:46 +0000 Received: from [10.232.14.87] ([10.232.14.87]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v0B4nixj003314; Tue, 10 Jan 2017 21:49:45 -0700 To: Ferruh Yigit , References: <20170110180250.10625-1-ferruh.yigit@intel.com> CC: Stephen Hemminger , Jan Blunck From: Shreyansh Jain Message-ID: <98f6a6d8-f9d9-2a4d-8100-422d0f41d81a@nxp.com> Date: Wed, 11 Jan 2017 10:23:15 +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: <20170110180250.10625-1-ferruh.yigit@intel.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131285837873310122; (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)(336005)(7916002)(39400400002)(39850400002)(39380400002)(39860400002)(39410400002)(39840400002)(39450400003)(2980300002)(1110001)(1109001)(339900001)(3190300001)(377454003)(199003)(189002)(24454002)(81166006)(106466001)(81156014)(68736007)(77096006)(23746002)(8676002)(104016004)(36756003)(229853002)(8936002)(50986999)(2906002)(76176999)(5660300001)(31686004)(54906002)(4326007)(54356999)(8666007)(189998001)(105606002)(356003)(305945005)(4001350100001)(65956001)(626004)(65806001)(5001770100001)(230700001)(47776003)(97736004)(69596002)(2950100002)(65826007)(92566002)(5890100001)(6666003)(50466002)(86362001)(38730400001)(31696002)(33646002)(83506001)(85426001)(64126003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2477; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD015; 1:II4Ixe0yWlTOC/WR0fuPwQZCq3NcLLnfQpfHEhooRGgDSckCyx7e8p9UZcjuGa+x1DVH4jBzcoDyZ1Pql3v9n67GxPp/Z+inuQzBbTx1izVyZHnlSNyzODGulKPytwmSlM7RZQUqiI4wnN9rgleCYXqSnxrACGK3oZJFe+2XkujA+4r8MZtDERJ+aGi+NNcGuXQ6dcv6HmdGCupvNqHcStPBWf7eL9r92bHs0Fjg3mhPUhuSAXFYno+Kbw8A32iliTyaPIaAyLDo7tu8ywdlRKS7SAAPFX1GHwDTMgFKiM0k1w2MAEHCASm5vpVgmUv7kAHFqaBQZZ6xhUeRs3EMUUDw4GXjLDvSgIMCK55Yf3iEzlX1NcEQ73j5ID87D1pxzQzhJDdgOwSioH75nrHI1hHlZWOKdr+ubUvxKIlXphhB/CUpfcM4koqN5hg8s7qgw9RjsJw7/D2ZPZHFrnFkIeIqATrIoW5ZNm5OZjzicxsYsjJTa/7AeeVKnvkWMn6lwNs5wqj3lPVH+cdzHb2AJC63H7z3ul5AKX3sQor2yQ5BuehGy6xQQETCfotg8EqMYHkz0j4mIETtovXjd2SuHQByB1t0+oaTNIYuVJTXSSHUDC988GeYIFSW0Km183Vv X-MS-Office365-Filtering-Correlation-Id: 12fa7d1d-5416-4a00-5eb2-08d439dd44de X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR03MB2477; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 3:gjRpMYtKVz/o/84ijdymLNhin9Oc+dNHY9tbUvucTLlmMy3q7s3EslhXvmPP2hCqohcY2m+2HT9N31pHQ8Bm44uDvUlXkd2RdQjqbWWfrCV876AVUPhCIY9iLzpopPuft1KIqKVTTTI6ougbogpIwYgs0MIUmZMFGbxt8li0dkp2Cy+lUN8Y2oZ6rfwDDI04hdZhaoO8MPSj1cmavfVPqIWHl9V96HsbQ8uFIP2f2O5HhFYJKo/b2sW9+hZwscWb6v79d2TFFD3fv/oQQp7b8JUlH0aQs97NnC5cmjFa96nJ6wYxOi+D+0jPzDObezUByQRh2kETR2cxvoeZxkRI1IHEj63Yyily7yIpm2xV9eU1Yu1qexmwXtxpBwrh+mXR X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 25:zrDCXiz37o40Pk+3BLQLuMijOdduG7nBuQtUS6tNZrOY1bhmISPsfVYWLDvM7apnsVWT5l9hPdoJ6sXMT01T9mV7vLQCYTiTszrGI8VytElFOsaDyvq7/BR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-Test: UriScan:(228905959029699); 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:MWHPR03MB2477; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2477; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 4:Tzx6xrrnS9QA+W2SVa4I998G5yvOcG+Xhfi5JQsTtMT31dsn5xO0sORBs7k7GnMKv5+oy1pdcASo+xMLL89MJWZlc8DfoFWYL3ShBidu3NNFH18AnqpNXO2jJZ1Iq/yKaP2RT+1ho2z3Y5dYVFFxOAOmdVTAKwJfmhiu6DYXHqNpogjjQX16jaNmXaMXPrw7z0jgIJVwhsHQM2iBQ424RXa32+7pWgz4sAva96OsDQNmU6ujIIpV28Pb1wOoHBYQWXw1EGbLRakyrwzGW+yYEyqIgTtS2uOzCZ6NB6qPrdZhvmxVJXFIcObp8r302FcxdwEY+rXYyznMnIlcvvh1JO0PaFr80GNjtSG1zppIVpNcLgplsWWov9tSkJPOQ8BQqjHzQ6eqMKJ6Y94FkA6QYJUbfZSJpDN6xNFC+E3Wxex9tx9C9pXHRrPHW+SwJbQoeH44NdKvyajwWudmQGJC+P2WxfMJ69+FreUy8yJyanBQ+22NjRj1aF8z6vgD8ANfgpETp6acrxgkJT9abCaqOsiVmL59d/ct4kpYS641yxTFVDGxpWjzpBTTVdB36NfqBivbh5EYyXIKQFJ2d/G1OYIjdqdWO84VPjHuI22IwcGABKApE8GHA3pywrb8RXjirNxpJ8LR1qb2kEp75tCJYC9eAvNpdb0/rYzXtVbw+b4gFcTyxyVuXXjWR6pQnxnz1RMw4P0/lDHRVsrCvLKaQvJR9y68zpuLeKGpdMQHPt0m/bJ9n3CAMtlqy7vqsjnC X-Forefront-PRVS: 01842C458A X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; MWHPR03MB2477; 23:5r9Q2v8w2aQ3RTG+GOlZZcLAwlL1nSSDE+PgK?= =?Windows-1252?Q?ruBjNY/wVepTPMYhHOUMdEU6RmRUlO4tLOKeqevOW6w6jtPT9uckyv5x?= =?Windows-1252?Q?dnFqT0ZswkJar4q3VSPFe664f7bCfxvFVNCPfEDFe9zIqdnoWbrZOiQb?= =?Windows-1252?Q?js+lgoAdyqJhV9vuWOL0i2+lRL49nBrC4mIWS86mRHnqx8x23PNLgucV?= =?Windows-1252?Q?y2uTR9svIHHt6wjsc8mtuemLyNvfnNTl2LhsBJWdOHjTq4HZFoU1OQMm?= =?Windows-1252?Q?8LmUXz39DyuG6avMrZhy7nZhzSVgOTrSN6WZpzJyE1xp2jq6xcRDfVz1?= =?Windows-1252?Q?WaQSpeCl7914JazCQc7ADbaP1PCJc8QW0V9QnPAFXZWOfuqtjkVrX6UL?= =?Windows-1252?Q?ufTRZ8wPDFqac8lSXVWXgvxAVokBKxHTuWsFVpVOtuOkPeu6LgPId+cj?= =?Windows-1252?Q?WG4vTtnTGTsOpcEAQ/jxnOyoC2/7fQH4Cy+3lfiPLxBb/3Lya/lMhTtI?= =?Windows-1252?Q?+w0A0vr66UnzG8HWnZChT80dJh63CXKRmhOdGUpYe8zUAFLMF4YBEmtH?= =?Windows-1252?Q?YVcDsnCjgsQ/E5eY3Y5dRP/cJqRL2WrvJk9T69E7TN4VIKiPcgLtFLPX?= =?Windows-1252?Q?P0DekxmGpL73Uf+H96wH6RTCO+BJJg28i8LMVMZL+kloJngwmuDT+Q/t?= =?Windows-1252?Q?EUvzjFbodtaXQK7Pw5FY+UANJ+vozyxlKqVxqlhjxGbTDhWn+4ZhIFNi?= =?Windows-1252?Q?Y/IFTp2l/CqY1soYGrtv02rlr9OGwJ+8lKHtQy9OgiLb/CjtCg8pA2aK?= =?Windows-1252?Q?eDx5udw0sIIm2lWUDzLadpFbRVtKGVXd8SGMNmTqTJPpAnugEvRgDG2L?= =?Windows-1252?Q?Uj5BPUkKNRmmUP6Vaec0pyTvf3rGVd3/u3ljXXFS8/ifUwAdm+twVzam?= =?Windows-1252?Q?uabCxb9d9F0vw7qG6R7ckMZYO9dMmXqwCVpXLAMsk6iaecaX/3Zw6QMX?= =?Windows-1252?Q?LMMgOtNTQofwkIEh3IBUh048vdMGnE2uuNp1tCF1a7XuMs3y74JulWTi?= =?Windows-1252?Q?sp62OZeaz4l/cZH0rqdVqMLMqFISqFh787KfABNht9dqbmH70ArZob/H?= =?Windows-1252?Q?u0kjR4AveavQ/9/kJTzF2Zet+lS/IwYle5wjyFXoJUeoLi6Cm9rNioOC?= =?Windows-1252?Q?xFeVnqf8MJrGrP2b4+e9tk4p/8jtwcY7UQOwNlW3nR7x/uEEz/7HlTZi?= =?Windows-1252?Q?MqrH/eM6+kQyFH06ky/JwW+c6RHvkcW1YrSBUm4FmrjVAbtlnlvVvrjC?= =?Windows-1252?Q?cl6Oovi+39Yhh/WhyMoE4R2zU2xucYloWAx15CV144tskYP8d1TXFl6M?= =?Windows-1252?Q?XVMfwSv28w24L0K/8l0I4msdRbAn+M23ulTxcSYHFnGXt2zLiMOcX/aL?= =?Windows-1252?Q?VP3b9TtraAUCJ9iMStQ3slKXj80e3IU8XCy0TknwAKtotGGe/ivRlhaG?= =?Windows-1252?Q?5yANZrNeaJsdeIBnQYhHrqDIMkJDFkiae9S328EXAdDM7htCHac72C7m?= =?Windows-1252?Q?8d6YtYXf22wn8w9Ghg0RPa1mvTMLbh8VBs/p2IZrcBV8JbTEuJ1KOujp?= =?Windows-1252?Q?8sbeMGO/2HqXp9BKwsDhyaOpgAvfglxct3nCvX8XEIgPbA+rinvgznLV?= =?Windows-1252?Q?PRRe1loX+XQb0oHo6dXPjR5PGSNsq4=3D?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 6:ao9IHNWwZfIoKEzqG/+Zf3p86NpXstnxEdqvrQKmbuPWuHFPclzQ1vNtoCMvp1QUNvteiIMWd8NNns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CeSfc3vT/wRGp5tOj9iSiLT9r43MEZszdVk4haLUZ4TvxnW/BI/n9lzet93H3pfGYY1B2XCJNcz+9qa8a7UnEqQAmDWxrJlaVPpr8GFLwj3wbtL3nYHWd9ZyiCJCbSFjsxNYG7hw0SYOGki2Ppw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2017 04:49:46.8318 (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: MWHPR03MB2477 Subject: Re: [dpdk-dev] [PATCH 1/2] add rte_bus->probe 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: Wed, 11 Jan 2017 04:49:50 -0000 On Tuesday 10 January 2017 11:32 PM, Ferruh Yigit wrote: > Signed-off-by: Ferruh Yigit > --- > lib/librte_eal/common/eal_common_bus.c | 7 ++++--- > lib/librte_eal/common/include/rte_bus.h | 3 +++ > lib/librte_eal/linuxapp/eal/eal_pci.c | 1 + > 3 files changed, 8 insertions(+), 3 deletions(-) > > diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c > index f8c2e03..e8d1143 100644 > --- a/lib/librte_eal/common/eal_common_bus.c > +++ b/lib/librte_eal/common/eal_common_bus.c > @@ -145,6 +145,7 @@ rte_eal_bus_register(struct rte_bus *bus) > /* A bus should mandatorily have the scan and match implemented */ > RTE_VERIFY(bus->scan); > RTE_VERIFY(bus->match); > + RTE_VERIFY(bus->probe); v6 of my patches would include the above. > > /* Initialize the driver and device list associated with the bus */ > TAILQ_INIT(&(bus->driver_list)); > @@ -195,19 +196,19 @@ rte_eal_bus_scan(void) > } > > static int > -perform_probe(struct rte_bus *bus __rte_unused, struct rte_driver *driver, > +perform_probe(struct rte_bus *bus, struct rte_driver *driver, > struct rte_device *device) > { > int ret; > > - if (!driver->probe) { > + if (!bus->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); > + ret = bus->probe(driver, device); > if (ret < 0) > /* One of the probes failed */ > RTE_LOG(ERR, EAL, "Probe failed for (%s).\n", driver->name); Substantial code has shuffled in v6, including removal of this function. But again, I agree with your changes. > diff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h > index 07c30c4..ce1f56a 100644 > --- a/lib/librte_eal/common/include/rte_bus.h > +++ b/lib/librte_eal/common/include/rte_bus.h > @@ -135,6 +135,8 @@ typedef int (*bus_scan_t)(struct rte_bus *bus); > */ > typedef int (*bus_match_t)(struct rte_driver *drv, struct rte_device *dev); > > +typedef int (*bus_probe_t)(struct rte_driver *drv, struct rte_device *dev); > + > /** > * A structure describing a generic bus. > */ > @@ -147,6 +149,7 @@ struct rte_bus { > const char *name; /**< Name of the bus */ > bus_scan_t scan; /**< Scan for devices attached to bus */ > bus_match_t match; > + bus_probe_t probe; > /**< Match device with drivers associated with the bus */ > }; > > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c > index 314effa..837adf6 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_pci.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c > @@ -726,6 +726,7 @@ rte_eal_pci_ioport_unmap(struct rte_pci_ioport *p) > struct rte_bus pci_bus = { > .scan = rte_eal_pci_scan, > .match = rte_eal_pci_match, > + .probe = rte_eal_pci_probe, > }; > > RTE_REGISTER_BUS(pci, pci_bus); >