summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGaetan Rivet <gaetan.rivet@6wind.com>2017-07-07 02:04:32 +0200
committerThomas Monjalon <thomas@monjalon.net>2017-07-09 00:11:15 +0200
commitbd279a79366f50a4893fb84db91bbf64b56f9fb1 (patch)
tree5f27e7296f1ca631f6e29b74e7b7589f256f08e6 /test
parent2b0e39c1832c053792ed147c6b1afeebb674e19a (diff)
downloaddpdk-bd279a79366f50a4893fb84db91bbf64b56f9fb1.zip
dpdk-bd279a79366f50a4893fb84db91bbf64b56f9fb1.tar.gz
dpdk-bd279a79366f50a4893fb84db91bbf64b56f9fb1.tar.xz
devargs: make device types generic
rte_devargs now represents any device from any bus. The related devtypes do not identify a bus anymore, only which scan policy the device subscribes to. The bus itself is identified by a bus handle previously introduced. Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Diffstat (limited to 'test')
-rw-r--r--test/test/test_devargs.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/test/test/test_devargs.c b/test/test/test_devargs.c
index 18f54ed..149c9c9 100644
--- a/test/test/test_devargs.c
+++ b/test/test/test_devargs.c
@@ -64,30 +64,32 @@ test_devargs(void)
TAILQ_INIT(&devargs_list);
/* test valid cases */
- if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "08:00.1") < 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, "08:00.1") < 0)
goto fail;
- if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "0000:5:00.0") < 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, "0000:5:00.0") < 0)
goto fail;
- if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI, "04:00.0,arg=val") < 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, "04:00.0,arg=val") < 0)
goto fail;
- if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI, "0000:01:00.1") < 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, "0000:01:00.1") < 0)
goto fail;
- if (rte_eal_devargs_type_count(RTE_DEVTYPE_WHITELISTED_PCI) != 2)
+ if (rte_eal_devargs_type_count(RTE_DEVTYPE_WHITELISTED) != 4)
goto fail;
- if (rte_eal_devargs_type_count(RTE_DEVTYPE_BLACKLISTED_PCI) != 2)
+ if (rte_eal_devargs_type_count(RTE_DEVTYPE_BLACKLISTED) != 0)
goto fail;
- if (rte_eal_devargs_type_count(RTE_DEVTYPE_VIRTUAL) != 0)
+ if (rte_eal_devargs_type_count(RTE_DEVTYPE_UNDEFINED) != 0)
goto fail;
- if (rte_eal_devargs_add(RTE_DEVTYPE_VIRTUAL, "net_ring0") < 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_UNDEFINED, "net_ring0") < 0)
goto fail;
- if (rte_eal_devargs_add(RTE_DEVTYPE_VIRTUAL, "net_ring1,key=val,k2=val2") < 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_UNDEFINED,
+ "net_ring1,key=val,k2=val2") < 0)
goto fail;
- if (rte_eal_devargs_type_count(RTE_DEVTYPE_VIRTUAL) != 2)
+ if (rte_eal_devargs_type_count(RTE_DEVTYPE_UNDEFINED) != 2)
goto fail;
free_devargs_list();
/* check virtual device with argument parsing */
- if (rte_eal_devargs_add(RTE_DEVTYPE_VIRTUAL, "net_ring1,k1=val,k2=val2") < 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_UNDEFINED,
+ "net_ring1,k1=val,k2=val2") < 0)
goto fail;
devargs = TAILQ_FIRST(&devargs_list);
if (strncmp(devargs->name, "net_ring1",
@@ -98,7 +100,7 @@ test_devargs(void)
free_devargs_list();
/* check PCI device with empty argument parsing */
- if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "04:00.1") < 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, "04:00.1") < 0)
goto fail;
devargs = TAILQ_FIRST(&devargs_list);
if (strcmp(devargs->name, "04:00.1") != 0)
@@ -108,15 +110,15 @@ test_devargs(void)
free_devargs_list();
/* test error case: bad PCI address */
- if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "08:1") == 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, "08:1") == 0)
goto fail;
- if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "00.1") == 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, "00.1") == 0)
goto fail;
- if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "foo") == 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, "foo") == 0)
goto fail;
- if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, ",") == 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, ",") == 0)
goto fail;
- if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "000f:0:0") == 0)
+ if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, "000f:0:0") == 0)
goto fail;
devargs_list = save_devargs_list;