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 C12612B89
 for <dev@dpdk.org>; Thu,  7 Dec 2017 14:21:32 +0100 (CET)
Received: from core.dev.6wind.com (unknown [10.0.0.1])
 by proxy.6wind.com (Postfix) with ESMTPS id DB9AF10F9E8;
 Thu,  7 Dec 2017 14:13:27 +0100 (CET)
Received: from [10.16.0.195] (helo=6wind.com)
 by core.dev.6wind.com with smtp (Exim 4.84_2)
 (envelope-from <olivier.matz@6wind.com>)
 id 1eMw77-00040y-8x; Thu, 07 Dec 2017 14:21:22 +0100
Received: by 6wind.com (sSMTP sendmail emulation);
 Thu, 07 Dec 2017 14:21:21 +0100
Date: Thu, 7 Dec 2017 14:21:21 +0100
From: Olivier MATZ <olivier.matz@6wind.com>
To: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Cc: ferruh.yigit@intel.com, thomas@monjalon.net, dev@dpdk.org
Message-ID: <20171207132120.nwrshnurnn74qhsg@glumotte.dev.6wind.com>
References: <20171122092806.17194-1-pbhagavatula@caviumnetworks.com>
 <20171122092806.17194-3-pbhagavatula@caviumnetworks.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20171122092806.17194-3-pbhagavatula@caviumnetworks.com>
User-Agent: NeoMutt/20170113 (1.7.2)
Subject: Re: [dpdk-dev] [PATCH 3/3] logs: remove log level config option
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <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, 07 Dec 2017 13:21:32 -0000

On Wed, Nov 22, 2017 at 02:58:06PM +0530, Pavan Nikhilesh wrote:
> Remove RTE_LOG_LEVEL config option, use existing RTE_LOG_DP_LEVEL config
> option for controlling datapath log level.
> RTE_LOG_LEVEL is no longer needed as dynamic logging can be used to
> control global and module specific log levels.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>

Tome, removing the RTE_LOG_LEVEL goes in the good direction (less
compile-time options).

[...]

> --- a/drivers/net/ena/base/ena_plat_dpdk.h
> +++ b/drivers/net/ena/base/ena_plat_dpdk.h
> @@ -96,7 +96,7 @@ typedef uint64_t dma_addr_t;
>  #define ENA_GET_SYSTEM_USECS()						\
>  	(rte_get_timer_cycles() * US_PER_S / rte_get_timer_hz())
>  
> -#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
> +#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
>  #define ENA_ASSERT(cond, format, arg...)				\
>  	do {								\
>  		if (unlikely(!(cond))) {				\
> diff --git a/drivers/net/sfc/sfc_debug.h b/drivers/net/sfc/sfc_debug.h
> index 92eba9c38..3f9ccf1e6 100644
> --- a/drivers/net/sfc/sfc_debug.h
> +++ b/drivers/net/sfc/sfc_debug.h
> @@ -35,7 +35,7 @@
>  #include <rte_debug.h>
>  
>  #ifdef RTE_LIBRTE_SFC_EFX_DEBUG
> -/* Avoid dependency from RTE_LOG_LEVEL to be able to enable debug check
> +/* Avoid dependency from RTE_LOG_DP_LEVEL to be able to enable debug check
>   * in the driver only.
>   */
>  #define SFC_ASSERT(exp)			RTE_VERIFY(exp)
> diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
> index e50b1a1a8..eb78decdd 100644
> --- a/examples/l3fwd-acl/main.c
> +++ b/examples/l3fwd-acl/main.c
> @@ -68,7 +68,7 @@
>  #include <rte_string_fns.h>
>  #include <rte_acl.h>
>  
> -#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
> +#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
>  #define L3FWDACL_DEBUG
>  #endif
>  #define DO_RFC_1812_CHECKS
> diff --git a/test/test/test.h b/test/test/test.h
> index 08ffe949c..8fdb3045e 100644
> --- a/test/test/test.h
> +++ b/test/test/test.h
> @@ -204,7 +204,7 @@ struct unit_test_case {
>  
>  #define TEST_CASES_END() { NULL, NULL, NULL, NULL, 0 }
>  
> -#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
> +#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
>  #define TEST_HEXDUMP(file, title, buf, len) rte_hexdump(file, title, buf, len)
>  #else
>  #define TEST_HEXDUMP(file, title, buf, len) do {} while (0)

For drivers, it looks correct to replace RTE_LOG_LEVEL by
RTE_LOG_DP_LEVEL, from what I see it's about dataplane logs.

For l3fwd, I'm less sure, but it could make sense too.

For test, I think we should replace TEST_HEXDUMP() by a function
that checks the runtime log level instead of relying on RTE_LOG_DP_LEVEL.
I can submit a patch for this.

Olivier