eal: remove duplicate handling of white/black list
authorDavid Marchand <david.marchand@6wind.com>
Mon, 22 Sep 2014 08:37:57 +0000 (10:37 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 23 Sep 2014 13:32:59 +0000 (15:32 +0200)
We can handle both short and long options for those in the same case.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
lib/librte_eal/bsdapp/eal/eal.c
lib/librte_eal/linuxapp/eal/eal.c

index 7e9f3aa..8599a35 100644 (file)
@@ -513,8 +513,8 @@ eal_parse_args(int argc, char **argv)
                {OPT_PROC_TYPE, 1, 0, 0},
                {OPT_FILE_PREFIX, 1, 0, 0},
                {OPT_SOCKET_MEM, 1, 0, 0},
-               {OPT_PCI_WHITELIST, 1, 0, 0},
-               {OPT_PCI_BLACKLIST, 1, 0, 0},
+               {OPT_PCI_WHITELIST, 1, 0, 'w'},
+               {OPT_PCI_BLACKLIST, 1, 0, 'b'},
                {OPT_VDEV, 1, 0, 0},
                {OPT_SYSLOG, 1, NULL, 0},
                {OPT_LOG_LEVEL, 1, NULL, 0},
@@ -629,20 +629,6 @@ eal_parse_args(int argc, char **argv)
                        else if (!strcmp(lgopts[option_index].name, OPT_PROC_TYPE)) {
                                internal_config.process_type = eal_parse_proc_type(optarg);
                        }
-                       else if (!strcmp(lgopts[option_index].name, OPT_PCI_BLACKLIST)) {
-                               if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI,
-                                               optarg) < 0) {
-                                       eal_usage(prgname);
-                                       return -1;
-                               }
-                       }
-                       else if (!strcmp(lgopts[option_index].name, OPT_PCI_WHITELIST)) {
-                               if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI,
-                                               optarg) < 0) {
-                                       eal_usage(prgname);
-                                       return -1;
-                               }
-                       }
                        else if (!strcmp(lgopts[option_index].name, OPT_VDEV)) {
                                if (rte_eal_devargs_add(RTE_DEVTYPE_VIRTUAL,
                                                optarg) < 0) {
index bf63744..655c454 100644 (file)
@@ -718,8 +718,8 @@ eal_parse_args(int argc, char **argv)
                {OPT_PROC_TYPE, 1, 0, 0},
                {OPT_FILE_PREFIX, 1, 0, 0},
                {OPT_SOCKET_MEM, 1, 0, 0},
-               {OPT_PCI_WHITELIST, 1, 0, 0},
-               {OPT_PCI_BLACKLIST, 1, 0, 0},
+               {OPT_PCI_WHITELIST, 1, 0, 'w'},
+               {OPT_PCI_BLACKLIST, 1, 0, 'b'},
                {OPT_VDEV, 1, 0, 0},
                {OPT_SYSLOG, 1, NULL, 0},
                {OPT_LOG_LEVEL, 1, NULL, 0},
@@ -879,20 +879,6 @@ eal_parse_args(int argc, char **argv)
                                        return -1;
                                }
                        }
-                       else if (!strcmp(lgopts[option_index].name, OPT_PCI_BLACKLIST)) {
-                               if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI,
-                                               optarg) < 0) {
-                                       eal_usage(prgname);
-                                       return -1;
-                               }
-                       }
-                       else if (!strcmp(lgopts[option_index].name, OPT_PCI_WHITELIST)) {
-                               if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI,
-                                               optarg) < 0) {
-                                       eal_usage(prgname);
-                                       return -1;
-                               }
-                       }
                        else if (!strcmp(lgopts[option_index].name, OPT_VDEV)) {
                                if (rte_eal_devargs_add(RTE_DEVTYPE_VIRTUAL,
                                                optarg) < 0) {