From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 74DBEA0561;
	Mon, 20 Apr 2020 19:21:46 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 1D0171D59A;
	Mon, 20 Apr 2020 19:21:45 +0200 (CEST)
Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com
 [66.111.4.221]) by dpdk.org (Postfix) with ESMTP id C48981C1FE
 for <dev@dpdk.org>; Mon, 20 Apr 2020 19:21:43 +0200 (CEST)
Received: from compute7.internal (compute7.nyi.internal [10.202.2.47])
 by mailnew.nyi.internal (Postfix) with ESMTP id 1F2D75800DB;
 Mon, 20 Apr 2020 13:21:43 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute7.internal (MEProxy); Mon, 20 Apr 2020 13:21:43 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding:content-type; s=fm1; bh=
 B1NEjbpJHCZVa3oUDTxWdgT/otF7n4jNz/oo8tvnyQ8=; b=YjW/Ef71NN1QcXVf
 cTHXA7mQbhEMZ8TwaZnVKwxXs43NFdzx6aCVIPEyXqs9e/pQoClPsCUvD5tuQXqO
 x0J+xmVGFK+grx+T6Gs4GPaFJnttppUz/DkWCnCTFzXO9KrdKo9D+4/KHEGRpm6r
 DGY4FmkLu1vAE6eik+6B4GIeMj2euHv6i/czG1MaxYbTQtKHaQw9Z9/RryP/wzDu
 s/jMDefDDipFmst2/du3P2gTwAc13WcveCxlGzO7Ss0OBN9lV1+PF97OTFeU4R77
 E1xCv005vfJluzwDbFvVX6WQFPFuCFnQ9csVtpw5OJswbsUkX3yDDm831rOKjcXn
 jxbWpw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
 :x-sasl-enc; s=fm2; bh=B1NEjbpJHCZVa3oUDTxWdgT/otF7n4jNz/oo8tvny
 Q8=; b=MhuwIYnQW9GixDLAVEzBG1oFZEYlM119BB/UVwp/Effy0TyuqRp9p12Br
 5xVVkBiF1rf6Tjrz+gCEqn6ekKEtVJFeR3PLgBdTwF6SQq+MM2xiWkeeGWGJ25rz
 kvxO4eqJ361LbU+kdeiQOcEJyB1IEF21b8b3Cg8G9jwZUtN8oIttwLpJp2uxZjNV
 5eE3zszc3NEqrbOraEecuV5C/UiAaW+OzKoeVugTM4A/kCKykwvO/mx4+I9yD3O7
 Ek46fhKyfzCrJ3McP4qct6Voci7384jfsZsmgf/3VQ+RrakymsayIB7gNLRMI1ax
 OPkD2Ta3oBdfK1U3IZDbvLIMrIPEg==
X-ME-Sender: <xms:JdqdXhz0PRgQKMDUoMloH8qV6J2-RfJeBbXpFv3054iIfc9hpMOLNA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrgeefgddutdeiucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr
 shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecukf
 hppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghrufhiiigvpedtnecurfgr
 rhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght
X-ME-Proxy: <xmx:JdqdXurvn6ntv4WtfBqqeY3foNusOZY0GV90b6rY_JMpaTE-bQVtDw>
 <xmx:JdqdXiraX9siVw_PGOLXiISuVsLumnArxd0cApDcOE8h-8IbzQQv-Q>
 <xmx:JdqdXuAISqT6_2HbYP6_IKFcTQq_sgRfw3yOukiwdBWE521GW0Yl2A>
 <xmx:J9qdXgZO3csAuQ2Ra7ZRj7lZ9ArdbC1Y2098by-sBK54uJNRniZUMw>
Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id BE47F3065C33;
 Mon, 20 Apr 2020 13:21:37 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>,
 Bruce Richardson <bruce.richardson@intel.com>, "Ananyev,
 Konstantin" <konstantin.ananyev@intel.com>, "Dumitrescu,
 Cristian" <cristian.dumitrescu@intel.com>
Cc: Igor Russkikh <igor.russkikh@aquantia.com>,
 Pavel Belous <pavel.belous@aquantia.com>, "Lu,
 Wenzhuo" <wenzhuo.lu@intel.com>, Marcin Wojtas <mw@semihalf.com>,
 Michal Krawczyk <mk@semihalf.com>, Guy Tzalik <gtzalik@amazon.com>,
 Evgeny Schemeilin <evgenys@amazon.com>,
 Igor Chauskin <igorch@amazon.com>, John Daley <johndale@cisco.com>,
 Hyong Youb Kim <hyonkim@cisco.com>, "Zhang, Qi Z" <qi.z.zhang@intel.com>,
 "Wang, Xiao W" <xiao.w.wang@intel.com>,
 Ziyang Xuan <xuanziyang2@huawei.com>,
 Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>,
 Guoyang Zhou <zhouguoyang@huawei.com>,
 "Wei Hu (Xavier)" <xavier.huwei@huawei.com>,
 "Min Hu (Connor)" <humin29@huawei.com>,
 Yisen Zhuang <yisen.zhuang@huawei.com>, "Xing,
 Beilei" <beilei.xing@intel.com>, "Wu, Jingjing" <jingjing.wu@intel.com>,
 "Yang, Qiming" <qiming.yang@intel.com>, Rasesh Mody <rmody@marvell.com>,
 Shahed Shaikh <shshaikh@marvell.com>, "Singh,
 Jasvinder" <jasvinder.singh@intel.com>,
 Maxime Coquelin <maxime.coquelin@redhat.com>, "Wang,
 Zhihong" <zhihong.wang@intel.com>, "Ye,
 Xiaolong" <xiaolong.ye@intel.com>, Yong Wang <yongwang@vmware.com>,
 "Yigit, Ferruh" <ferruh.yigit@intel.com>,
 Andrew Rybchenko <arybchenko@solarflare.com>,
 Olivier Matz <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>
Date: Mon, 20 Apr 2020 19:21:32 +0200
Message-ID: <7682483.vcMjziH8VY@thomas>
In-Reply-To: <20200420171130.GA1719@bricha3-MOBL.ger.corp.intel.com>
References: <20200417215739.23180-1-l.wojciechow@partner.samsung.com>
 <a6627818-c471-221f-ebe2-bd92d4d434f5@partner.samsung.com>
 <20200420171130.GA1719@bricha3-MOBL.ger.corp.intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Subject: Re: [dpdk-dev] [PATCH v1 03/17] ethdev: replace library debug flag
	with global one
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

20/04/2020 19:11, Bruce Richardson:
> On Mon, Apr 20, 2020 at 04:43:21PM +0200, Lukasz Wojciechowski wrote:
> > 
> > W dniu 20.04.2020 o 16:21, Bruce Richardson pisze:
> > > On Mon, Apr 20, 2020 at 01:37:12PM +0000, Ananyev, Konstantin wrote:
> > >>>
> <snip>
> > >> I am agree with Cristian concern here: that patch removes ability to
> > >> enable/disable debug on particular library/PMD.  If the purpose is to
> > >> minimize number of config compile options, I wonder can't it be done
> > >> in a slightly different way: 1. introduce gloabal RTE_DEBUG 2. keep
> > >> actual .[c,h] files intact 3. In actual librte_xxx/meson.build  file
> > >> check if RTE_DEBUG is enabled, If yes, then enable particular debug
> > >> flag for these libs.  Something like: If dpdk_conf.get('RTE_DEBUG') ==
> > >> true dpdk_conf.set('RTE_LIBRTE_XXX_DEBUG ', 1)
> > >>
> > >> defines that are used by multiple libs, probably can be set in upper
> > >> layer meson.build.
> > >>
> > >> That way will have global 'debug' flag, but users will still have an
> > >> ability to enable/disable debug flags on a per lib basis via
> > >> CFLAGS="-D..."
> > >>
> > >> Konstantin
> > >>
> > > That seems a reasonable idea to me.
> > >
> > > However, in this case, we don't need the RTE_DEBUG flag at all, we can
> > > either:
> > >
> > > * allow each component meson.build file define its own flags after
> > > checking get_option('debug') * have lib/meson.build and
> > > drivers/meson.build automatically define a specific define for each
> > > library or driver to standardize the naming.  [This would save anyone
> > > working on it from having to lookup what the define was, since it's
> > > always e.g. RTE_DEBUG_ + library-base-name, e.g.  RTE_DEBUG_LPM,
> > > RTE_DEBUG_SCHED etc]
> > >
> > > Theoretically we can also do both, have the standard ones defined and
> > > then allow a component to provide extra flags itself if so desired.
> > >
> > > /Bruce
> > OK, so let's summarize how the patches should be redo: * usage of global
> > "debug" flag for meson build stays * we standardize names of debug flags
> > in the components to RTE_DEBUG_ + components name * debug flag enables al
> > the RTE_DEBUG_... flags
> > 
> > This allow to easily use both: * the debug flag - to enable all debugs *
> > or define manually RTE_DEBUG+component name, just for debug from a single
> > component
> > 
> > I like Bruce's idea of adding it to the lib/meson.build and
> > drivers/meson.build. This way they will be added to dpdk_conf meson
> > object and written then later to rte_build_config.h before compilation
> > stage.  All the other modules will be able to use these flags.
> >
> Sounds good to me (obviously!), but I'd like other feedback to ensure
> others are ok with this before you spend too much effort implementing it.
> 
> For the drivers, the flag probably needs to include the category as well as
> the name, e.g. RTE_DEBUG_NET_IXGBE, RTE_DEBUG_RAW_IOAT, to avoid possible
> name confusion. Those flags can then be checked inside individual
> meson.build files to enable other debug flags if necessary e.g. in ixgbe,
> you could theoretically do:
> 
> if dpdk_conf.has('RTE_DEBUG_NET_IXGBE')
> 	cflags += '-DRTE_LIBRTE_IXGBE_DEBUG_RX'
> 	cflags += '-DRTE_LIBRTE_IXGBE_DEBUG_TX'
> 	...
> endif
> 
> to enable more fine-grained control if so desired, and to maintain
> compatibility with existing defines, again if so desired.

Nak the nak from Cristian.

We don't need all these flags.
If the user choose to compile DPDK for debug, every debug facilities
should be enabled. Then at runtime it is possible to enable/disable
the interesting logs.
If you need to disable something which is not a log,
you can align with the log level thanks to the function rte_log_can_log.

Please let's stop complicating things for the contributors and the users.
Note: I am strong on this position.