+
+ return 0;
+}
+
+static int
+test_kni_processing(uint8_t port_id, struct rte_mempool *mp)
+{
+ int ret = 0;
+ unsigned i;
+ struct rte_kni *kni;
+ struct rte_kni_conf conf;
+ struct rte_eth_dev_info info;
+ struct rte_kni_ops ops;
+
+ if (!mp)
+ return -1;
+
+ memset(&conf, 0, sizeof(conf));
+ memset(&info, 0, sizeof(info));
+ memset(&ops, 0, sizeof(ops));
+
+ rte_eth_dev_info_get(port_id, &info);
+ conf.addr = info.pci_dev->addr;
+ conf.id = info.pci_dev->id;
+ snprintf(conf.name, sizeof(conf.name), TEST_KNI_PORT);
+
+ /* core id 1 configured for kernel thread */
+ conf.core_id = 1;
+ conf.force_bind = 1;
+ conf.mbuf_size = MAX_PACKET_SZ;
+ conf.group_id = (uint16_t)port_id;
+
+ ops = kni_ops;
+ ops.port_id = port_id;
+
+ /* basic test of kni processing */
+ kni = rte_kni_alloc(mp, &conf, &ops);
+ if (!kni) {
+ 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;
+ stats.ingress = 0;
+ stats.egress = 0;
+
+ /**
+ * Check multiple processes support on
+ * registerring/unregisterring handlers.
+ */
+ if (test_kni_register_handler_mp() < 0) {
+ printf("fail to check multiple process support\n");
+ ret = -1;
+ goto fail_kni;
+ }
+