summaryrefslogtreecommitdiff
path: root/lib/librte_kni
diff options
context:
space:
mode:
authorBruce Richardson <bruce.richardson@intel.com>2014-02-12 16:23:56 +0000
committerDavid Marchand <david.marchand@6wind.com>2014-02-25 21:29:19 +0100
commit9c495f7f183473eb787137fdec338452347e5726 (patch)
tree2f0dd61b23e3868c9a1b15b0a0e54dda5a369150 /lib/librte_kni
parent47bd46112b710dc59b1becfb67e18da319c5debe (diff)
downloaddpdk-9c495f7f183473eb787137fdec338452347e5726.zip
dpdk-9c495f7f183473eb787137fdec338452347e5726.tar.gz
dpdk-9c495f7f183473eb787137fdec338452347e5726.tar.xz
kni: add kni close function
KNI close function added. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Diffstat (limited to 'lib/librte_kni')
-rw-r--r--lib/librte_kni/rte_kni.c9
-rw-r--r--lib/librte_kni/rte_kni.h10
2 files changed, 19 insertions, 0 deletions
diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
index 509ae52..a0daa23 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 af458ef..a409f1f 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