From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cmailsend24.nm.naver.com (cmailsend24.nm.naver.com [125.209.239.201]) by dpdk.org (Postfix) with ESMTP id F0468590C for ; Wed, 27 May 2015 16:04:42 +0200 (CEST) Received: (qmail 11621 invoked by uid 100); 27 May 2015 14:04:41 -0000 Received: from 10.114.49.78 (HELO cweb11.nm.nhnsystem.com) (10.114.49.78) by cmailsend24.nm.naver.com with SMTP;27 May 2015 14:04:40 -0000 Date: Wed, 27 May 2015 23:04:40 +0900 (KST) From: =?UTF-8?B?7LWc7J217ISx?= To: dev@dpdk.org Message-ID: <77fdb0de301eb5b1da1dd7aea32e5826@cweb11.nm.nhnsystem.com> MIME-Version: 1.0 Importance: normal X-Priority: 3 (Normal) X-Naver-CIP: 121.144.186.46 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] =?utf-8?q?Question_about_worker_assignment_in_load_bal?= =?utf-8?q?ancer_implementaion_in_DPDK_library_example=2E?= X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: =?UTF-8?B?7LWc7J217ISx?= 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 14:04:44 -0000 RGVhciBEUERLIGV4cGVydHMuCiAKSSBoYXZlIGEgcXVlc3Rpb24gYWJvdXQgbG9hZCBiYWxhbmNl ciBpbXBsZW1lbnRhaW9uIGluIERQREsgbGlicmFyeSBleGFtcGxlLgooZHBkay0yLjAuMC9leGFt cGxlcy9sb2FkX2JhbGFuY2VyKQogCkkgcmVhZCBmcm9tIGxvYWQgYmFsYW5jZXIgYXBwbGljYXRp b24gdXNlciBndWlkZSB0aGF0IFRoZSB3b3JrZXIgbGNvcmUgdG8gaGFuZGxlIHRoZSBjdXJyZW50 IHBhY2tldCBpcyBkZXRlcm1pbmVkIGJ5IHJlYWRpbmcgYSBwcmVkZWZpbmVkIDEgYnl0ZSBmaWVs ZCBmcm9tIHRoZSBpbnB1dCBwYWNrZXQuCiAKd29ya2VyX2lkID0gcGFja2V0W2xvYWRfYmFsYW5j aW5nX2ZpZWxkKHBvc19sYildICUgbl93b3JrZXJzIC4KIApIb3dldmVyIEkgZm91bmQgaXRzIGlt cGxlbWVudGFpb24gb2YgdGhlIGFib3ZlIGZ1bmN0aW9uIGluIHRoZSBzb3VyY2UgY29kZS4KIAp3 b3JrZXJfMCA9IGRhdGFfMF8wW3Bvc19sYl0gJmFtcDsgKG5fd29ya2VycyAtIDEpOwp3b3JrZXJf MSA9IGRhdGFfMF8xW3Bvc19sYl0gJmFtcDsgKG5fd29ya2VycyAtIDEpOwogCkRvZXMgdGhpcyBp bXBsZW1lbnRhdGlvbiB3b3Jrcz8KIApJZiB0aGUgbl93b3JrZXJzID0gMywgdGhlIHdvcmtlcl8w IGFuZCB3b3JrZXJfMSBoYXZlIG9ubHkgdmFsdWVzIG9mIDAgb3IgMi4KIApJIHdpbGwgYXBwcmVj aWF0ZSBpZiBJIGNhbiBiZSBnaXZlbiBhbnkgYWR2aWNlIG9yIGluZm9ybWF0aW9uLgogClRoYW5r IHlvdSB2ZXJ5IG11Y2guCiAKU2luY2VyZWx5IFlvdXJzLAogCkljay1TdW5nIENob2kuCgo= >From marc.sune@bisdn.de Wed May 27 16:15:52 2015 Return-Path: Received: from mx.bisdn.de (mx.bisdn.de [185.27.182.31]) by dpdk.org (Postfix) with ESMTP id 11ADD9E7 for ; Wed, 27 May 2015 16:15:52 +0200 (CEST) Received: from [172.16.250.156] (unknown [172.16.250.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx.bisdn.de (Postfix) with ESMTPSA id C2FACA3378; Wed, 27 May 2015 16:15:51 +0200 (CEST) Message-ID: <5565D195.9040701@bisdn.de> Date: Wed, 27 May 2015 16:15:49 +0200 From: Marc Sune User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0 MIME-Version: 1.0 To: Bruce Richardson References: <1432734469-1668-1-git-send-email-bruce.richardson@intel.com> <5565CC22.8050003@bisdn.de> <20150527135533.GB10480@bricha3-MOBL3> In-Reply-To: <20150527135533.GB10480@bricha3-MOBL3> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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: Wed, 27 May 2015 14:15:52 -0000 On 27/05/15 15:55, Bruce Richardson wrote: > On Wed, May 27, 2015 at 03:52:34PM +0200, Marc Sune wrote: >> >> On 27/05/15 15:47, 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 >>> --- >>> 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; >>> +} >> Since a pointer to the kni context (struct rte_kni) is exposed to the user >> (rte_kni_get() and rte_kni_alloc ()), and the field is directly in the >> struct, is this API call really necessary? I would only see this necessary >> if the API would only expose a handle, like a port_id for ethdev >> >> Marc > The structure definition is in rte_kni.c, not in the header file, so applications > can't read the name directly. In other words, the create API just exposes a handle. > [The structure in the header is the conf structure, not the full kni struct] Ops, you are right. I overlooked that. What about: extern void rte_kni_get_config(const struct rte_kni *kni, struct rte_kni_conf* conf); which fills in (copies) the fields of conf would allow to recover the original configuration, including the name? It is closer rte_eth_dev_info_get (unfortunately rte_kni_info_get is taken by the deprecated API), and would work if we add more params to rte_kni_conf. Thanks marc > /Bruce > >>> + >>> /* >>> * 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;