]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_eal/common/eal_common_devargs.c
devargs: restore device type API
[dpdk.git] / lib / librte_eal / common / eal_common_devargs.c
index ff6c2a87a9942ce0c05c6a10f455a36bfc30a8db..33e9f0a93592fe41ec1fa66792c8524e52616177 100644 (file)
@@ -40,6 +40,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <rte_dev.h>
 #include <rte_devargs.h>
 #include <rte_tailq.h>
 #include "eal_private.h"
@@ -167,18 +168,20 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str)
                goto fail;
        devargs->type = devtype;
        bus = devargs->bus;
-       if (devargs->type == RTE_DEVTYPE_WHITELISTED) {
+       if (devargs->type == RTE_DEVTYPE_BLACKLISTED_PCI)
+               devargs->policy = RTE_DEV_BLACKLISTED;
+       if (devargs->policy == RTE_DEV_WHITELISTED) {
                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");
+                       fprintf(stderr, "ERROR: incompatible device policy and bus scan mode\n");
                        goto fail;
                }
-       } else if (devargs->type == RTE_DEVTYPE_BLACKLISTED) {
+       } else if (devargs->policy == RTE_DEV_BLACKLISTED) {
                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");
+                       fprintf(stderr, "ERROR: incompatible device policy and bus scan mode\n");
                        goto fail;
                }
        }