From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <olivier.matz@6wind.com>
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 <dev@dpdk.org>; Thu, 12 May 2016 11:22:31 +0200 (CEST)
Received: from [10.16.0.195] (unknown [10.16.0.195])
 by proxy.6wind.com (Postfix) with ESMTP id B12F92669F;
 Thu, 12 May 2016 11:20:54 +0200 (CEST)
To: Ferruh Yigit <ferruh.yigit@intel.com>, dev@dpdk.org,
 david.marchand@6wind.com
References: <1462810416-6183-1-git-send-email-olivier.matz@6wind.com>
 <57336031.7060509@intel.com>
Cc: Maxime Leroy <maxime.leroy@6wind.com>
From: Olivier MATZ <olivier.matz@6wind.com>
Message-ID: <57344B45.1070702@6wind.com>
Date: Thu, 12 May 2016 11:22:13 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Icedove/38.6.0
MIME-Version: 1.0
In-Reply-To: <57336031.7060509@intel.com>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
Subject: Re: [dpdk-dev] [PATCH] eal: fix log level/type retrieving on a
 standard pthread
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>
X-List-Received-Date: Thu, 12 May 2016 09:22:31 -0000

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 <ferruh.yigit@intel.com>
>

Thanks for reviewing and testing.

Regards,
Olivier