From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id A20E09601 for ; Mon, 22 Dec 2014 11:01:51 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 22 Dec 2014 01:58:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,691,1406617200"; d="scan'208";a="502539268" Received: from irsmsx153.ger.corp.intel.com ([163.33.192.75]) by orsmga003.jf.intel.com with ESMTP; 22 Dec 2014 01:57:04 -0800 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.209]) by IRSMSX153.ger.corp.intel.com ([163.33.192.75]) with mapi id 14.03.0195.001; Mon, 22 Dec 2014 10:01:39 +0000 From: "Walukiewicz, Miroslaw" To: "Richardson, Bruce" , "Liang, Cunming" Thread-Topic: [dpdk-dev] [RFC PATCH 0/7] support multi-phtread per lcore Thread-Index: AQHQFOb74ekE1aZuS0qI47KzEksKLpyKJ0pQgAFMagCABQyCsIAAEV2AgAS8XBCAAN6IgIAAj96AgAQtdYCAAISagIAAAdeA Date: Mon, 22 Dec 2014 10:01:38 +0000 Message-ID: <7C4248CAE043B144B1CD242D275626532FE2908C@IRSMSX104.ger.corp.intel.com> References: <1418263490-21088-1-git-send-email-cunming.liang@intel.com> <7C4248CAE043B144B1CD242D275626532FE15298@IRSMSX104.ger.corp.intel.com> <7C4248CAE043B144B1CD242D275626532FE232BA@IRSMSX104.ger.corp.intel.com> <7C4248CAE043B144B1CD242D275626532FE27C3B@IRSMSX104.ger.corp.intel.com> <20141219100342.GA3848@bricha3-MOBL3> <20141222094603.GA1768@bricha3-MOBL3> In-Reply-To: <20141222094603.GA1768@bricha3-MOBL3> Accept-Language: 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] [RFC PATCH 0/7] support multi-phtread per lcore 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, 22 Dec 2014 10:01:52 -0000 > -----Original Message----- > From: Richardson, Bruce > Sent: Monday, December 22, 2014 10:46 AM > To: Liang, Cunming > Cc: Walukiewicz, Miroslaw; dev@dpdk.org > Subject: Re: [dpdk-dev] [RFC PATCH 0/7] support multi-phtread per lcore >=20 > On Mon, Dec 22, 2014 at 01:51:27AM +0000, Liang, Cunming wrote: > > ... > > > I'm conflicted on this one. However, I think far more applications wo= uld > be > > > broken > > > to start having to use thread_id in place of an lcore_id than would b= e > broken > > > by having the lcore_id no longer actually correspond to a core. > > > I'm actually struggling to come up with a large number of scenarios w= here > it's > > > important to an app to determine the cpu it's running on, compared to > the large > > > number of cases where you need to have a data-structure per thread. I= n > DPDK > > > libs > > > alone, you see this assumption that lcore_id =3D=3D thread_id a large= number > of > > > times. > > > > > > Despite the slight logical inconsistency, I think it's better to avoi= d > introducing > > > a thread-id and continue having lcore_id representing a unique thread= . > > > > > > /Bruce > > > > Ok, I understand it. > > I list the implicit meaning if using lcore_id representing the unique t= hread. > > 1). When lcore_id less than RTE_MAX_LCORE, it still represents the logi= cal > core id. > > 2). When lcore_id large equal than RTE_MAX_LCORE, it represents an > unique id for thread. > > 3). Most of APIs(except rte_lcore_id()) in rte_lcore.h suggest to be us= ed > only in CASE 1) > > 4). rte_lcore_id() can be used in CASE 2), but the return value no matt= er > represent a logical core id. > > > > If most of us feel it's acceptable, I'll prepare for the RFC v2 base on= this > conclusion. > > > > /Cunming >=20 > Sorry, I don't like that suggestion either, as having lcore_id values gre= ater > than RTE_MAX_LCORE is terrible, as how will people know how to dimension > arrays > to be indexes by lcore id? Given the choice, if we are not going to just = use > lcore_id as a generic thread id, which is always between 0 and > RTE_MAX_LCORE > we can look to define a new thread_id variable to hold that. However, it > should > have a bounded range. > From an ease-of-porting perspective, I still think that the simplest opti= on is to > use the existing lcore_id and accept the fact that it's now a thread id r= ather > than an actual physical lcore. Question is, is would that cause us lots o= f issues > in the future? >=20 I would prefer keeping the RTE_MAX_LCORES as Bruce suggests and=20 determine the HW core on base of following condition if we really have to k= now this. int num_cores_online =3D count of cores encountered in the core mask provid= ed by cmdline parameter Rte_lcore_id() < num_cores_online -> physical core (pthread first started o= n the core) Rte_lcore_id() >=3D num_cores_online -> pthread created by rte_pthread_crea= te Mirek > /Bruce