summaryrefslogtreecommitdiff
path: root/lib/librte_kni/rte_kni.h
diff options
context:
space:
mode:
authorDan Gora <dg@adax.com>2018-10-24 19:26:27 -0300
committerThomas Monjalon <thomas@monjalon.net>2018-10-26 19:46:15 +0200
commitc6fd54f28c24ba0b3912a1746c4a2b810ffa89c4 (patch)
tree931d9cf5198e0ea83f590b4920186c92ab4775d1 /lib/librte_kni/rte_kni.h
parentfd5f33323e5a698941db03908d5bd1fa91016b7e (diff)
downloaddpdk-c6fd54f28c24ba0b3912a1746c4a2b810ffa89c4.zip
dpdk-c6fd54f28c24ba0b3912a1746c4a2b810ffa89c4.tar.gz
dpdk-c6fd54f28c24ba0b3912a1746c4a2b810ffa89c4.tar.xz
kni: add function to set link state on kernel interface
Add a new API function to KNI, rte_kni_update_link() to allow DPDK applications to update the link status for KNI network interfaces in the linux kernel. Signed-off-by: Dan Gora <dg@adax.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'lib/librte_kni/rte_kni.h')
-rw-r--r--lib/librte_kni/rte_kni.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h
index 601abdf..02ca43b 100644
--- a/lib/librte_kni/rte_kni.h
+++ b/lib/librte_kni/rte_kni.h
@@ -233,6 +233,26 @@ int rte_kni_register_handlers(struct rte_kni *kni, struct rte_kni_ops *ops);
int rte_kni_unregister_handlers(struct rte_kni *kni);
/**
+ * Update link carrier state for KNI port.
+ *
+ * Update the linkup/linkdown state of a KNI interface in the kernel.
+ *
+ * @param kni
+ * pointer to struct rte_kni.
+ * @param linkup
+ * New link state:
+ * 0 for linkdown.
+ * > 0 for linkup.
+ *
+ * @return
+ * On failure: -1
+ * Previous link state == linkdown: 0
+ * Previous link state == linkup: 1
+ */
+int __rte_experimental
+rte_kni_update_link(struct rte_kni *kni, unsigned int linkup);
+
+/**
* Close KNI device.
*/
void rte_kni_close(void);