DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/4] kni: add function to query the name of a kni object
@ 2015-05-27 13:47 Bruce Richardson
  2015-05-27 13:51 ` Bruce Richardson
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Bruce Richardson @ 2015-05-27 13:47 UTC (permalink / raw)
  To: dev

When a KNI object is created, a name is assigned to it which is stored
internally. There is also an API function to look up a KNI object by
name, but there is no API to query the current name of an existing
KNI object. This patch adds just such an API.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_kni/rte_kni.c           |  6 ++++++
 lib/librte_kni/rte_kni.h           | 10 ++++++++++
 lib/librte_kni/rte_kni_version.map |  1 +
 3 files changed, 17 insertions(+)

diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
index 4e70fa0..c5a0089 100644
--- a/lib/librte_kni/rte_kni.c
+++ b/lib/librte_kni/rte_kni.c
@@ -674,6 +674,12 @@ rte_kni_get(const char *name)
 	return NULL;
 }
 
+const char *
+rte_kni_get_name(const struct rte_kni *kni)
+{
+	return kni->name;
+}
+
 /*
  * It is deprecated and just for backward compatibility.
  */
diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h
index 44240fe..0c74251 100644
--- a/lib/librte_kni/rte_kni.h
+++ b/lib/librte_kni/rte_kni.h
@@ -248,6 +248,16 @@ extern uint8_t rte_kni_get_port_id(struct rte_kni *kni) \
 extern struct rte_kni *rte_kni_get(const char *name);
 
 /**
+ * Get the name given to a KNI device
+ *
+ * @param kni
+ *   The KNI instance to query
+ * @return
+ *   The pointer to the KNI name
+ */
+extern const char *rte_kni_get_name(const struct rte_kni *kni);
+
+/**
  * Get the KNI context of the specific port.
  *
  * Note: It is deprecated and just for backward compatibility.
diff --git a/lib/librte_kni/rte_kni_version.map b/lib/librte_kni/rte_kni_version.map
index b0bbf4d..e5e4e1b 100644
--- a/lib/librte_kni/rte_kni_version.map
+++ b/lib/librte_kni/rte_kni_version.map
@@ -6,6 +6,7 @@ DPDK_2.0 {
 	rte_kni_create;
 	rte_kni_get;
 	rte_kni_get_port_id;
+	rte_kni_get_name;
 	rte_kni_handle_request;
 	rte_kni_info_get;
 	rte_kni_init;
-- 
2.1.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-06-16 14:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-27 13:47 [dpdk-dev] [PATCH 1/4] kni: add function to query the name of a kni object Bruce Richardson
2015-05-27 13:51 ` Bruce Richardson
2015-05-27 13:52 ` Marc Sune
2015-05-27 13:55   ` Bruce Richardson
     [not found]     ` <5565D195.9040701@bisdn.de>
2015-05-27 15:36       ` Bruce Richardson
2015-06-15  1:04 ` Zhang, Helin
2015-06-16 14:17   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).