From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) by dpdk.org (Postfix) with ESMTP id 9169147D1 for ; Thu, 21 Jul 2016 16:21:36 +0200 (CEST) Received: by mail-lf0-f43.google.com with SMTP id g62so63343090lfe.3 for ; Thu, 21 Jul 2016 07:21:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=Gatmk+VZIstG8yAYSLA0gUPnDu893uOENplRcKKoW84=; b=IJUG9V6XNoc53u9B5v3FLugk+gU7LzKwZqXJrJlSC0tRNVT4vnHiQ03ar98gTBlvRc zFeMLXNmPVnWubJq3n15b7X4CjT3ZQ9TfEBuv+Aib2rkwBLccDWrQkTOPwBSAnqq6KWa RZoF9nAw3LeG2KmIstRBn293ACOrx7C+EyZQT+eiI83DiELKuETCW/Y0q4A6A6NfB1HW 6BDiIVO5D4dxCZFNiAwySg58rQYcsHcJJrbKeJKjXvB4BqfVU+KwVfKE7LhUtMlJesBY jnDiAmhZW383GpGSgrKYkq16NlDJY+im1+EhIqm8Tv7Ck644oXiLN3uf+elfTn/Vkcmy XnJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=Gatmk+VZIstG8yAYSLA0gUPnDu893uOENplRcKKoW84=; b=gL5VTXg0OoPc1MaFaTCjS6HyH49QZnHKTick9JqJ2bNqqxy+tXkFqVi4rbSUnD/zHC igPzuiENL7wVcBHLxBmNSKZoGmI+nPTrDvU1lwVv9PapZQOiK3pLwOJ6OBBydu9dTYOl 2ARzeytfHyPFv6yl4S46vApixIVZPTYVtoGB8cAL+F7e58e3qv9OHB/l+3lDd898NRio gx0C3MEhlTA3cf2uUymKyMagU/u6btDvS8nVbbCNj63HHljUoAEWfoldXCIN1DJbM/pc T9po+sN/YzHNJaqLb9sjmStWWjPttrFsXXjSKhNBZsespJEBIQcmMMDjL+JWrGkvt8Lf UjXw== X-Gm-Message-State: ALyK8tJ9r5bc14R9S671aTmHqRhnaBi5OzEM+ZkO6WzHzRaVCISKkQeMtEuI4S5zxLjGWR3t X-Received: by 10.25.207.10 with SMTP id f10mr16893437lfg.108.1469110896178; Thu, 21 Jul 2016 07:21:36 -0700 (PDT) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id 35sm1876612ljb.10.2016.07.21.07.21.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jul 2016 07:21:35 -0700 (PDT) From: Thomas Monjalon To: Wei Dai Cc: dev@dpdk.org Date: Thu, 21 Jul 2016 16:21:33 +0200 Message-ID: <10671507.FyByOGJAaB@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1469081018-55300-1-git-send-email-wei.dai@intel.com> References: <1469081018-55300-1-git-send-email-wei.dai@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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: Thu, 21 Jul 2016 14:21:36 -0000 Hi, 2016-07-21 14:03, Wei Dai: > 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 Thanks for the catch! > --- 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 . It also a range when inside a group. The difference is the mapping to the cpus. I think this new comment brings more confusion. Better to skip. > * 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 > + */ > */ Please do not add a second example just to show how to test your fix. > @@ -679,6 +689,8 @@ eal_parse_lcores(const char *lcores) > sizeof(rte_cpuset_t)); > } > > + lflags = 0; > + > lcores = end + 1; > } while (*end != '\0'); It would have more sense to init lflags at the beginning of the loop and replace int lflags = 0; by int lflags;