From: Thomas Monjalon <thomas@monjalon.net>
To: Bruce Richardson <bruce.richardson@intel.com>,
Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Cc: Anoob Joseph <anoobj@marvell.com>,
Akhil Goyal <akhil.goyal@nxp.com>,
Declan Doherty <declan.doherty@intel.com>,
Aviad Yehezkel <aviadye@mellanox.com>,
Boris Pismenny <borisp@mellanox.com>,
Radu Nicolau <radu.nicolau@intel.com>,
Anoob Joseph <anoob.joseph@caviumnetworks.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH v2 01/13] security: fix verification of parameters
Date: Thu, 09 Apr 2020 17:22:21 +0200 [thread overview]
Message-ID: <2535618.Isy0gbHreE@thomas> (raw)
In-Reply-To: <91240a63-76d0-508e-3071-b1e871c74294@partner.samsung.com>
09/04/2020 16:21, Lukasz Wojciechowski:
> W dniu 09.04.2020 o 16:07, Lukasz Wojciechowski pisze:
> > W dniu 09.04.2020 o 13:13, Bruce Richardson pisze:
> >> On Thu, Apr 09, 2020 at 12:54:10PM +0200, Thomas Monjalon wrote:
> >>> 09/04/2020 12:14, Bruce Richardson:
> >>>> On Wed, Apr 08, 2020 at 07:51:35PM +0200, Thomas Monjalon wrote:
> >>>>> 08/04/2020 17:49, Lukasz Wojciechowski:
> >>>>>> Hi guys,
> >>>>>>
> >>>>>> I don't know what is the current status of "legacy" build using
> >>>>>> gnumakes, so I added the new DEBUG flag to config just as it was
> >>>>>> done in
> >>>>>> other libs like eventdev.
> >>>>>> Many guides still point config files as the one that should be
> >>>>>> changed
> >>>>>> in order to enable some features, so I thought I should add it
> >>>>>> there.
> >>>>>>
> >>>>>> If I understand well the official build system now is the one
> >>>>>> based on
> >>>>>> using meson and ninja, however it hasn't got anything similar to the
> >>>>>> gnamakefiles system, e.g.
> >>>>>> in the meson.build file for libraries all the libraries have build
> >>>>>> variable set to true and there are few ifs that check it, but as
> >>>>>> it's
> >>>>>> set to true all libraries build always.
> >>>>>> And each library considered there defines RTE_LIBRTE_[LIBRARY_NAME].
> >>>>>> It's kind of weird.
> >>>>>>
> >>>>>> foreach l:libraries
> >>>>>> * build = true**
> >>>>>> * reason = '<unknown reason>' # set if build == false to
> >>>>>> explain why
> >>>>>> ...
> >>>>>> * if not build*
> >>>>>> dpdk_libs_disabled += name
> >>>>>> set_variable(name.underscorify() +
> >>>>>> '_disable_reason', reason)
> >>>>>> else
> >>>>>> enabled_libs += name
> >>>>>> *dpdk_conf.set('RTE_LIBRTE_' + name.to_upper(), 1)*
> >>>>>> ...
> >>>>>>
> >>>>>> Have you think about reusing config files in meson configuration and
> >>>>>> have a single point of configuration? Of course all meson flags can
> >>>>>> overwrite the default config.
> >>>>> This is on purpose.
> >>>>> We are removing most of compile-time options with meson.
> >>>>>
> >>>>> I think we can use a global option for debug-specific code.
> >>>>> Bruce, what do you recommend?
> >>>>>
> >>>> Meson has a built-in global debug setting which could be used.
> >>>> However,
> >>>> that may be too course-grained. If that is the case there are a
> >>>> couple of
> >>>> options:
> >>>>
> >>>> 1 Each library can have it's own debug flag defined, which is set on
> >>>> the commandline in CFLAGS. Can be done right now - just reuse
> >>>> any of the
> >>>> debug variables in the existing make config files (stripping off
> >>>> the
> >>>> CONFIG_), e.g. CFLAGS=-DRTE_MALLOC_DEBUG
> >>>> 2 Since that is perhaps not the most usable - though easiest to
> >>>> implement -
> >>>> we can look to add a general debug option (or couple of options) in
> >>>> meson, e.g. debug_libs=, debug_drivers=, where each option takes
> >>>> a list of
> >>>> libs or drivers to pass the debug flags to. This will require a
> >>>> little
> >>>> work in the meson build infrastructure, but is not that hard.
> >>>> The harder
> >>>> part is standardizing the debug flags across all components.
> >>>>
> >>>> The advantage of #1 is that it works today and just needs some
> >>>> documentation for each lib/driver what it's debug flags are. The
> >>>> advantage
> >>>> of #2 is more usability, but it requires a lot more work to
> >>>> standardize
> >>>> IMHO.
> >>> In this case, we need a general option as the one already provided
> >>> by meson.
> >>> It means: "I am not in production, I want to see anything behaving
> >>> wrong
> >>> in the datapath."
> >>> "Anything" means we don't need a per-library switch.
> >>> And for the other needs (out of fast path), we have a new function:
> >>> rte_log_can_log(mylogtype, RTE_LOG_DEBUG)
> >>>
> >> To use the general option in meson something like below is probably all
> >> that is needed to flag the debug build to all components:
> >>
> >> diff --git a/config/meson.build b/config/meson.build
> >> index 49482091d..b01cd1251 100644
> >> --- a/config/meson.build
> >> +++ b/config/meson.build
> >> @@ -176,6 +176,10 @@ endif
> >> # add -include rte_config to cflags
> >> add_project_arguments('-include', 'rte_config.h', language: 'c')
> >>
> >> +if get_option('debug')
> >> + add_project_arguments('-DDEBUG', language: 'c')
> >> +endif
> >> +
> >
> > This will conflict with DEBUG define for log level.
> Just to be more precise, the log level is defined as RTE_LOG_DEBUG, but
> in few places you can find something like:
> #define NTB_LOG(level, fmt, args...) \
> rte_log(RTE_LOG_ ## level, ntb_logtype, "%s(): " fmt "\n", \
>
> __func__, ##args)
>
> and usage like this:
> NTB_LOG(DEBUG, "Link is not up.");
This is not a conflict.
The compiler sees only RTE_LOG_DEBUG.
Anyway the right name for the general flag should be RTE_DEBUG.
> > How about adding similar define in library meson.build file? , e.g
> >
> > diff --git a/lib/librte_security/meson.build
> > b/lib/librte_security/meson.build
> > index 5679c8b5c..ee92483c5 100644
> > --- a/lib/librte_security/meson.build
> > +++ b/lib/librte_security/meson.build
> > @@ -4,3 +4,7 @@
> > sources = files('rte_security.c')
> > headers = files('rte_security.h', 'rte_security_driver.h')
> > deps += ['mempool', 'cryptodev']
> > +
> > +if get_option('debug')
> > + add_project_arguments('-DRTE_LIBRTE_SECURITY_DEBUG', language: 'c')
> > +endif
It can work yes.
But it would be simpler to align on single debug flag.
next prev parent reply other threads:[~2020-04-09 15:22 UTC|newest]
Thread overview: 80+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20200312151708eucas1p2a80bb2ac0556c7d7efb3aedd83923e52@eucas1p2.samsung.com>
2020-03-12 15:16 ` [dpdk-dev] [PATCH 00/13] Fixes and unit tests for librte_security Lukasz Wojciechowski
2020-03-12 15:16 ` [dpdk-dev] [PATCH 01/13] librte_security: fix verification of parameters Lukasz Wojciechowski
2020-03-17 12:59 ` Anoob Joseph
2020-04-03 18:36 ` Lukasz Wojciechowski
2020-04-05 12:54 ` [dpdk-dev] [EXT] " Anoob Joseph
2020-04-06 18:49 ` Lukasz Wojciechowski
2020-04-07 6:20 ` Anoob Joseph
2020-04-08 3:25 ` Lukasz Wojciechowski
2020-03-12 15:16 ` [dpdk-dev] [PATCH 02/13] librte_security: fix return types in documentation Lukasz Wojciechowski
2020-03-17 16:34 ` Anoob Joseph
2020-03-12 15:16 ` [dpdk-dev] [PATCH 03/13] librte_security: fix session counter Lukasz Wojciechowski
2020-03-17 17:08 ` Anoob Joseph
2020-03-12 15:16 ` [dpdk-dev] [PATCH 04/13] app/test: fix macro definition Lukasz Wojciechowski
2020-03-12 15:16 ` [dpdk-dev] [PATCH 05/13] app/test: introduce librte_security tests Lukasz Wojciechowski
2020-04-01 17:09 ` Akhil Goyal
2020-04-01 17:51 ` Thomas Monjalon
2020-04-02 19:49 ` Lukasz Wojciechowski
2020-04-02 20:51 ` Thomas Monjalon
2020-04-03 19:24 ` Lukasz Wojciechowski
2020-03-12 15:16 ` [dpdk-dev] [PATCH 06/13] app/test: add rte_security_session_update tests Lukasz Wojciechowski
2020-03-12 15:16 ` [dpdk-dev] [PATCH 07/13] app/test: add rte_security_session_get_size tests Lukasz Wojciechowski
2020-03-12 15:16 ` [dpdk-dev] [PATCH 08/13] app/test: add rte_security_session_stats_get tests Lukasz Wojciechowski
2020-03-12 15:16 ` [dpdk-dev] [PATCH 09/13] app/test: add rte_security_session_destroy tests Lukasz Wojciechowski
2020-03-12 15:16 ` [dpdk-dev] [PATCH 10/13] app/test: add rte_security_set_pkt_metadata tests Lukasz Wojciechowski
2020-03-12 15:16 ` [dpdk-dev] [PATCH 11/13] app/test: add rte_security_get_userdata tests Lukasz Wojciechowski
2020-03-12 15:16 ` [dpdk-dev] [PATCH 12/13] app/test: add rte_security_capabilities_get tests Lukasz Wojciechowski
2020-03-12 15:16 ` [dpdk-dev] [PATCH 13/13] app/test: add rte_security_capability_get tests Lukasz Wojciechowski
2020-04-08 3:13 ` [dpdk-dev] [PATCH v2 00/13] Fixes and unit tests for librte_security Lukasz Wojciechowski
2020-04-08 3:13 ` [dpdk-dev] [PATCH v2 01/13] security: fix verification of parameters Lukasz Wojciechowski
2020-04-08 12:54 ` Thomas Monjalon
2020-04-08 13:02 ` Anoob Joseph
2020-04-08 13:26 ` Thomas Monjalon
2020-04-08 14:44 ` [dpdk-dev] [EXT] " Anoob Joseph
2020-04-08 15:49 ` Lukasz Wojciechowski
2020-04-08 17:51 ` Thomas Monjalon
2020-04-09 10:14 ` Bruce Richardson
2020-04-09 10:54 ` Thomas Monjalon
2020-04-09 11:13 ` Bruce Richardson
2020-04-09 14:07 ` Lukasz Wojciechowski
2020-04-09 14:21 ` Lukasz Wojciechowski
2020-04-09 15:22 ` Thomas Monjalon [this message]
2020-04-09 16:10 ` Lukasz Wojciechowski
2020-04-10 8:45 ` Bruce Richardson
2020-04-08 3:13 ` [dpdk-dev] [PATCH v2 02/13] security: fix return types in documentation Lukasz Wojciechowski
2020-04-08 3:13 ` [dpdk-dev] [PATCH v2 03/13] security: fix session counter Lukasz Wojciechowski
2020-04-08 3:13 ` [dpdk-dev] [PATCH v2 04/13] app/test: fix macro definition Lukasz Wojciechowski
2020-04-08 12:53 ` Thomas Monjalon
2020-04-08 16:15 ` Lukasz Wojciechowski
2020-04-08 17:47 ` Thomas Monjalon
2020-04-09 14:10 ` Lukasz Wojciechowski
2020-04-08 3:13 ` [dpdk-dev] [PATCH v2 05/13] app/test: introduce librte security tests Lukasz Wojciechowski
2020-04-08 3:13 ` [dpdk-dev] [PATCH v2 06/13] app/test: add rte security session update tests Lukasz Wojciechowski
2020-04-08 3:13 ` [dpdk-dev] [PATCH v2 07/13] app/test: add rte security session get size tests Lukasz Wojciechowski
2020-04-08 3:13 ` [dpdk-dev] [PATCH v2 08/13] app/test: add rte security session stats get tests Lukasz Wojciechowski
2020-04-08 3:13 ` [dpdk-dev] [PATCH v2 09/13] app/test: add rte security session destroy tests Lukasz Wojciechowski
2020-04-08 3:13 ` [dpdk-dev] [PATCH v2 10/13] app/test: add rte security set pkt metadata tests Lukasz Wojciechowski
2020-04-08 3:13 ` [dpdk-dev] [PATCH v2 11/13] app/test: add rte security get userdata tests Lukasz Wojciechowski
2020-04-08 3:13 ` [dpdk-dev] [PATCH v2 12/13] app/test: add rte security capabilities get tests Lukasz Wojciechowski
2020-04-08 3:13 ` [dpdk-dev] [PATCH v2 13/13] app/test: add rte security capability " Lukasz Wojciechowski
2020-04-09 17:24 ` [dpdk-dev] [PATCH v3 00/13] Fixes and unit tests for librte_security Lukasz Wojciechowski
2020-04-09 17:24 ` [dpdk-dev] [PATCH v3 01/13] security: fix verification of parameters Lukasz Wojciechowski
2020-04-13 15:42 ` Anoob Joseph
2020-04-09 17:24 ` [dpdk-dev] [PATCH v3 02/13] security: fix return types in documentation Lukasz Wojciechowski
2020-04-13 15:43 ` Anoob Joseph
2020-04-09 17:24 ` [dpdk-dev] [PATCH v3 03/13] security: fix session counter Lukasz Wojciechowski
2020-04-13 15:48 ` Anoob Joseph
2020-04-09 17:24 ` [dpdk-dev] [PATCH v3 04/13] app/test: remove macro definition Lukasz Wojciechowski
2020-04-09 17:24 ` [dpdk-dev] [PATCH v3 05/13] app/test: introduce librte security tests Lukasz Wojciechowski
2020-04-09 17:24 ` [dpdk-dev] [PATCH v3 06/13] app/test: add rte security session update tests Lukasz Wojciechowski
2020-04-09 17:24 ` [dpdk-dev] [PATCH v3 07/13] app/test: add rte security session get size tests Lukasz Wojciechowski
2020-04-09 17:24 ` [dpdk-dev] [PATCH v3 08/13] app/test: add rte security session stats get tests Lukasz Wojciechowski
2020-04-09 17:24 ` [dpdk-dev] [PATCH v3 09/13] app/test: add rte security session destroy tests Lukasz Wojciechowski
2020-04-09 17:24 ` [dpdk-dev] [PATCH v3 10/13] app/test: add rte security set pkt metadata tests Lukasz Wojciechowski
2020-04-09 17:25 ` [dpdk-dev] [PATCH v3 11/13] app/test: add rte security get userdata tests Lukasz Wojciechowski
2020-04-09 17:25 ` [dpdk-dev] [PATCH v3 12/13] app/test: add rte security capabilities get tests Lukasz Wojciechowski
2020-04-09 17:25 ` [dpdk-dev] [PATCH v3 13/13] app/test: add rte security capability " Lukasz Wojciechowski
2020-04-17 19:46 ` [dpdk-dev] [PATCH v3 00/13] Fixes and unit tests for librte_security Akhil Goyal
2020-04-17 20:14 ` Lukasz Wojciechowski
2020-04-17 20:21 ` Akhil Goyal
2020-04-17 20:39 ` Lukasz Wojciechowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2535618.Isy0gbHreE@thomas \
--to=thomas@monjalon.net \
--cc=akhil.goyal@nxp.com \
--cc=anoob.joseph@caviumnetworks.com \
--cc=anoobj@marvell.com \
--cc=aviadye@mellanox.com \
--cc=borisp@mellanox.com \
--cc=bruce.richardson@intel.com \
--cc=declan.doherty@intel.com \
--cc=dev@dpdk.org \
--cc=l.wojciechow@partner.samsung.com \
--cc=radu.nicolau@intel.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.