[dpdk-dev] [PATCH] examples/kni: add dev close step when kni free

Min Hu (Connor) humin29 at huawei.com
Tue Sep 14 08:02:19 CEST 2021


From: Huisong Li <lihuisong at huawei.com>

This patch adds dev_close() step to release network adapter resources
when kni free.

Signed-off-by: Huisong Li <lihuisong at huawei.com>
Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
---
 examples/kni/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/kni/main.c b/examples/kni/main.c
index beabb3c848..2a993a0ca4 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -1031,6 +1031,7 @@ kni_free_kni(uint16_t port_id)
 	if (ret != 0)
 		RTE_LOG(ERR, APP, "Failed to stop port %d: %s\n",
 			port_id, rte_strerror(-ret));
+	rte_eth_dev_close(port_id);
 
 	return 0;
 }
-- 
2.33.0



More information about the dev mailing list