DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,
	dev@dpdk.org, Olivier Matz <olivier.matz@6wind.com>
Subject: Re: [dpdk-dev] [PATCH v4 1/7] eal: introduce portable format attribute
Date: Mon, 16 Mar 2020 12:14:51 +0100	[thread overview]
Message-ID: <3711538.2iPT33SAM4@xps> (raw)
In-Reply-To: <20200316110231.GB1953@bricha3-MOBL.ger.corp.intel.com>

16/03/2020 12:02, Bruce Richardson:
> On Mon, Mar 16, 2020 at 10:54:09AM +0000, Bruce Richardson wrote:
> > On Sun, Mar 15, 2020 at 09:36:11AM +0100, Thomas Monjalon wrote:
> > > 14/03/2020 00:38, Dmitry Kozlyuk:
> > > > > I suggest this change (I can send a patch fixing the issue in other .h files):
> > > > >
> > > > > +/*
> > > > > + * RTE_TOOLCHAIN_GCC is true if the target is built with GCC,
> > > > > + * while a host application (like pmdinfogen) may have another compiler.
> > > > > + * RTE_CC_IS_GNU is true if the file is compiled with GCC,
> > > > > + * no matter it is a target or host application.
> > > > > + */
> > > > > +#if defined __GNUC__ && !defined __clang__ && !defined __INTEL_COMPILER
> > > > > +#define RTE_CC_IS_GNU
> > > > > +#endif
> > > > > +
> > > > > +#ifdef RTE_CC_IS_GNU
> > > > > -/** Define GCC_VERSION **/
> > > > > -#ifdef RTE_TOOLCHAIN_GCC
> > > > >  #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + \
> > > > >                 __GNUC_PATCHLEVEL__)
> > > > >  #endif
> > > > > @@ -96,7 +105,7 @@ typedef uint16_t unaligned_uint16_t;
> > > > >   * even if the underlying stdio implementation is ANSI-compliant,
> > > > >   * so this must be overridden.
> > > > >   */
> > > > > -#if defined(RTE_TOOLCHAIN_GCC)
> > > > > +#ifdef RTE_CC_IS_GNU
> > > > >  #define __rte_format_printf(format_index, first_arg) \
> > > > >         __attribute__((format(gnu_printf, format_index, first_arg)))
> > > > >  #else
> > > > 
> > > > The code you propose LGTM itself. If you think it's a better solution than
> > > > the one proposed below, I see no problem going with it.
> > > > 
> > > > What I wonder is whether pmdinfogen should include the problematic code in the
> > > > first place. The errors come from declarations in rte_debug.h, but pmdinfogen
> > > > really can't use them, because definitions are compiled for different
> > > > machine. Pmdinfogen pulls rte_debug.h via rte_pci.h, which is only needed for
> > > > struct rte_pci_id. Shouldn't we instead break this bogus dependency chain by
> > > > moving struct rte_pci_id to a separate header?
> > > 
> > > Splitting headers to avoid EAL dependency looks to be a bad precedent to me.
> > > 
> > 
> > Rather than splitting, we can still fix this by breaking the dependency by
> > just not having rte_debug.h included in rte_pci.h. From what I see, there
> > is no need for that include to be there, and DPDK pretty much compiles fine
> > with it removed - the only other change I had to make was add an extra
> > include into mlx5_common.h to compensate for it not getting pulled in via
> > rte_pci.h.
> > 
> 
> And by adding rte_interrupts.h to drivers/bus/ifpga/rte_bus_ifpga.h we can
> remove the following headers from rte_pci.h also:
> 
> stdio.h
> errno.h
> stdint.h
> rte_interrupts.h
> 
> This means that we go from 9 includes in the file (including rte_debug.h) to
> just 4.

Thank you Bruce

Are you sending the patch or you prefer I do it?



  reply	other threads:[~2020-03-16 11:14 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-18  0:02 [dpdk-dev] [PATCH v3 0/7] MinGW-w64 support Dmitry Kozlyuk
2020-02-18  0:02 ` [dpdk-dev] [PATCH v3 1/7] eal: introduce portable format attribute Dmitry Kozlyuk
2020-02-18  0:02 ` [dpdk-dev] [PATCH v3 2/7] eal/windows: use lowercase filenames for system headers Dmitry Kozlyuk
2020-02-18  0:02 ` [dpdk-dev] [PATCH v3 3/7] eal/windows: support builing with MinGW-w64 Dmitry Kozlyuk
2020-02-18  0:02 ` [dpdk-dev] [PATCH v3 4/7] build: MinGW-w64 support for Meson Dmitry Kozlyuk
2020-02-18 14:26   ` Thomas Monjalon
2020-02-18 14:54     ` Bruce Richardson
2020-02-18  0:02 ` [dpdk-dev] [PATCH v3 5/7] build: add cross-file for MinGW-w64 Dmitry Kozlyuk
2020-02-18  0:02 ` [dpdk-dev] [PATCH v3 6/7] doc: guide for Windows build using MinGW-w64 Dmitry Kozlyuk
2020-02-18 21:27   ` William Tu
2020-02-18  0:02 ` [dpdk-dev] [PATCH v3 7/7] build: fix linker warnings with Clang on Windows Dmitry Kozlyuk
2020-02-18 21:16 ` [dpdk-dev] [PATCH v3 0/7] MinGW-w64 support William Tu
2020-02-27  4:25 ` [dpdk-dev] [PATCH v4 " Dmitry Kozlyuk
2020-02-27  4:25   ` [dpdk-dev] [PATCH v4 1/7] eal: introduce portable format attribute Dmitry Kozlyuk
2020-03-12 22:33     ` Thomas Monjalon
2020-03-13 23:38       ` Dmitry Kozlyuk
2020-03-15  8:36         ` Thomas Monjalon
2020-03-16 10:54           ` Bruce Richardson
2020-03-16 11:02             ` Bruce Richardson
2020-03-16 11:14               ` Thomas Monjalon [this message]
2020-03-16 11:18                 ` Bruce Richardson
2020-03-16 11:35                 ` Bruce Richardson
2020-03-16 14:27         ` Thomas Monjalon
2020-02-27  4:25   ` [dpdk-dev] [PATCH v4 2/7] eal/windows: use lowercase filenames for system headers Dmitry Kozlyuk
2020-02-27  4:25   ` [dpdk-dev] [PATCH v4 3/7] eal/windows: support builing with MinGW-w64 Dmitry Kozlyuk
2020-02-27  4:25   ` [dpdk-dev] [PATCH v4 4/7] build: MinGW-w64 support for Meson Dmitry Kozlyuk
2020-02-27  4:25   ` [dpdk-dev] [PATCH v4 5/7] build: add cross-file for MinGW-w64 Dmitry Kozlyuk
2020-02-27  4:25   ` [dpdk-dev] [PATCH v4 6/7] doc: guide for Windows build using MinGW-w64 Dmitry Kozlyuk
2020-02-27  4:25   ` [dpdk-dev] [PATCH v4 7/7] build: fix linker warnings with Clang on Windows Dmitry Kozlyuk
2020-03-11 17:22   ` [dpdk-dev] [PATCH v4 0/7] MinGW-w64 support William Tu
2020-03-18  0:24     ` Thomas Monjalon
2020-03-11 22:36   ` Kadam, Pallavi

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=3711538.2iPT33SAM4@xps \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=olivier.matz@6wind.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).