From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hemant Agrawal Subject: Re: [PATCH] eal: bus scan and probe never fail Date: Mon, 18 Sep 2017 17:06:15 +0530 Message-ID: <422ce0c6-7868-b601-2fe9-e361497d7b14@nxp.com> References: <20170812102220.27773-1-shreyansh.jain@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Cc: , To: Shreyansh Jain , Return-path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0054.outbound.protection.outlook.com [104.47.37.54]) by dpdk.org (Postfix) with ESMTP id 08EB84BE1 for ; Mon, 18 Sep 2017 13:36:21 +0200 (CEST) In-Reply-To: <20170812102220.27773-1-shreyansh.jain@nxp.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Tested-by: Hemant Agrawal On 8/12/2017 3:52 PM, Shreyansh Jain wrote: > Bus scan is responsible for finding devices over *all* buses. > Some of these buses might not be able to scan but that should > not prevent other buses to be scanned. > > Same is the case for probing. It is possible that some devices which > were scanned didn't have a specific driver. That should not prevent > other buses from being probed. > > Signed-off-by: Shreyansh Jain > > --- > Until now, this decision was left onto author of bus specific scan and > probe function. But, that is incorrect. > --- > lib/librte_eal/common/eal_common_bus.c | 12 +++--------- > 1 file changed, 3 insertions(+), 9 deletions(-) > > diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c > index 08bec2d..58e1084 100644 > --- a/lib/librte_eal/common/eal_common_bus.c > +++ b/lib/librte_eal/common/eal_common_bus.c > @@ -73,11 +73,9 @@ rte_bus_scan(void) > > TAILQ_FOREACH(bus, &rte_bus_list, next) { > ret = bus->scan(); > - if (ret) { > + if (ret) > RTE_LOG(ERR, EAL, "Scan for (%s) bus failed.\n", > bus->name); > - return ret; > - } > } > > return 0; > @@ -97,20 +95,16 @@ rte_bus_probe(void) > } > > ret = bus->probe(); > - if (ret) { > + if (ret) > RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n", > bus->name); > - return ret; > - } > } > > if (vbus) { > ret = vbus->probe(); > - if (ret) { > + if (ret) > RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n", > vbus->name); > - return ret; > - } > } > > return 0; >