DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Cc: Jie <jizh@linux.microsoft.com>,
	dev@dpdk.org, roretzla@linux.microsoft.com
Subject: Re: [dpdk-dev] [PATCH] rte_metrics: unconditionally export rte_metrics_tel_xxx functions
Date: Tue, 23 Feb 2021 10:03:02 +0000	[thread overview]
Message-ID: <20210223100302.GA95@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <20210223012415.142bf2fc@sovereign>

On Tue, Feb 23, 2021 at 01:24:15AM +0300, Dmitry Kozlyuk wrote:
> + Bruce
> 
> On Mon, 22 Feb 2021 13:25:02 -0800, Jie wrote:
> [...]
> > diff --git a/config/meson.build b/config/meson.build
> > index 3cf560b8a..892bd9677 100644
> > --- a/config/meson.build
> > +++ b/config/meson.build
> > @@ -292,6 +292,11 @@ if is_freebsd
> >  	add_project_arguments('-D__BSD_VISIBLE', language: 'c')
> >  endif
> >  
> > +jansson = dependency('jansson', required: false, method: 'pkg-config')
> > +if jansson.found()
> > +	dpdk_conf.set('RTE_HAVE_JANSSON', 1)
> > +endif
> 
> DPDK seems to prefer "HAS" for such macros.
> 
> Why not do this in lib/librte_telemetry/meson.build?
> 
> [...]
> > --- a/lib/librte_metrics/meson.build
> > +++ b/lib/librte_metrics/meson.build
> > @@ -4,11 +4,12 @@
> >  sources = files('rte_metrics.c')
> >  headers = files('rte_metrics.h')
> >  
> > -jansson = dependency('jansson', required: false, method: 'pkg-config')
> > -if jansson.found()
> > +if dpdk_conf.has('RTE_HAVE_JANSSON')
> >  	ext_deps += jansson
> > -	sources += files('rte_metrics_telemetry.c')
> > -	headers += files('rte_metrics_telemetry.h')
> > -	deps += ['ethdev', 'telemetry']
> > -	includes += include_directories('../librte_telemetry')
> >  endif
> > +
> > +sources += files('rte_metrics_telemetry.c')
> > +headers += files('rte_metrics_telemetry.h')
> 
> Can be merged with definitions above.
> 
> [...]
> >  int32_t
> >  rte_metrics_tel_reg_all_ethdev(int *metrics_register_done, int *reg_index_list)
> >  {
> > +#ifdef JANSSON
> 
> Why not use RTE_HAS_JANSSON everywhere? (One more occurrence below.)
> 

+1 for this suggestion.

Also, since this is essentially stubbing out the functions in this file,
can you reduce the amount of ifdefs by putting either at the start or the
end the full set of stubs, leaving just the one ifdef block covering the
whole file.

/Bruce

  reply	other threads:[~2021-02-23 10:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-22 21:25 Jie
2021-02-22 22:24 ` Dmitry Kozlyuk
2021-02-23 10:03   ` Bruce Richardson [this message]
2021-02-23 23:01 ` [dpdk-dev] [PATCH v2] rte_metrics: unconditionally exports " Jie Zhou
2021-02-24 10:36   ` Bruce Richardson
2021-02-24 18:46   ` [dpdk-dev] [PATCH v3] " Jie Zhou
2021-03-06 20:18     ` Dmitry Kozlyuk
2021-03-08 18:05     ` [dpdk-dev] [PATCH v4] " Jie Zhou
2021-03-16  9:07       ` Thomas Monjalon

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=20210223100302.GA95@bricha3-MOBL.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=jizh@linux.microsoft.com \
    --cc=roretzla@linux.microsoft.com \
    /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).