From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet Subject: Re: [PATCH V2 2/5] Add Intel FPGA BUS Probe Code Date: Wed, 21 Mar 2018 11:05:03 +0100 Message-ID: <20180321100503.bey6fkpqodx7frez@bidouze.vm.6wind.com> References: <1521618694-140757-1-git-send-email-rosen.xu@intel.com> <1521618694-140757-3-git-send-email-rosen.xu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org, declan.doherty@intel.com, bruce.richardson@intel.com, shreyansh.jain@nxp.com, tianfei.zhang@intel.com, hao.wu@intel.com To: Rosen Xu Return-path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id A68E85F2A for ; Wed, 21 Mar 2018 11:05:19 +0100 (CET) Received: by mail-wm0-f65.google.com with SMTP id 139so8694109wmn.2 for ; Wed, 21 Mar 2018 03:05:19 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1521618694-140757-3-git-send-email-rosen.xu@intel.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" On Wed, Mar 21, 2018 at 03:51:31PM +0800, Rosen Xu wrote: > Signed-off-by: Rosen Xu > --- > lib/librte_eal/common/eal_common_bus.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c > index 3e022d5..e3bcebe 100644 > --- a/lib/librte_eal/common/eal_common_bus.c > +++ b/lib/librte_eal/common/eal_common_bus.c > @@ -87,7 +87,7 @@ struct rte_bus_list rte_bus_list = > rte_bus_probe(void) > { > int ret; > - struct rte_bus *bus, *vbus = NULL; > + struct rte_bus *bus, *vbus = NULL, *ifpga_bus = NULL; > > TAILQ_FOREACH(bus, &rte_bus_list, next) { > if (!strcmp(bus->name, "vdev")) { > @@ -95,6 +95,11 @@ struct rte_bus_list rte_bus_list = > continue; > } > > + if (!strcmp(bus->name, "ifpga")) { > + ifpga_bus = bus; > + continue; > + } > + > ret = bus->probe(); > if (ret) > RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n", > @@ -108,6 +113,13 @@ struct rte_bus_list rte_bus_list = > vbus->name); > } > > + if (ifpga_bus) { > + ret = ifpga_bus->probe(); > + if (ret) > + RTE_LOG(ERR, EAL, "Scan for (%s) bus failed.\n", > + ifpga_bus->name); > + } > + I do not think this solution is generic and scalable anough to get into common EAL code. However, I do not think we need to come up with a dependency scheme (callback registration to check whether proper conditions are met to proceed with probing). I think you have a hard-dependency on the PCI bus because you are simply probing a PCI device. You do not need an additional bus for this. -- Gaëtan Rivet 6WIND