From: Bruce Richardson Date: Wed, 12 Feb 2014 16:23:56 +0000 (+0000) Subject: kni: add kni close function X-Git-Tag: spdx-start~11029 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9c495f7f183473eb787137fdec338452347e5726;p=dpdk.git kni: add kni close function KNI close function added. Signed-off-by: Bruce Richardson --- diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c index 509ae527da..a0daa2358a 100644 --- a/lib/librte_kni/rte_kni.c +++ b/lib/librte_kni/rte_kni.c @@ -523,3 +523,12 @@ rte_kni_unregister_handlers(struct rte_kni *kni) kni->ops.config_network_if = NULL; return 0; } +void +rte_kni_close(void) +{ + if (kni_fd < 0) + return; + + close(kni_fd); + kni_fd = -1; +} diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h index af458ef1d4..a409f1fafd 100644 --- a/lib/librte_kni/rte_kni.h +++ b/lib/librte_kni/rte_kni.h @@ -270,6 +270,16 @@ extern int rte_kni_register_handlers(struct rte_kni *kni, */ extern int rte_kni_unregister_handlers(struct rte_kni *kni); +/** + * close KNI device. + * + * @param void + * + * @return + * void + */ +extern void rte_kni_close(void); + #ifdef __cplusplus } #endif