From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 2A73D2C60 for ; Wed, 27 Jul 2016 12:06:10 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 27 Jul 2016 03:06:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,429,1464678000"; d="scan'208";a="1003399231" Received: from kmsmsx151.gar.corp.intel.com ([172.21.73.86]) by orsmga001.jf.intel.com with ESMTP; 27 Jul 2016 03:06:08 -0700 Received: from pgsmsx106.gar.corp.intel.com ([169.254.9.48]) by KMSMSX151.gar.corp.intel.com ([169.254.10.183]) with mapi id 14.03.0248.002; Wed, 27 Jul 2016 18:06:06 +0800 From: "Dai, Wei" To: bynes adam CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] eal: fix parsing of argument of option --lcores Thread-Index: AQHR4xXn28RL7ZAC00SQ32mXAERe8aAi1RUAgAk4qyA= Date: Wed, 27 Jul 2016 10:06:06 +0000 Message-ID: <49759EB36A64CF4892C1AFEC9231E8D63A2663E0@PGSMSX106.gar.corp.intel.com> References: <1469081018-55300-1-git-send-email-wei.dai@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTc3YzEzYjUtZGRhMS00YTkzLTg4N2EtNGZhOTlmODVlYjE0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkFLNnVVMzVVMFhEemJNUzdnR1RKNm8xNzhhTXNFajNob0NtSUFVVkdPM3c9In0= x-ctpclassification: CTP_IC x-originating-ip: [172.30.20.205] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] eal: fix parsing of argument of option --lcores 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 Jul 2016 10:06:10 -0000 Hi Bynes Thanks for your feedback. > -----Original Message----- > From: bynes adam [mailto:adambynes@outlook.com] > Sent: Friday, July 22, 2016 4:45 AM > To: Dai, Wei > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] eal: fix parsing of argument of option --= lcores >=20 > On Thu, Jul 21, 2016 at 02:03:38PM +0800, Wei Dai wrote: > Hi Wei, > > The '-' in lcores set overrides cpu set of following lcore set in the > > argument of EAL option --lcores. > > > > Fixes: 53e54bf81700 ("eal: new option --lcores for cpu assignment") > > > > Signed-off-by: Wei Dai > > --- > > lib/librte_eal/common/eal_common_options.c | 12 ++++++++++++ > > 1 file changed, 12 insertions(+) > > > > diff --git a/lib/librte_eal/common/eal_common_options.c > > b/lib/librte_eal/common/eal_common_options.c > > index 0a594d7..96eb1a9 100644 > > --- a/lib/librte_eal/common/eal_common_options.c > > +++ b/lib/librte_eal/common/eal_common_options.c > > @@ -563,6 +563,7 @@ convert_to_cpuset(rte_cpuset_t *cpusetp, > > * lcores, cpus could be a single digit/range or a group. > > * '(' and ')' are necessary if it's a group. > > * If not supply '@cpus', the value of cpus uses the same as lcores. > > + * The 'a-b' in lcores not within '(' and ')' means a,a+1,...,b-1,b . > this description is not very clear, a-b and (a-b) are both the same meani= ng. > may be need a table for comparison > a-b@(c-d) > a-b@c-d > (a-b)@c-d > (a-b)@(c-d) > all the above I believe are the same > only the following two cases: > a-b, > (a-b), With --lcores '0-3@12-15', eal_parse_cores( ) will fail because eal_parse_s= et( ) find the next char after lcore set is '@' and is not ',' or '\0'. So the bug in eal_parse_set( ) should be fixed.=20 A patch v3 will be provided. After fixing, I test it with --lcores '0-3@12-15, 4-7@(8-11), (8-11)@4-7, = (12-15)@(0-3), 16-19, (20-23) ' It works well. Thanks Wei > so the key point here is the @ and (), not only @ > > * e.g. '1,2@(5-7),(3-5)@(0,2),(0,6),7-8' means start 9 EAL thread as = below > > * lcore 0 runs on cpuset 0x41 (cpu 0,6) > > * lcore 1 runs on cpuset 0x2 (cpu 1) > > @@ -571,6 +572,15 @@ convert_to_cpuset(rte_cpuset_t *cpusetp, > > * lcore 6 runs on cpuset 0x41 (cpu 0,6) > > * lcore 7 runs on cpuset 0x80 (cpu 7) > > * lcore 8 runs on cpuset 0x100 (cpu 8) > > + * e.g. '0-2,(3-5)@(3,4),6@(5,6),7@(5-7)'means start 8 EAL threads as > below > > + * lcore 0 runs on cpuset 0x1 (cpu 0) > > + * lcore 1 runs on cpuset 0x2 (cpu 1) > > + * lcore 2 runs on cpuset ox4 (cpu 2) > > + * lcore 3,4,5 runs on cpuset 0x18 (cpu 3,4) > > + * lcore 6 runs on cpuset 0x60 (cpu 5,6) > > + * lcore 7 runs on cpuset 0xe0 (cpu 5,6,7) > > + * The second case is used to test bugfix for lflags not be cleared > > + after use > you can put this sentance and description into the commit log I don't thi= nk you > should put bugfix description in comments here. > > + */ > > */ > > static int > > eal_parse_lcores(const char *lcores) > > @@ -679,6 +689,8 @@ eal_parse_lcores(const char *lcores) > > sizeof(rte_cpuset_t)); > > } > > > > + lflags =3D 0; > > + > > lcores =3D end + 1; > > } while (*end !=3D '\0'); > > > > -- > > 2.5.5 > Adam Bynes