From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 21A555A65 for ; Mon, 15 Jun 2015 03:05:20 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 14 Jun 2015 18:05:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,615,1427785200"; d="scan'208";a="587762898" Received: from pgsmsx106.gar.corp.intel.com ([10.221.44.98]) by orsmga003.jf.intel.com with ESMTP; 14 Jun 2015 18:05:19 -0700 Received: from kmsmsx154.gar.corp.intel.com (172.21.73.14) by PGSMSX106.gar.corp.intel.com (10.221.44.98) with Microsoft SMTP Server (TLS) id 14.3.224.2; Mon, 15 Jun 2015 09:04:51 +0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by KMSMSX154.gar.corp.intel.com (172.21.73.14) with Microsoft SMTP Server (TLS) id 14.3.224.2; Mon, 15 Jun 2015 09:04:50 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.129]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.246]) with mapi id 14.03.0224.002; Mon, 15 Jun 2015 09:04:48 +0800 From: "Zhang, Helin" To: "Richardson, Bruce" , "thomas.monjalon@6wind.com" Thread-Topic: [dpdk-dev] [PATCH 1/4] kni: add function to query the name of a kni object Thread-Index: AQHQmIPEz2EMA0SR+0WZK+OSQh7zUJ2s3Uig Date: Mon, 15 Jun 2015 01:04:48 +0000 Message-ID: References: <1432734469-1668-1-git-send-email-bruce.richardson@intel.com> In-Reply-To: <1432734469-1668-1-git-send-email-bruce.richardson@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" 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: Mon, 15 Jun 2015 01:05:21 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson > Sent: Wednesday, May 27, 2015 9:48 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH 1/4] kni: add function to query the name of a = kni > object >=20 > When a KNI object is created, a name is assigned to it which is stored in= ternally. > 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. >=20 > Signed-off-by: Bruce Richardson Acked-by: Helin Zhang > --- > 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(+) >=20 > 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; > } >=20 > +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 *k= ni) \ > extern struct rte_kni *rte_kni_get(const char *name); >=20 > /** > + * 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