From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id D1C66591A for ; Wed, 27 May 2015 15:51:27 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 27 May 2015 06:51:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,505,1427785200"; d="scan'208";a="701001582" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.220.149]) by orsmga001.jf.intel.com with SMTP; 27 May 2015 06:51:25 -0700 Received: by (sSMTP sendmail emulation); Wed, 27 May 2015 14:51:24 +0025 Date: Wed, 27 May 2015 14:51:24 +0100 From: Bruce Richardson To: dev@dpdk.org Message-ID: <20150527135123.GA10480@bricha3-MOBL3> References: <1432734469-1668-1-git-send-email-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1432734469-1668-1-git-send-email-bruce.richardson@intel.com> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH 1/4] kni: add function to query the name of a kni object X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2015 13:51:28 -0000 On Wed, May 27, 2015 at 02:47:49PM +0100, Bruce Richardson wrote: > 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 Apologies on the incorrect subject line. This is a standalone patch, not 1 of 4. The commit just happened to be 4th in my git commit history when I generated the patch and I forgot to update the patch count. :-( /Bruce > --- > 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 >