summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGaetan Rivet <gaetan.rivet@6wind.com>2017-07-15 19:59:27 +0200
committerThomas Monjalon <thomas@monjalon.net>2017-07-20 00:40:28 +0300
commit39f403e0d5bbba765a42baf975b06ea4736c4cc7 (patch)
treedf159395d296b04ac909402413172658dc8f7964 /test
parentc0e2821041392c17594786d9e46ba5c83de097b5 (diff)
downloaddpdk-39f403e0d5bbba765a42baf975b06ea4736c4cc7.zip
dpdk-39f403e0d5bbba765a42baf975b06ea4736c4cc7.tar.gz
dpdk-39f403e0d5bbba765a42baf975b06ea4736c4cc7.tar.xz
devargs: restore device type API
Revert "devargs: make device types generic" This commit broke the rte_devargs API by changing the meaning of the rte_devtype enum. Restore the previous API, unit tests and function calls. Introduce parallel enum that acts as translation between previous API and current structures. Restoring the previous API means that -w and -b are not usable anymore with any bus having implemented the "parse" operation. Only PCI devices can be used with -w and -b, virtual devices are declared using vdev. This (partially) reverts commit bd279a79366f50a4893fb84db91bbf64b56f9fb1. Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Diffstat (limited to 'test')
-rw-r--r--test/test/test_devargs.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/test/test/test_devargs.c b/test/test/test_devargs.c
index 149c9c9..18f54ed 100644
--- a/test/test/test_devargs.c
+++ b/test/test/test_devargs.c
@@ -64,32 +64,30 @@ test_devargs(void)
TAILQ_INIT(&devargs_list);
/* test valid cases */
- if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, "08:00.1") < 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "08:00.1") < 0)
goto fail;
- if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, "0000:5:00.0") < 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "0000:5:00.0") < 0)
goto fail;
- if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, "04:00.0,arg=val") < 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI, "04:00.0,arg=val") < 0)
goto fail;
- if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, "0000:01:00.1") < 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI, "0000:01:00.1") < 0)
goto fail;
- if (rte_eal_devargs_type_count(RTE_DEVTYPE_WHITELISTED) != 4)
+ if (rte_eal_devargs_type_count(RTE_DEVTYPE_WHITELISTED_PCI) != 2)
goto fail;
- if (rte_eal_devargs_type_count(RTE_DEVTYPE_BLACKLISTED) != 0)
+ if (rte_eal_devargs_type_count(RTE_DEVTYPE_BLACKLISTED_PCI) != 2)
goto fail;
- if (rte_eal_devargs_type_count(RTE_DEVTYPE_UNDEFINED) != 0)
+ if (rte_eal_devargs_type_count(RTE_DEVTYPE_VIRTUAL) != 0)
goto fail;
- if (rte_eal_devargs_add(RTE_DEVTYPE_UNDEFINED, "net_ring0") < 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_VIRTUAL, "net_ring0") < 0)
goto fail;
- if (rte_eal_devargs_add(RTE_DEVTYPE_UNDEFINED,
- "net_ring1,key=val,k2=val2") < 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_VIRTUAL, "net_ring1,key=val,k2=val2") < 0)
goto fail;
- if (rte_eal_devargs_type_count(RTE_DEVTYPE_UNDEFINED) != 2)
+ if (rte_eal_devargs_type_count(RTE_DEVTYPE_VIRTUAL) != 2)
goto fail;
free_devargs_list();
/* check virtual device with argument parsing */
- if (rte_eal_devargs_add(RTE_DEVTYPE_UNDEFINED,
- "net_ring1,k1=val,k2=val2") < 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_VIRTUAL, "net_ring1,k1=val,k2=val2") < 0)
goto fail;
devargs = TAILQ_FIRST(&devargs_list);
if (strncmp(devargs->name, "net_ring1",
@@ -100,7 +98,7 @@ test_devargs(void)
free_devargs_list();
/* check PCI device with empty argument parsing */
- if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, "04:00.1") < 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "04:00.1") < 0)
goto fail;
devargs = TAILQ_FIRST(&devargs_list);
if (strcmp(devargs->name, "04:00.1") != 0)
@@ -110,15 +108,15 @@ test_devargs(void)
free_devargs_list();
/* test error case: bad PCI address */
- if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, "08:1") == 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "08:1") == 0)
goto fail;
- if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, "00.1") == 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "00.1") == 0)
goto fail;
- if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, "foo") == 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "foo") == 0)
goto fail;
- if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, ",") == 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, ",") == 0)
goto fail;
- if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, "000f:0:0") == 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "000f:0:0") == 0)
goto fail;
devargs_list = save_devargs_list;