DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: Andrew Rybchenko <arybchenko@solarflare.com>
Cc: David Marchand <david.marchand@redhat.com>,
	 Jerin Jacob Kollanukkaran <jerinj@marvell.com>,
	dev <dev@dpdk.org>, Thomas Monjalon <thomas@monjalon.net>,
	 Olivier Matz <olivier.matz@6wind.com>
Subject: Re: [dpdk-dev] [PATCH 01/13] eal/log: introduce log register macro
Date: Fri, 26 Jun 2020 16:46:00 +0530	[thread overview]
Message-ID: <CALBAE1NRGxbHXFUh-oxSQd742HXy1BYJa7kpg=dhA7eJeHpZzA@mail.gmail.com> (raw)
In-Reply-To: <CALBAE1PrWLd544ee82xpsCjV9Luur7_h=8sCvhBAfky3Q3R=pw@mail.gmail.com>

On Wed, Jun 24, 2020 at 11:40 PM Jerin Jacob <jerinjacobk@gmail.com> wrote:
>
> On Wed, Jun 24, 2020 at 9:13 PM Andrew Rybchenko
> <arybchenko@solarflare.com> wrote:
> >
> > On 6/24/20 6:32 PM, Jerin Jacob wrote:
> > > On Wed, Jun 24, 2020 at 8:56 PM Andrew Rybchenko
> > > <arybchenko@solarflare.com> wrote:
> > >>
> > >> On 6/24/20 4:11 PM, Jerin Jacob wrote:
> > >>> On Wed, Jun 17, 2020 at 3:51 PM Andrew Rybchenko
> > >>> <arybchenko@solarflare.com> wrote:
> > >>>>
> > >>>> On 6/17/20 1:02 PM, David Marchand wrote:
> > >>>>> On Wed, Jun 17, 2020 at 8:30 AM <jerinj@marvell.com> wrote:
> > >>>>>>
> > >>>>>> From: Jerin Jacob <jerinj@marvell.com>
> > >>>>>>
> > >>>>>> Introducing the RTE_LOG_REGISTER macro to avoid the code duplication
> > >>>>>> in the log registration process.
> > >>>>>>
> > >>>>>> It is a wrapper macro for declaring the logtype, register the log and sets
> > >>>>>
> > >>>>> Having the logtype variable declared as part of the macro will force
> > >>>>> us to have global symbols (for the cases where it is needed).
> > >>>>> I'd rather leave the declaration to the caller, and only handle the
> > >>>>> registering part in this macro.
> > >>>>
> > >>>> I agree with David that it is important to avoid global symbols
> > >>>> when it is not needed.
> > >>>
> > >>> David, Andrew,
> > >>>
> > >>> Since it is executed in "constructor" context, it will be always from
> > >>> the global variable. Right?
> > >>> i.e DPDK is not yet initialized in when "constructor" being called.
> > >>> In addition to that, It will be adding more lines of code in the
> > >>> consumer of this MACRO.
> > >>> Thoughts?
> > >>
> > >> The problem is rather 'extern' vs 'static'. Before the patch
> > >> many variables are static, but become externally visible after
> > >> the patch.
> > >
> > > OK. How about RTE_LOG_REGISTER_EXTERN or RTE_LOG_REGISTER_STATIC then?
> > > It will allow less code in the consumer of this macro.
> > > May be default we an make it as static so RTE_LOG_REGISTER and
> > > RTE_LOG_REGISTER_EXTERN
> > > for the different needs.
> > >
> > > Thoughts?
> >
> > Yes, I think it is a possible solution to use static in
> > RTE_LOG_REGISTER and use RTE_LOG_REGISTER_EXTERN
> > for non-static version. If we go this way, I'd prefer
> > the option.
>
> OK.
>
> >
> > Alternative is to keep variable declaration outside,
> > as David suggested, and I tend to agree that it is a
> > bit better. Macro name says 'register'. It is not
> > 'declare and register'. Also it avoids static-vs-extern
> > problem completely. The solution allows to keep the
> > variable declaration untouched and put constructor (macro)
> > at the end of fine where constructors typically reside.
>
> My only concern with that approach is that, We can not save a lot of
> code duplication
> with that scheme. ie. it is [1] vs [2]. We can change the MACRO name
> accordingly if that is a concern. Any suggestions?
>
> Let me know your preference on [1] vs [2], I will stick with for the
> next version.

If there are no other comments, I change RTE_LOG_REGISTER to static version
and RTE_LOG_REGISTER_EXTERN for a non-static version and send the next version.



>
> [1]
>
> RTE_LOG_REGISTER(otx2_logtype_base, pmd.octeontx2.base, NOTICE);
> RTE_LOG_REGISTER(otx2_logtype_mbox, pmd.octeontx2.mbox, NOTICE);
> RTE_LOG_REGISTER(otx2_logtype_npa, pmd.mempool.octeontx2, NOTICE);
> RTE_LOG_REGISTER(otx2_logtype_nix, pmd.net.octeontx2, NOTICE);
> RTE_LOG_REGISTER(otx2_logtype_npc, pmd.net.octeontx2.flow, NOTICE);
> RTE_LOG_REGISTER(otx2_logtype_tm, pmd.net.octeontx2.tm, NOTICE);
> RTE_LOG_REGISTER(otx2_logtype_sso, pmd.event.octeontx2, NOTICE);
> RTE_LOG_REGISTER(otx2_logtype_tim, pmd.event.octeontx2.timer, NOTICE);
> RTE_LOG_REGISTER(otx2_logtype_dpi, pmd.raw.octeontx2.dpi, NOTICE);
> RTE_LOG_REGISTER(otx2_logtype_ep, pmd.raw.octeontx2.ep, NOTICE)
>
> [2]
>
>
> int otx2_logtype_base;
> int otx2_logtype_mbox;
> int otx2_logtype_npa;
> int otx2_logtype_nix;
> int otx2_logtype_npc;
> int otx2_logtype_tm;
> int otx2_logtype_sso;
> int otx2_logtype_tim;
> int otx2_logtype_dpi;
> int otx2_logtype_ep;
>
> RTE_LOG_REGISTER(otx2_logtype_base, pmd.octeontx2.base, NOTICE);
> RTE_LOG_REGISTER(otx2_logtype_mbox, pmd.octeontx2.mbox, NOTICE);
> RTE_LOG_REGISTER(otx2_logtype_npa, pmd.mempool.octeontx2, NOTICE);
> RTE_LOG_REGISTER(otx2_logtype_nix, pmd.net.octeontx2, NOTICE);
> RTE_LOG_REGISTER(otx2_logtype_npc, pmd.net.octeontx2.flow, NOTICE);
> RTE_LOG_REGISTER(otx2_logtype_tm, pmd.net.octeontx2.tm, NOTICE);
> RTE_LOG_REGISTER(otx2_logtype_sso, pmd.event.octeontx2, NOTICE);
> RTE_LOG_REGISTER(otx2_logtype_tim, pmd.event.octeontx2.timer, NOTICE);
> RTE_LOG_REGISTER(otx2_logtype_dpi, pmd.raw.octeontx2.dpi, NOTICE);
> RTE_LOG_REGISTER(otx2_logtype_ep, pmd.raw.octeontx2.ep, NOTICE)

  reply	other threads:[~2020-06-26 11:16 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17  6:30 [dpdk-dev] [PATCH 00/13] rte_log registration usage improvement jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 01/13] eal/log: introduce log register macro jerinj
2020-06-17 10:00   ` Thomas Monjalon
2020-06-17 10:26     ` Andrew Rybchenko
2020-06-24 13:08       ` Jerin Jacob
2020-06-17 10:02   ` David Marchand
2020-06-17 10:21     ` Andrew Rybchenko
2020-06-24 13:11       ` Jerin Jacob
2020-06-24 15:26         ` Andrew Rybchenko
2020-06-24 15:32           ` Jerin Jacob
2020-06-24 15:43             ` Andrew Rybchenko
2020-06-24 18:10               ` Jerin Jacob
2020-06-26 11:16                 ` Jerin Jacob [this message]
2020-06-26 11:42                   ` David Marchand
2020-06-26 12:06                     ` Jerin Jacob
2020-06-26 12:13                       ` David Marchand
2020-06-26 12:16                       ` David Marchand
2020-06-26 12:37                         ` Jerin Jacob
2020-06-29 13:39                           ` Jerin Jacob
2020-06-30 13:39                           ` David Marchand
2020-06-30 14:42                             ` Jerin Jacob
2020-06-21  9:30   ` Sachin Saxena (OSS)
2020-06-17  6:30 ` [dpdk-dev] [PATCH 02/13] lib: use " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 03/13] drivers/vdpa: " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 04/13] drivers/raw: " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 05/13] drivers/net: " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 06/13] drivers/mempool: " jerinj
2020-06-21  9:46   ` Sachin Saxena (OSS)
2020-06-17  6:30 ` [dpdk-dev] [PATCH 07/13] drivers/event: " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 08/13] drivers/crypto: " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 09/13] drivers/compress: " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 10/13] drivers/common: " jerinj
2020-06-21  9:48   ` Sachin Saxena (OSS)
2020-06-17  6:30 ` [dpdk-dev] [PATCH 11/13] drivers/bus: " jerinj
2020-06-21  9:52   ` Sachin Saxena (OSS)
2020-06-17  6:30 ` [dpdk-dev] [PATCH 12/13] drivers/baseband: " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 13/13] app/test: " jerinj
2020-06-25 16:18 ` [dpdk-dev] [PATCH 00/13] rte_log registration usage improvement Dybkowski, AdamX
2020-06-25 16:20   ` Dybkowski, AdamX
2020-07-01  3:58 ` [dpdk-dev] [PATCH v2 " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 01/13] eal/log: introduce log register macro jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 02/13] lib: use " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 03/13] drivers/vdpa: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 04/13] drivers/raw: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 05/13] drivers/net: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 06/13] drivers/mempool: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 07/13] drivers/event: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 08/13] drivers/crypto: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 09/13] drivers/compress: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 10/13] drivers/common: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 11/13] drivers/bus: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 12/13] drivers/baseband: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 13/13] app/test: " jerinj
2020-07-01  6:48   ` [dpdk-dev] [PATCH v3 00/13] rte_log registration usage improvement jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 01/13] eal/log: introduce log register macro jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 02/13] lib: use " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 03/13] drivers/vdpa: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 04/13] drivers/raw: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 05/13] drivers/net: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 06/13] drivers/mempool: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 07/13] drivers/event: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 08/13] drivers/crypto: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 09/13] drivers/compress: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 10/13] drivers/common: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 11/13] drivers/bus: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 12/13] drivers/baseband: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 13/13] app/test: " jerinj
2020-07-01 10:44     ` [dpdk-dev] [PATCH v4 00/13] rte_log registration usage improvement jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 01/13] eal/log: introduce log register macro jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 02/13] lib: use " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 03/13] drivers/vdpa: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 04/13] drivers/raw: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 05/13] drivers/net: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 06/13] drivers/mempool: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 07/13] drivers/event: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 08/13] drivers/crypto: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 09/13] drivers/compress: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 10/13] drivers/common: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 11/13] drivers/bus: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 12/13] drivers/baseband: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 13/13] app/test: " jerinj
2020-07-01 12:33       ` [dpdk-dev] [PATCH v5 00/13] rte_log registration usage improvement jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 01/13] eal/log: introduce log register macro jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 02/13] lib: use " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 03/13] drivers/vdpa: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 04/13] drivers/raw: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 05/13] drivers/net: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 06/13] drivers/mempool: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 07/13] drivers/event: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 08/13] drivers/crypto: " jerinj
2020-07-02 17:59           ` Akhil Goyal
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 09/13] drivers/compress: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 10/13] drivers/common: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 11/13] drivers/bus: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 12/13] drivers/baseband: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 13/13] app/test: " jerinj
2020-07-03 13:55         ` [dpdk-dev] [PATCH v5 00/13] rte_log registration usage improvement David Marchand
2020-07-06  9:31           ` Jerin Jacob

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='CALBAE1NRGxbHXFUh-oxSQd742HXy1BYJa7kpg=dhA7eJeHpZzA@mail.gmail.com' \
    --to=jerinjacobk@gmail.com \
    --cc=arybchenko@solarflare.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=olivier.matz@6wind.com \
    --cc=thomas@monjalon.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).