Message ID | 1469618870-144592-1-git-send-email-wei.dai@intel.com (mailing list archive) |
---|---|
State | Rejected, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id D6C5B58F7; Wed, 27 Jul 2016 13:29:23 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 8D8FE58F1 for <dev@dpdk.org>; Wed, 27 Jul 2016 13:29:22 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 27 Jul 2016 04:29:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,429,1464678000"; d="scan'208";a="740414737" Received: from dpdk2.bj.intel.com ([172.16.182.189]) by FMSMGA003.fm.intel.com with ESMTP; 27 Jul 2016 04:29:19 -0700 From: Wei Dai <wei.dai@intel.com> To: dev@dpdk.org Cc: Wei Dai <wei.dai@intel.com> Date: Wed, 27 Jul 2016 19:27:50 +0800 Message-Id: <1469618870-144592-1-git-send-email-wei.dai@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1469081018-55300-1-git-send-email-wei.dai@intel.com> References: <1469081018-55300-1-git-send-email-wei.dai@intel.com> Subject: [dpdk-dev] [PATCH v3 4/4] eal: fix end character check in --lcores argument X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Wei Dai
July 27, 2016, 11:27 a.m. UTC
With --lcores 'a-b@c-d', eal_parse_cores() fails because
eal_parse_set() fails due to the next character after
lcore set a-b, which is '@'and not ',' or '\0'.
There is also a right check immediately
after this incorrect check.
Fixes: 53e54bf81700 ("eal: new option --lcores for cpu assignment")
Signed-off-by: Wei Dai <wei.dai@intel.com>
---
lib/librte_eal/common/eal_common_options.c | 2 --
1 file changed, 2 deletions(-)
Comments
On 7/27/2016 12:27 PM, Wei Dai wrote: > With --lcores 'a-b@c-d', eal_parse_cores() fails because > eal_parse_set() fails due to the next character after > lcore set a-b, which is '@'and not ',' or '\0'. > There is also a right check immediately > after this incorrect check. > > Fixes: 53e54bf81700 ("eal: new option --lcores for cpu assignment") > > Signed-off-by: Wei Dai <wei.dai@intel.com> I am not sure if a-b@c-d syntax should be supported. (a-b)@(c-d) is supported and already working. It looks like a-b is only planned to use without @ and the usage a-b@c-d, like 1-2@4-5 implies to me: 1 -> 4 2 -> 5 but it doesn't work that way, it is always grouped after @, like it has parenthesis, what it does is: 1 -> 4,5 2 -> 4,5 Even a-b@c is not working, but as I said if @ will be used, using grouping seems more proper to me, like: (a-b)@(c-d) (a-b)@c So this is mainly about defining the syntax, more than implementing it. Somebody know more about syntax can comment better. Regards, ferruh
2016-07-28 16:26, Ferruh Yigit: > On 7/27/2016 12:27 PM, Wei Dai wrote: > > With --lcores 'a-b@c-d', eal_parse_cores() fails because > > eal_parse_set() fails due to the next character after > > lcore set a-b, which is '@'and not ',' or '\0'. > > There is also a right check immediately > > after this incorrect check. > > > > Fixes: 53e54bf81700 ("eal: new option --lcores for cpu assignment") > > > > Signed-off-by: Wei Dai <wei.dai@intel.com> > > I am not sure if a-b@c-d syntax should be supported. (a-b)@(c-d) is > supported and already working. Agreed. Series applied, except this last patch 4, thanks
Hi, Thomas, Yigit > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Friday, July 29, 2016 12:06 AM > To: Dai, Wei <wei.dai@intel.com> > Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com> > Subject: Re: [dpdk-dev] [PATCH v3 4/4] eal: fix end character check in --lcores > argument > > 2016-07-28 16:26, Ferruh Yigit: > > On 7/27/2016 12:27 PM, Wei Dai wrote: > > > With --lcores 'a-b@c-d', eal_parse_cores() fails because > > > eal_parse_set() fails due to the next character after lcore set a-b, > > > which is '@'and not ',' or '\0'. > > > There is also a right check immediately after this incorrect check. > > > > > > Fixes: 53e54bf81700 ("eal: new option --lcores for cpu assignment") > > > > > > Signed-off-by: Wei Dai <wei.dai@intel.com> > > > > I am not sure if a-b@c-d syntax should be supported. (a-b)@(c-d) is > > supported and already working. > > Agreed. > > Series applied, except this last patch 4, thanks Sorry, I can't find any document to clarify whether a-b@c-d shoule be supported. So I design following case to verify all kinds of combination of - and @. I tested my patch with --lcores '0-3@12-15, 4-7@(8-11), (8-11)@4-7, (12-15)@(0-3), 16-19, (20-23) ', After calling eal_parse_args(argc, argv), I observed lcore_config[i].cpuset to check cpuset of each lcore. I added following codes immediately after calling fctret = eal_parse_args(argc, argv); in function rte_eal_init( ) in eal.c to check this patch. { struct rte_config *p; const char *rte_role_str[2] = {"ROLE_RTE", "ROLE_OFF"}; p = rte_eal_get_configuration(); for (i=0; i<28; i++) { printf("lcore %2d status = %s, runs on cpuset = 0x%08lX\n", i, rte_role_str[p->lcore_role[i]], lcore_config[i].cpuset.__bits[0]); } } The result is as follow: lcore 0 status = ROLE_RTE, runs on cpuset = 0x0000F000 lcore 1 status = ROLE_RTE, runs on cpuset = 0x0000F000 lcore 2 status = ROLE_RTE, runs on cpuset = 0x0000F000 lcore 3 status = ROLE_RTE, runs on cpuset = 0x0000F000 lcore 4 status = ROLE_RTE, runs on cpuset = 0x00000F00 lcore 5 status = ROLE_RTE, runs on cpuset = 0x00000F00 lcore 6 status = ROLE_RTE, runs on cpuset = 0x00000F00 lcore 7 status = ROLE_RTE, runs on cpuset = 0x00000F00 lcore 8 status = ROLE_RTE, runs on cpuset = 0x000000F0 lcore 9 status = ROLE_RTE, runs on cpuset = 0x000000F0 lcore 10 status = ROLE_RTE, runs on cpuset = 0x000000F0 lcore 11 status = ROLE_RTE, runs on cpuset = 0x000000F0 lcore 12 status = ROLE_RTE, runs on cpuset = 0x0000000F lcore 13 status = ROLE_RTE, runs on cpuset = 0x0000000F lcore 14 status = ROLE_RTE, runs on cpuset = 0x0000000F lcore 15 status = ROLE_RTE, runs on cpuset = 0x0000000F lcore 16 status = ROLE_RTE, runs on cpuset = 0x00010000 lcore 17 status = ROLE_RTE, runs on cpuset = 0x00020000 lcore 18 status = ROLE_RTE, runs on cpuset = 0x00040000 lcore 19 status = ROLE_RTE, runs on cpuset = 0x00080000 lcore 20 status = ROLE_RTE, runs on cpuset = 0x00F00000 lcore 21 status = ROLE_RTE, runs on cpuset = 0x00F00000 lcore 22 status = ROLE_RTE, runs on cpuset = 0x00F00000 lcore 23 status = ROLE_RTE, runs on cpuset = 0x00F00000 lcore 24 status = ROLE_OFF, runs on cpuset = 0x00000000 lcore 25 status = ROLE_OFF, runs on cpuset = 0x00000000 lcore 26 status = ROLE_OFF, runs on cpuset = 0x00000000 lcore 27 status = ROLE_OFF, runs on cpuset = 0x00000000
2016-08-02 08:22, Dai, Wei: > Hi, Thomas, Yigit > > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > > 2016-07-28 16:26, Ferruh Yigit: > > > On 7/27/2016 12:27 PM, Wei Dai wrote: > > > > With --lcores 'a-b@c-d', eal_parse_cores() fails because > > > > eal_parse_set() fails due to the next character after lcore set a-b, > > > > which is '@'and not ',' or '\0'. > > > > There is also a right check immediately after this incorrect check. > > > > > > > > Fixes: 53e54bf81700 ("eal: new option --lcores for cpu assignment") > > > > > > > > Signed-off-by: Wei Dai <wei.dai@intel.com> > > > > > > I am not sure if a-b@c-d syntax should be supported. (a-b)@(c-d) is > > > supported and already working. > > > > Agreed. > > > > Series applied, except this last patch 4, thanks > > Sorry, I can't find any document to clarify whether a-b@c-d shoule be supported. > So I design following case to verify all kinds of combination of - and @. > I tested my patch with --lcores '0-3@12-15, 4-7@(8-11), (8-11)@4-7, (12-15)@(0-3), 16-19, (20-23) ', OK. So do you agree we can discard this patch and forget this syntax?
diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 1a1bab3..f443a61 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -469,8 +469,6 @@ eal_parse_set(const char *input, uint16_t set[], unsigned num) max = idx; while (isblank(*end)) end++; - if (*end != ',' && *end != '\0') - return -1; } if (*end != ',' && *end != '\0' &&