Hi, Thomas, Yigit > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com] > Sent: Friday, July 29, 2016 12:06 AM > To: Dai, Wei <wei.dai at intel.com> > Cc: dev at dpdk.org; Yigit, Ferruh <ferruh.yigit at 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 at 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 at intel.com> > > > > I am not sure if a-b at 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 at 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 at 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