X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_kni.c;h=e47ab36e0231890a80063c2c0537a0b96b91ad91;hb=a439f6227cd3b041183b0c0402bccca16d6acf66;hp=c92c09054f6a055a480b483a6d9fc5c12d20d175;hpb=a9de470cc7c0649221e156fc5f30a2dbdfe7c166;p=dpdk.git diff --git a/app/test/test_kni.c b/app/test/test_kni.c index c92c09054f..e47ab36e02 100644 --- a/app/test/test_kni.c +++ b/app/test/test_kni.c @@ -11,7 +11,7 @@ #include "test.h" -#if !defined(RTE_EXEC_ENV_LINUXAPP) || !defined(RTE_LIBRTE_KNI) +#if !defined(RTE_EXEC_ENV_LINUX) || !defined(RTE_LIBRTE_KNI) static int test_kni(void) @@ -436,7 +436,13 @@ test_kni_processing(uint16_t port_id, struct rte_mempool *mp) memset(&info, 0, sizeof(info)); memset(&ops, 0, sizeof(ops)); - rte_eth_dev_info_get(port_id, &info); + ret = rte_eth_dev_info_get(port_id, &info); + if (ret != 0) { + printf("Error during getting device (port %u) info: %s\n", + port_id, strerror(-ret)); + return -1; + } + if (info.device) bus = rte_bus_find_by_device(info.device); if (bus && !strcmp(bus->name, "pci")) { @@ -595,7 +601,12 @@ test_kni(void) printf("fail to start port %d\n", port_id); return -1; } - rte_eth_promiscuous_enable(port_id); + ret = rte_eth_promiscuous_enable(port_id); + if (ret != 0) { + printf("fail to enable promiscuous mode for port %d: %s\n", + port_id, rte_strerror(-ret)); + return -1; + } /* basic test of kni processing */ fd = fopen(KNI_MODULE_PARAM_LO, "r"); @@ -622,7 +633,14 @@ test_kni(void) memset(&info, 0, sizeof(info)); memset(&conf, 0, sizeof(conf)); memset(&ops, 0, sizeof(ops)); - rte_eth_dev_info_get(port_id, &info); + + ret = rte_eth_dev_info_get(port_id, &info); + if (ret != 0) { + printf("Error during getting device (port %u) info: %s\n", + port_id, strerror(-ret)); + return -1; + } + if (info.device) bus = rte_bus_find_by_device(info.device); else @@ -658,7 +676,15 @@ test_kni(void) memset(&conf, 0, sizeof(conf)); memset(&info, 0, sizeof(info)); memset(&ops, 0, sizeof(ops)); - rte_eth_dev_info_get(port_id, &info); + + ret = rte_eth_dev_info_get(port_id, &info); + if (ret != 0) { + printf("Error during getting device (port %u) info: %s\n", + port_id, strerror(-ret)); + ret = -1; + goto fail; + } + if (info.device) bus = rte_bus_find_by_device(info.device); else