DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: "Mattias Rönnblom" <hofors@lysator.liu.se>
Cc: dev@dpdk.org, thomas@monjalon.net, bruce.richardson@intel.com,
	ktraynor@redhat.com, "Rosen Xu" <rosen.xu@intel.com>,
	"Mattias Rönnblom" <mattias.ronnblom@ericsson.com>,
	"Morten Brørup" <mb@smartsharesystems.com>
Subject: Re: [PATCH v3 3/4] bus/ifpga: use C linkage where appropriate in driver header
Date: Tue, 22 Oct 2024 21:27:44 +0200	[thread overview]
Message-ID: <CAJFAV8y1oX5P9Aq-LMdYnpjW1zSZCiEzL=9A5oWeRugVGnxRag@mail.gmail.com> (raw)
In-Reply-To: <60606e75-7e3c-437d-99ad-d6a7c0a710a1@lysator.liu.se>

On Mon, Oct 21, 2024 at 8:01 PM Mattias Rönnblom <hofors@lysator.liu.se> wrote:
>
> On 2024-10-21 18:04, David Marchand wrote:
> > This driver was missed when cleaning up most of the headers.
> >
> > Fixes: 719834a6849e ("use C linkage where appropriate in headers")
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > ---
> >   drivers/bus/ifpga/bus_ifpga_driver.h | 8 ++++----
> >   1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/bus/ifpga/bus_ifpga_driver.h b/drivers/bus/ifpga/bus_ifpga_driver.h
> > index 5bbe36d6e0..a42afc7d75 100644
> > --- a/drivers/bus/ifpga/bus_ifpga_driver.h
> > +++ b/drivers/bus/ifpga/bus_ifpga_driver.h
> > @@ -11,16 +11,16 @@
> >    * RTE Intel FPGA Bus Interface
> >    */
> >
> > -#ifdef __cplusplus
> > -extern "C" {
> > -#endif /* __cplusplus */
> > -
> >   #include <rte_compat.h>
> >   #include <dev_driver.h>
> >   #include <rte_pci.h>
> >   #include <rte_interrupts.h>
> >   #include <rte_spinlock.h>
> >
> > +#ifdef __cplusplus
> > +extern "C" {
> > +#endif /* __cplusplus */
> > +
> >   #define IFPGA_BUS_NAME ifpga
> >
> >   /* Forward declarations */
>
> My effort was limited to the headers passed to chkincs, which I'm
> guessing is the public API headers.

There were many headers that got changed in commit 719834a6849e ("use
C linkage where appropriate in headers") while not being in the
exported headers list, which is what chkincs checks.

For example,
$ git show --stat 719834a6849e | grep raw/ifpga
drivers/raw/ifpga/afu_pmd_core.h                 |  8 ++++----
 drivers/raw/ifpga/afu_pmd_he_hssi.h              |  6 +++---
 drivers/raw/ifpga/afu_pmd_he_lpbk.h              |  6 +++---
 drivers/raw/ifpga/afu_pmd_he_mem.h               |  6 +++---
 drivers/raw/ifpga/afu_pmd_n3000.h                |  6 +++---
 drivers/raw/ifpga/rte_pmd_afu.h                  |  4 ++--
 drivers/raw/ifpga/rte_pmd_ifpga.h                |  4 ++--

$ grep chkincs.*afu build/build.ninja

>
> Internal headers shouldn't have any #ifdef __cpluspus at all, anywhere.
>

Internal headers, I agree, though commit 719834a6849e ("use C linkage
where appropriate in headers") did change some.

For drivers headers that are exported, it is another story, some
people seem to like C++ for writing out of tree drivers.
And this is what this patch of mine is about.


-- 
David Marchand


  reply	other threads:[~2024-10-22 19:28 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-15 12:10 [PATCH 0/3] Enhance headers check David Marchand
2024-10-15 12:10 ` [PATCH 1/3] bitops: fix build for GCC without experimental API David Marchand
2024-10-15 12:47   ` Morten Brørup
2024-10-15 12:10 ` [PATCH 2/3] bitset: " David Marchand
2024-10-15 12:53   ` Morten Brørup
2024-10-15 14:13     ` Thomas Monjalon
2024-10-15 14:44       ` Morten Brørup
2024-10-15 19:58         ` Thomas Monjalon
2024-10-15 20:30           ` Morten Brørup
2024-10-15 12:10 ` [PATCH 3/3] buildtools/chkincs: check headers with stable API only David Marchand
2024-10-16 11:38 ` [PATCH v2 0/4] Enhance headers check David Marchand
2024-10-16 11:38   ` [PATCH v2 1/4] bitops: fix build for GCC without experimental API David Marchand
2024-10-16 11:38   ` [PATCH v2 2/4] bitset: " David Marchand
2024-10-16 14:14     ` Mattias Rönnblom
2024-10-16 15:36       ` David Marchand
2024-10-16 15:42         ` Morten Brørup
2024-10-16 16:03           ` Mattias Rönnblom
2024-10-16 16:17             ` Thomas Monjalon
2024-10-16 15:51         ` Mattias Rönnblom
2024-10-16 11:38   ` [PATCH v2 3/4] vhost: remove internal vDPA API description from public header David Marchand
2024-10-16 11:47     ` Maxime Coquelin
2024-10-16 11:38   ` [PATCH v2 4/4] buildtools/chkincs: check headers with stable API only David Marchand
2024-10-16 20:40   ` [PATCH v2 0/4] Enhance headers check David Marchand
2024-10-21 16:04 ` [PATCH v3 " David Marchand
2024-10-21 16:04   ` [PATCH v3 1/4] bitset: fix build for GCC without experimental API David Marchand
2024-10-21 17:57     ` Mattias Rönnblom
2024-10-21 16:04   ` [PATCH v3 2/4] buildtools/chkincs: check headers with stable API only David Marchand
2024-10-21 16:06     ` Bruce Richardson
2024-10-21 16:04   ` [PATCH v3 3/4] bus/ifpga: use C linkage where appropriate in driver header David Marchand
2024-10-21 18:01     ` Mattias Rönnblom
2024-10-22 19:27       ` David Marchand [this message]
2024-10-21 16:04   ` [PATCH v3 4/4] buildtools/chkincs: check driver specific headers David Marchand
2024-10-21 16:23   ` [PATCH v3 0/4] Enhance headers check Morten Brørup
2024-10-23 14:39   ` David Marchand

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='CAJFAV8y1oX5P9Aq-LMdYnpjW1zSZCiEzL=9A5oWeRugVGnxRag@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=hofors@lysator.liu.se \
    --cc=ktraynor@redhat.com \
    --cc=mattias.ronnblom@ericsson.com \
    --cc=mb@smartsharesystems.com \
    --cc=rosen.xu@intel.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).