From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v2 05/15] pci: use scan_mode configuration Date: Mon, 4 Sep 2017 17:22:43 +0100 Message-ID: <7ed2cd21-0d2e-1010-6421-4b5f6aab87bd@intel.com> References: <20170711232512.54641-1-jblunck@infradead.org> <20170714211213.34436-1-jblunck@infradead.org> <20170714211213.34436-6-jblunck@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit To: Jan Blunck , dev@dpdk.org Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id B324D7CD2 for ; Mon, 4 Sep 2017 18:22:46 +0200 (CEST) In-Reply-To: <20170714211213.34436-6-jblunck@infradead.org> Content-Language: en-US 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 7/14/2017 10:12 PM, Jan Blunck wrote: > When scanning/probing devices the bus doesn't need to look at the > devargs->type field: if the bus is in blacklist probing mode and there is > no devargs found for the device it is white-listed. Therefore it is enough > to let the bus check for the scan_mode. > > Signed-off-by: Jan Blunck > --- > lib/librte_eal/common/eal_common_pci.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c > index 72fcc35c2..fb0e29ac4 100644 > --- a/lib/librte_eal/common/eal_common_pci.c > +++ b/lib/librte_eal/common/eal_common_pci.c > @@ -197,8 +197,7 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr, > > /* no initialization when blacklisted, return without error */ > if (dev->device.devargs != NULL && > - dev->device.devargs->type == > - RTE_DEVTYPE_BLACKLISTED_PCI) { > + rte_pci_bus.bus.conf.scan_mode == RTE_BUS_SCAN_BLACKLIST) { If eal blacklist command issued (-b), even for one device, bus scan_mode set to RTE_BUS_SCAN_BLACKLIST. Only devices provided with -b should be blacklisted, all other devices in the bus should be probed. If check done based on "scan_mode", this will blacklist all devices in the bus, unless I am missing something. I see this is to remove "devargs->type" but I don't think so this can be replaced with "conf.scan_mode" check. And while thinking about this, I wonder what "scan_mode" really mean? and where it is used/useful? > RTE_LOG(INFO, EAL, " Device is blacklisted, not" > " initializing\n"); > return 1; > @@ -404,8 +403,7 @@ rte_pci_probe(void) > /* probe all or only whitelisted devices */ > if (probe_all) > ret = pci_probe_all_drivers(dev); > - else if (devargs != NULL && > - devargs->type == RTE_DEVTYPE_WHITELISTED_PCI) > + else if (devargs != NULL) if "probe_all" is not set, this means "scan_mode" is WHITELIST. And only physical devices white-listed will have devargs, so this check looks OK, but I believe this requires some comment, otherwise this is not clear. Also why not check blacklist here? > ret = pci_probe_all_drivers(dev); > if (ret < 0) { > RTE_LOG(ERR, EAL, "Requested device " PCI_PRI_FMT >