From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=kj9eF+Cxa6vzNJLj3wTP3vSzNU47qzBEW3GFAFI3NKc=; b=wzlUy/CHxLcEHOgkCdou3+S+UVbLrqfIljnDlj844KehNynjsgk1OinZTf6ZWIAS07 6JLNoc25eJF5FMvBZfuvThWVsS/djyKj3wdpG2jZTGGS52jO8ZzyKVABEQ8t/sXJIb6g /GA8I7cpSJm8Pwdhau2WpJjGLSs6iSgKh4jkYj+KwtQVW1O44qt1ZYp3HY24Wx5/anxs LkEX3v6NnK+2KwBYuVJpC0udhMEkL74qGoySIVblv3UIX/AQq/0+6sg3/hw7DpImJGbo IuG+YVMnZsasVvBVuPUd6L80j7QxPKa0xUApJcWPf4KwxahBI9CxWLriQTDRdFsfl8xP htDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=kj9eF+Cxa6vzNJLj3wTP3vSzNU47qzBEW3GFAFI3NKc=; b=Lq9jPteB64UsqPBT4M0xDcSBPXuunuSjGD8xnxEBX0ffPUv67DHYPzDh7EKMeDc8CG OmY3YsgXWszQ0xMR4D+WerO1Z4os/EyASpZ60vWZoJzYr0aLrKxyDN5jNDJ3de1dq/vg glX23+uy292LbXC1XZ38qg3uErlLBF41QwFC/zgA3SucKP+p6t9tlWMuIsSQ6QhJhUoi Wc80UIlcv01Geozs0o8ohG4OtacPfBuTm8kixpQw53xwwZ4lYRLqP4Vw+vWwdCed4Dhh mVb6r7ivyZdehDxn2/uYxS1ufVQG0w47OgmQrq6w9TCQ5jS1YknP2mTPWANudWz4ORZd AffQ== X-Gm-Message-State: AElRT7G2yBnkLsmuoweZIANAg+DXVrwx6prwSHeexvU9j8KdGrMA/ThN k6oDyqTmcMTl2lQFr1QQTA2NqQ== X-Google-Smtp-Source: AG47ELs9Bout9UgoHRH1dXCdB5E06x6ZGZf+ez/ytqUlSQ+8AURXOPHgLqbIb86hh+qKWtVZGD2Ovg== X-Received: by 10.28.139.19 with SMTP id n19mr2279200wmd.40.1521626719172; Wed, 21 Mar 2018 03:05:19 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 140sm3647796wmy.38.2018.03.21.03.05.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Mar 2018 03:05:18 -0700 (PDT) Date: Wed, 21 Mar 2018 11:05:03 +0100 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Rosen Xu Cc: dev@dpdk.org, declan.doherty@intel.com, bruce.richardson@intel.com, shreyansh.jain@nxp.com, tianfei.zhang@intel.com, hao.wu@intel.com 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1521618694-140757-3-git-send-email-rosen.xu@intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH V2 2/5] Add Intel FPGA BUS Probe Code 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, 21 Mar 2018 10:05:19 -0000 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