From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 5A84AAFCC for ; Tue, 15 Apr 2014 15:57:58 +0200 (CEST) Received: from hmsreliant.think-freely.org ([2001:470:8:a08:7aac:c0ff:fec2:933b] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1Wa3s2-0001Nj-V3; Tue, 15 Apr 2014 09:57:58 -0400 Date: Tue, 15 Apr 2014 09:57:54 -0400 From: Neil Horman To: David Marchand Message-ID: <20140415135754.GC3557@hmsreliant.think-freely.org> References: <1397569842-12562-1-git-send-email-david.marchand@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1397569842-12562-1-git-send-email-david.marchand@6wind.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -2.9 (--) X-Spam-Status: No Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] eal: check coremask against detected 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: Tue, 15 Apr 2014 13:57:58 -0000 On Tue, Apr 15, 2014 at 03:50:42PM +0200, David Marchand wrote: > lcores that are set in coremask should be checked against lcores detected on > system. This way, we won't need to check them later. > > Besides, if specifying an unavailable lcore, we currently panic in > eal_thread_loop() because pthread_setaffinity_np fails. > So this check will return an error with a more explicit message in > eal_parse_coremask(). > > "EAL: pthread_setaffinity_np failed > PANIC in eal_thread_loop(): > cannot set affinity" > > becomes : > > "EAL: lcore 4 unavailable > EAL: invalid coremask" > > Signed-off-by: David Marchand > --- > lib/librte_eal/linuxapp/eal/eal.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c > index d2753ec..04b2b32 100644 > --- a/lib/librte_eal/linuxapp/eal/eal.c > +++ b/lib/librte_eal/linuxapp/eal/eal.c > @@ -441,6 +441,11 @@ eal_parse_coremask(const char *coremask) > val = xdigit2val(c); > for(j = 0; j < BITS_PER_HEX && idx < RTE_MAX_LCORE; j++, idx++) { > if((1 << j) & val) { > + if (!lcore_config[idx].detected) { > + RTE_LOG(ERR, EAL, "lcore %u " > + "unavailable\n", idx); > + return -1; > + } > cfg->lcore_role[idx] = ROLE_RTE; > if(count == 0) > cfg->master_lcore = idx; > -- > 1.7.10.4 > > Acked-by: Neil Horman