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 01BC2B0FA for ; Fri, 13 Jun 2014 19:25:34 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 13 Jun 2014 10:25:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,472,1400050800"; d="scan'208";a="555181042" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by fmsmga002.fm.intel.com with ESMTP; 13 Jun 2014 10:25:33 -0700 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.58]) by IRSMSX104.ger.corp.intel.com ([169.254.5.136]) with mapi id 14.03.0123.003; Fri, 13 Jun 2014 18:25:32 +0100 From: "Richardson, Bruce" To: "Lu, Patrick" Thread-Topic: [dpdk-dev] [PATCH] Add an API to query enabled core index Thread-Index: AQHPhbfwu/CiTpgmaEuQDGPmRpHqN5tsYlCAgAASJgCAAJ2eAIAAi5KwgAGXiwCAABeEsA== Date: Fri, 13 Jun 2014 17:25:31 +0000 Message-ID: <59AF69C657FD0841A61C55336867B5B01AA360DF@IRSMSX103.ger.corp.intel.com> References: <1402519509-26653-1-git-send-email-Patrick.Lu@intel.com> <9007853.cgh6aaULN3@xps13> <59AF69C657FD0841A61C55336867B5B01AA35210@IRSMSX103.ger.corp.intel.com> <539962C0.10701@6wind.com> <59AF69C657FD0841A61C55336867B5B01AA357CE@IRSMSX103.ger.corp.intel.com> <20140613165828.GA31321@debian-x64.ch.intel.com> In-Reply-To: <20140613165828.GA31321@debian-x64.ch.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] 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] Add an API to query enabled core index 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: Fri, 13 Jun 2014 17:25:35 -0000 > -----Original Message----- > From: Lu, Patrick > Sent: Friday, June 13, 2014 9:58 AM > To: Richardson, Bruce > Cc: Olivier MATZ; Thomas Monjalon; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] Add an API to query enabled core index >=20 > On Thu, Jun 12, 2014 at 08:54:11AM -0700, Richardson, Bruce wrote: > > > > > > > -----Original Message----- > > > From: Olivier MATZ [mailto:olivier.matz@6wind.com] > > > Sent: Thursday, June 12, 2014 1:20 AM > > > To: Richardson, Bruce; Thomas Monjalon; Lu, Patrick > > > Cc: dev@dpdk.org > > > Subject: Re: [dpdk-dev] [PATCH] Add an API to query enabled core inde= x > > > > > > Hello, > > > > > > On 06/11/2014 11:57 PM, Richardson, Bruce wrote: > > > >> I think core_id2 is not a representative name. > > > >> What do you think of renaming core_id as lcore_hwid and core_id2 a= s > > > >> lcore_index? > > > >> > > > >> -- > > > > I like lcore_index as the name for the new function. However, I'm n= ot sure > in > > > that case that we want/need to rename the old one. > > > > > > What about lcore_rank ? > > > It may avoid confusion between "id" and "index", which are quite > > > close visually and phonetically. > > > > Not sure about rank, index is more correct. How about making it "app_in= dex" > or "app_idx", to indicate that it's not a global id but rather the idx th= at's local to > the running app instance. > > > > Other alternative approach would be rte_lcore_position() API that takes= a > hardware lcore id, and tells you it's "position" in the coremask for the > application, i.e. lcore 6 is in position 2 (of e.g. 5) lcores, for instan= ce. [It would > obviously return -1 on non-active cores.] > The main purpose of this API is for a running thread know its relative > index in all enabled core, so it can access the shared data structure > with correct index. I don't know if we necessarily need to pass in a > hardware lcore id, I suggest the API will implicit call rte_lcore_id. Yes, having the API call rte_lcore_id internally is simpler. However, the a= dvantage of having the API take the hardware core id means that it then bec= omes possible for one thread to query the position of another. However, how= likely this scenario is to be useful, I'm not sure.=20 >=20 > I think either position or index is a much appropriated name for this > API. What do you think of "rte_lcore_app_idx()" then as the name? This hopefully= is descriptive enough and should allow us to leave the existing API unmodi= fied.