mbuf: remove rte_ctrlmbuf
[dpdk.git] / app / test / test_kni.c
index a870dd5..2860bf3 100644 (file)
@@ -39,7 +39,6 @@
 
 #include "test.h"
 
-#ifdef RTE_LIBRTE_KNI
 #include <rte_string_fns.h>
 #include <rte_mempool.h>
 #include <rte_ethdev.h>
@@ -390,7 +389,7 @@ test_kni_processing(uint8_t port_id, struct rte_mempool *mp)
        rte_eth_dev_info_get(port_id, &info);
        conf.addr = info.pci_dev->addr;
        conf.id = info.pci_dev->id;
-       rte_snprintf(conf.name, sizeof(conf.name), TEST_KNI_PORT);
+       snprintf(conf.name, sizeof(conf.name), TEST_KNI_PORT);
 
        /* core id 1 configured for kernel thread */
        conf.core_id = 1;
@@ -488,7 +487,7 @@ fail_kni:
        return ret;
 }
 
-int
+static int
 test_kni(void)
 {
        int ret = -1;
@@ -647,7 +646,7 @@ test_kni(void)
 
        /* test of getting KNI device with an invalid string name */
        memset(&conf, 0, sizeof(conf));
-       rte_snprintf(conf.name, sizeof(conf.name), "testing");
+       snprintf(conf.name, sizeof(conf.name), "testing");
        kni = rte_kni_get(conf.name);
        if (kni) {
                ret = -1;
@@ -680,13 +679,8 @@ fail:
        return ret;
 }
 
-#else /* RTE_LIBRTE_KNI */
-
-int
-test_kni(void)
-{
-       printf("The KNI library is not included in this build\n");
-       return 0;
-}
-
-#endif /* RTE_LIBRTE_KNI */
+static struct test_command kni_cmd = {
+       .command = "kni_autotest",
+       .callback = test_kni,
+};
+REGISTER_TEST_COMMAND(kni_cmd);