From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5B877A0534; Fri, 24 Jan 2020 18:02:36 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 37B383576; Fri, 24 Jan 2020 18:02:36 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 84B3D34F3 for ; Fri, 24 Jan 2020 18:02:34 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jan 2020 09:02:24 -0800 X-IronPort-AV: E=Sophos;i="5.70,358,1574150400"; d="scan'208";a="221073133" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.97]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Jan 2020 09:02:22 -0800 Date: Fri, 24 Jan 2020 17:02:19 +0000 From: Bruce Richardson To: Slava Ovsiienko Cc: Ferruh Yigit , Alexander Kozyrev , "dev@dpdk.org" , Raslan Darawsheh , Matan Azrad , Thomas Monjalon Message-ID: <20200124170219.GB1691@bricha3-MOBL.ger.corp.intel.com> References: <1579789555-23239-1-git-send-email-akozyrev@mellanox.com> <1579803629-152938-1-git-send-email-akozyrev@mellanox.com> <1579803629-152938-3-git-send-email-akozyrev@mellanox.com> <882236c5-7caf-3756-ea87-91f949f4e172@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Subject: Re: [dpdk-dev] [PATCH v2 2/5] net/mlx4: use mlx4 debug flag instead of NDEBUG X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Jan 24, 2020 at 04:50:51PM +0000, Slava Ovsiienko wrote: > > -----Original Message----- > > From: Ferruh Yigit > > Sent: Friday, January 24, 2020 18:43 > > To: Alexander Kozyrev ; dev@dpdk.org > > Cc: Raslan Darawsheh ; Matan Azrad > > ; Slava Ovsiienko ; > > Thomas Monjalon ; Bruce Richardson > > > > Subject: Re: [PATCH v2 2/5] net/mlx4: use mlx4 debug flag instead of NDEBUG > > > > On 1/23/2020 6:20 PM, Alexander Kozyrev wrote: > > > Define a new MLX4_DEBUG compilation flag to get rid of dependency on > > > the NDEBUG definition. This is a preparation step to switch from > > > standard assert clauses to DPDK RTE_ASSERT ones in MLX4 driver. > > > > > > Signed-off-by: Alexander Kozyrev > > > Acked-by: Viacheslav Ovsiienko > > > --- > > > drivers/net/mlx4/Makefile | 4 ++-- > > > drivers/net/mlx4/meson.build | 4 ++-- > > > drivers/net/mlx4/mlx4.c | 4 ++-- > > > drivers/net/mlx4/mlx4_mr.c | 8 ++++---- > > > drivers/net/mlx4/mlx4_rxtx.c | 10 +++++----- > > > drivers/net/mlx4/mlx4_utils.h | 8 ++++---- > > > 6 files changed, 19 insertions(+), 19 deletions(-) > > > > > > diff --git a/drivers/net/mlx4/Makefile b/drivers/net/mlx4/Makefile > > > index 329569d..043e72f 100644 > > > --- a/drivers/net/mlx4/Makefile > > > +++ b/drivers/net/mlx4/Makefile > > > @@ -65,13 +65,13 @@ endif > > > > > > # User-defined CFLAGS. > > > ifeq ($(CONFIG_RTE_LIBRTE_MLX4_DEBUG),y) > > > -CFLAGS += -pedantic -UNDEBUG > > > +CFLAGS += -pedantic -DMLX4_DEBUG > > > > Can't use 'RTE_LIBRTE_MLX4_DEBUG' directly in the .c files, instead of interim > > 'MLX4_DEBUG', many other config options used that way. > > > > > ifneq ($(CONFIG_RTE_TOOLCHAIN_ICC),y) CFLAGS += -DPEDANTIC endif > > > AUTO_CONFIG_CFLAGS += -Wno-pedantic else -CFLAGS += -DNDEBUG > > > -UPEDANTIC > > > +CFLAGS += -UMLX4_DEBUG -UPEDANTIC > > > endif > > > > > > include $(RTE_SDK)/mk/rte.lib.mk > > > diff --git a/drivers/net/mlx4/meson.build > > > b/drivers/net/mlx4/meson.build index 9eb4988..a15a301 100644 > > > --- a/drivers/net/mlx4/meson.build > > > +++ b/drivers/net/mlx4/meson.build > > > @@ -67,9 +67,9 @@ if build > > > endif > > > endforeach > > > if get_option('buildtype').contains('debug') > > > - cflags += [ '-pedantic', '-UNDEBUG', '-DPEDANTIC' ] > > > + cflags += [ '-pedantic', '-DMLX4_DEBUG', '-DPEDANTIC' ] > > > else > > > - cflags += [ '-DNDEBUG', '-UPEDANTIC' ] > > > + cflags += [ '-UMLX4_DEBUG', '-UPEDANTIC' ] > > > > Right now there is no way in meson to enable/disable compile time > > (datapath) debug options in module granularity, it would be good to have > > them. > +1, I think we should not drop the module debug options and > it would be good to support ones with meson. > Discussing with Ferruh offline, one option might be to add a generic --drivers-debug flag [taking the same parameters as the current disable-drivers option], and defines a debug flag (or flags) for the specified driver. To keep things simple for drivers, we could just blindly define for each requested driver the macros similar to that used in make such as ..._DEBUG_RX. _DEBUG_TX. Regards, /Bruce