From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2017 09:22:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,475,1498546800"; d="scan'208";a="125449583" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.57]) ([10.237.220.57]) by orsmga004.jf.intel.com with ESMTP; 04 Sep 2017 09:22:44 -0700 To: Jan Blunck , dev@dpdk.org References: <20170711232512.54641-1-jblunck@infradead.org> <20170714211213.34436-1-jblunck@infradead.org> <20170714211213.34436-6-jblunck@infradead.org> From: Ferruh Yigit Message-ID: <7ed2cd21-0d2e-1010-6421-4b5f6aab87bd@intel.com> Date: Mon, 4 Sep 2017 17:22:43 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170714211213.34436-6-jblunck@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2 05/15] pci: use scan_mode configuration 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: Mon, 04 Sep 2017 16:22:47 -0000 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 >