+
+ return 0;
+}
+
+static int
+test_kni_processing(uint16_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;
+ const struct rte_pci_device *pci_dev;
+ const struct rte_bus *bus = NULL;
+
+ if (!mp)
+ return -1;
+
+ memset(&conf, 0, sizeof(conf));
+ memset(&info, 0, sizeof(info));
+ memset(&ops, 0, sizeof(ops));
+
+ 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")) {
+ pci_dev = RTE_DEV_TO_PCI(info.device);
+ conf.addr = pci_dev->addr;
+ conf.id = 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 = 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;
+ }
+
+ test_kni_ctx = kni;
+ test_kni_processing_flag = 0;
+ stats.ingress = 0;
+ stats.egress = 0;
+
+ /**
+ * Check multiple processes support on
+ * registering/unregistering handlers.
+ */
+ if (test_kni_register_handler_mp() < 0) {
+ printf("fail to check multiple process support\n");
+ ret = -1;
+ goto fail_kni;
+ }
+
+ ret = test_kni_link_change();
+ if (ret != 0)
+ goto fail_kni;
+
+ rte_eal_mp_remote_launch(test_kni_loop, NULL, CALL_MAIN);
+ RTE_LCORE_FOREACH_WORKER(i) {