From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [RFC-PATCH-v3 1/6] kni: add function to query the name of a kni object
Date: Wed, 10 Jun 2015 14:07:16 +0100 [thread overview]
Message-ID: <1433941641-19405-2-git-send-email-bruce.richardson@intel.com> (raw)
In-Reply-To: <1433941641-19405-1-git-send-email-bruce.richardson@intel.com>
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.4.2
next prev parent reply other threads:[~2015-06-10 13:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-11 16:29 [dpdk-dev] [RFC PATCHv2 0/2] pktdev as wrapper type Bruce Richardson
2015-05-11 16:29 ` [dpdk-dev] [RFC PATCHv2 1/2] Add example pktdev implementation Bruce Richardson
2015-05-11 16:29 ` [dpdk-dev] [RFC PATCHv2 2/2] example app showing pktdevs used in a chain Bruce Richardson
2015-05-19 11:31 ` [dpdk-dev] [RFC PATCHv2 0/2] pktdev as wrapper type Bruce Richardson
2015-05-20 0:19 ` Wiles, Keith
2015-05-20 8:31 ` Thomas Monjalon
2015-05-20 10:05 ` Marc Sune
2015-05-20 10:28 ` Neil Horman
2015-05-20 17:01 ` Marc Sune
2015-05-20 18:47 ` Neil Horman
2015-05-21 12:12 ` Richardson, Bruce
2015-06-10 13:07 ` [dpdk-dev] [RFC-PATCH-v3 0/6] pktdev update Bruce Richardson
2015-06-10 13:07 ` Bruce Richardson [this message]
2015-06-10 13:07 ` [dpdk-dev] [RFC-PATCH-v3 2/6] pktdev: Add pktdev implementation library Bruce Richardson
2015-06-10 13:07 ` [dpdk-dev] [RFC-PATCH-v3 3/6] example app showing pktdevs used in a chain Bruce Richardson
2015-06-10 13:07 ` [dpdk-dev] [RFC-PATCH-v3 4/6] new pktdev l2fwd sample Bruce Richardson
2015-06-10 13:07 ` [dpdk-dev] [RFC-PATCH-v3 5/6] pktdev: adding app test Bruce Richardson
2015-06-10 13:07 ` [dpdk-dev] [RFC-PATCH-v3 6/6] test: add pktdev performance tests Bruce Richardson
2015-06-10 13:26 ` [dpdk-dev] [RFC-PATCH-v3 0/6] pktdev update Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1433941641-19405-2-git-send-email-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).