examples/kni: close port before exit

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

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
This commit is contained in:
Huisong Li 2021-09-14 14:02:19 +08:00 committed by Thomas Monjalon
parent 829c5946b5
commit 44fe9bd8e4

View File

@ -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;
}