Signed-off-by: Gaetan Rivet <gaetan.ri...@6wind.com>
---
 lib/librte_eal/common/eal_common_devargs.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/lib/librte_eal/common/eal_common_devargs.c 
b/lib/librte_eal/common/eal_common_devargs.c
index d5f297d..ac51b19 100644
--- a/lib/librte_eal/common/eal_common_devargs.c
+++ b/lib/librte_eal/common/eal_common_devargs.c
@@ -128,6 +128,21 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char 
*devargs_str)
 
                break;
        }
+       if (devargs->type == RTE_DEVTYPE_WHITELISTED_PCI) {
+               if (bus->conf.scan_mode == RTE_BUS_SCAN_UNDEFINED) {
+                       bus->conf.scan_mode = RTE_BUS_SCAN_WHITELIST;
+               } else if (bus->conf.scan_mode == RTE_BUS_SCAN_BLACKLIST) {
+                       fprintf(stderr, "ERROR: incompatible device type and 
bus scan mode\n");
+                       goto fail;
+               }
+       } else if (devargs->type == RTE_DEVTYPE_BLACKLISTED_PCI) {
+               if (bus->conf.scan_mode == RTE_BUS_SCAN_UNDEFINED) {
+                       bus->conf.scan_mode = RTE_BUS_SCAN_BLACKLIST;
+               } else if (bus->conf.scan_mode == RTE_BUS_SCAN_WHITELIST) {
+                       fprintf(stderr, "ERROR: incompatible device type and 
bus scan mode\n");
+                       goto fail;
+               }
+       }
 
        free(buf);
        TAILQ_INSERT_TAIL(&devargs_list, devargs, next);
-- 
2.1.4

Reply via email to