X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=app%2Ftest%2Ftest_kni.c;h=309741cb353e741e4b55864075fce718427c3518;hb=f689586bc060aeb3f0ba038d34263c6b943ed31a;hp=506b543a68792e8acc701f4d97644e0434cb34de;hpb=ea0c20ea95fd5d71a10757e6598ac66233ea1495;p=dpdk.git diff --git a/app/test/test_kni.c b/app/test/test_kni.c index 506b543a68..309741cb35 100644 --- a/app/test/test_kni.c +++ b/app/test/test_kni.c @@ -237,7 +237,7 @@ test_kni_allocate_lcores(void) } printf("count: %u\n", count); - return (count == 2 ? 0 : -1); + return count == 2 ? 0 : -1; } static int @@ -398,17 +398,6 @@ test_kni_processing(uint8_t port_id, struct rte_mempool *mp) printf("fail to create kni\n"); return -1; } - if (rte_kni_get_port_id(kni) != port_id) { - printf("fail to get port id\n"); - ret = -1; - goto fail_kni; - } - - if (rte_kni_info_get(RTE_MAX_ETHPORTS)) { - printf("Unexpectedly get a KNI successfully\n"); - ret = -1; - goto fail_kni; - } test_kni_ctx = kni; test_kni_processing_flag = 0; @@ -591,14 +580,6 @@ test_kni(void) goto fail; } - /* test of getting port id according to NULL kni context */ - if (rte_kni_get_port_id(NULL) < RTE_MAX_ETHPORTS) { - ret = -1; - printf("unexpectedly get port id successfully by NULL kni " - "pointer\n"); - goto fail; - } - /* test of releasing NULL kni context */ ret = rte_kni_release(NULL); if (ret == 0) { @@ -644,23 +625,6 @@ test_kni(void) "a never used name string\n"); goto fail; } - - /* test the interface of creating a KNI, for backward compatibility */ - memset(&ops, 0, sizeof(ops)); - ops = kni_ops; - kni = rte_kni_create(port_id, MAX_PACKET_SZ, mp, &ops); - if (!kni) { - ret = -1; - printf("Fail to create a KNI device for port %d\n", port_id); - goto fail; - } - - ret = rte_kni_release(kni); - if (ret < 0) { - printf("Fail to release a KNI device\n"); - goto fail; - } - ret = 0; fail: @@ -669,8 +633,4 @@ fail: return ret; } -static struct test_command kni_cmd = { - .command = "kni_autotest", - .callback = test_kni, -}; -REGISTER_TEST_COMMAND(kni_cmd); +REGISTER_TEST_COMMAND(kni_autotest, test_kni);