[dpdk-dev,1/1] pci: default to whitelist mode

Message ID 1490701917-17089-1-git-send-email-gaetan.rivet@6wind.com (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Gaëtan Rivet March 28, 2017, 11:51 a.m. UTC
  Expects all devices to be explicitly defined before being probed. Using
the -b option will activate blacklist mode instead.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 lib/librte_eal/common/eal_common_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Bruce Richardson March 28, 2017, 11:58 a.m. UTC | #1
On Tue, Mar 28, 2017 at 01:51:57PM +0200, Gaetan Rivet wrote:
> Expects all devices to be explicitly defined before being probed. Using
> the -b option will activate blacklist mode instead.
> 
> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
> ---
So does this change the default behaviour when no black or whitelist
options are defined? Instead of having all devices polled, we will have
none?

/Bruce
  
Gaëtan Rivet March 28, 2017, 12:05 p.m. UTC | #2
Hi Bruce,

On Tue, Mar 28, 2017 at 12:58:53PM +0100, Bruce Richardson wrote:
>On Tue, Mar 28, 2017 at 01:51:57PM +0200, Gaetan Rivet wrote:
>> Expects all devices to be explicitly defined before being probed. Using
>> the -b option will activate blacklist mode instead.
>>
>> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
>> ---
>So does this change the default behaviour when no black or whitelist
>options are defined? Instead of having all devices polled, we will have
>none?
>

Yes, precisely.

I was a little quick to send this patch, I sent a new version with more 
explanation as for my rationale behind this change:

http://dpdk.org/ml/archives/dev/2017-March/061818.html

>/Bruce
  

Patch

diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c
index 15a0c48..ad0a8be 100644
--- a/lib/librte_eal/common/eal_common_pci.c
+++ b/lib/librte_eal/common/eal_common_pci.c
@@ -418,7 +418,7 @@  rte_eal_pci_probe(void)
 	int probe_all = 0;
 	int ret = 0;
 
-	if (rte_eal_devargs_type_count(RTE_DEVTYPE_WHITELISTED_PCI) == 0)
+	if (rte_eal_devargs_type_count(RTE_DEVTYPE_BLACKLISTED_PCI) > 0)
 		probe_all = 1;
 
 	TAILQ_FOREACH(dev, &pci_device_list, next) {