From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: [PATCH] eal: fix log level/type retrieving on a standard pthread Date: Thu, 12 May 2016 11:22:13 +0200 Message-ID: <57344B45.1070702@6wind.com> References: <1462810416-6183-1-git-send-email-olivier.matz@6wind.com> <57336031.7060509@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: Maxime Leroy To: Ferruh Yigit , dev@dpdk.org, david.marchand@6wind.com Return-path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id C141A558E for ; Thu, 12 May 2016 11:22:31 +0200 (CEST) In-Reply-To: <57336031.7060509@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Ferruh, On 05/11/2016 06:39 PM, Ferruh Yigit wrote: > On 5/9/2016 5:13 PM, Olivier Matz wrote: >> --- a/lib/librte_eal/common/eal_common_log.c >> +++ b/lib/librte_eal/common/eal_common_log.c >> @@ -98,9 +98,10 @@ static int history_enabled = 1; >> struct log_cur_msg { >> uint32_t loglevel; /**< log level - see rte_log.h */ >> uint32_t logtype; /**< log type - see rte_log.h */ >> -} __rte_cache_aligned; > > Removing alignment seems not related the main purpose of the patch. Is > this intentional? Initially, the structure was cache-aligned so each element of the table was stored in a separate cache line, avoiding a lcore accessing its element to polute its neighbors (this was by the way a bit overkill as it's not a performance-sensitive structure). Using a __thread variable instead of a table naturally removes this need because it will be stored in a specific section containing only per-core data. > I have tested with custom code, non-EAL thread have lcore_id value > UINT32_MAX, which is > RTE_MAX_LCORE and rte_log_cur_msg_loglevel gives > default log level as described in commit log. With this patch each > thread gets its own log level. > > Reviewed-by: Ferruh Yigit > Thanks for reviewing and testing. Regards, Olivier