DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: William Tu <u9012063@gmail.com>
Cc: Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>,
	Thomas Monjalon <thomas@monjalon.net>,  dpdk-dev <dev@dpdk.org>,
	Dmitry Kozliuk <Dmitry.Kozliuk@gmail.com>,
	 Nick Connolly <nick.connolly@mayadata.io>,
	Omar Cardona <ocardona@microsoft.com>,
	 Pallavi Kadam <pallavi.kadam@intel.com>
Subject: Re: [dpdk-dev] [PATCH v9] eal: remove sys/queue.h from public headers
Date: Fri, 1 Oct 2021 09:27:57 +0200	[thread overview]
Message-ID: <CAJFAV8x0GPmmpHscE-kQQWHXYAGCVk+9cKzmhGJPnXNoXSFJ9w@mail.gmail.com> (raw)
In-Reply-To: <CALDO+SbeFEwjZ9zWgQB+X2wR2BH4K97v5YZNLY55ER1dO=35Jw@mail.gmail.com>

Hello William,

On Fri, Oct 1, 2021 at 12:17 AM William Tu <u9012063@gmail.com> wrote:
>
> On Mon, Sep 20, 2021 at 1:11 PM Narcisa Ana Maria Vasile
> <navasile@linux.microsoft.com> wrote:
> >
> > On Tue, Aug 24, 2021 at 04:21:03PM +0000, William Tu wrote:
> > > Currently there are some public headers that include 'sys/queue.h', which
> > > is not POSIX, but usually provided by the Linux/BSD system library.
> > > (Not in POSIX.1, POSIX.1-2001, or POSIX.1-2008. Present on the BSDs.)
> > > The file is missing on Windows. During the Windows build, DPDK uses a
> > > bundled copy, so building a DPDK library works fine.  But when OVS or other
> > > applications use DPDK as a library, because some DPDK public headers
> > > include 'sys/queue.h', on Windows, it triggers an error due to no such
> > > file.
> > >
> > > One solution is to install the 'lib/eal/windows/include/sys/queue.h' into
> > > Windows environment, such as [1]. However, this means DPDK exports the
> > > functionalities of 'sys/queue.h' into the environment, which might cause
> > > symbols, macros, headers clashing with other applications.
> > >
> > > The patch fixes it by removing the "#include <sys/queue.h>" from
> > > DPDK public headers, so programs including DPDK headers don't depend
> > > on the system to provide 'sys/queue.h'. When these public headers use
> > > macros such as TAILQ_xxx, we replace it by the ones with RTE_ prefix.
> > > For Windows, we copy the definitions from <sys/queue.h> to rte_os.h
> > > in Windows EAL. Note that these RTE_ macros are compatible with
> > > <sys/queue.h>, both at the level of API (to use with <sys/queue.h>
> > > macros in C files) and ABI (to avoid breaking it).
> > >
> > > Additionally, the TAILQ_FOREACH_SAFE is not part of <sys/queue.h>,
> > > the patch replaces it with RTE_TAILQ_FOREACH_SAFE.
> > >
> > > [1] http://mails.dpdk.org/archives/dev/2021-August/216304.html
> > >
> > > Suggested-by: Nick Connolly <nick.connolly@mayadata.io>
> > > Suggested-by: Dmitry Kozliuk <Dmitry.Kozliuk@gmail.com>
> > > Acked-by: Dmitry Kozliuk <Dmitry.Kozliuk@gmail.com>
> > > Signed-off-by: William Tu <u9012063@gmail.com>
> > > ---
> > Acked-by: Narcisa Vasile <navasile@linux.microsoft.com>
> Hi Thomas,
> Ping to see if the patch can be applied?

$ grep -rE '\<(|S)(CIRCLEQ|LIST|SIMPLEQ|TAILQ)_' build/install/include/
build/install/include/rte_tailq.h: *   first parameter passed to
TAILQ_HEAD macro)
build/install/include/rte_crypto_sym.h: * - LIST_END should not be
added to this enum
build/install/include/rte_crypto_sym.h: * - LIST_END should not be
added to this enum
build/install/include/rte_crypto_sym.h: * - LIST_END should not be
added to this enum
build/install/include/rte_os.h:#define RTE_TAILQ_HEAD(name, type)
TAILQ_HEAD(name, type)
build/install/include/rte_os.h:#define RTE_TAILQ_ENTRY(type) TAILQ_ENTRY(type)
build/install/include/rte_os.h:#define RTE_TAILQ_FOREACH(var, head,
field) TAILQ_FOREACH(var, head, field)
build/install/include/rte_os.h:#define RTE_TAILQ_FIRST(head) TAILQ_FIRST(head)
build/install/include/rte_os.h:#define RTE_TAILQ_NEXT(elem, field)
TAILQ_NEXT(elem, field)
build/install/include/rte_os.h:#define RTE_STAILQ_HEAD(name, type)
STAILQ_HEAD(name, type)
build/install/include/rte_os.h:#define RTE_STAILQ_ENTRY(type) STAILQ_ENTRY(type)

LGTM.

I just have a concern that headers get broken again if we have no check.
Could buildtools/chkincs do the job (if we make this check work on Windows)?


-- 
David Marchand


  reply	other threads:[~2021-10-01  7:28 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11 20:46 [dpdk-dev] [PATCHv2] include: fix sys/queue.h William Tu
2021-08-11 15:50 ` Dmitry Kozlyuk
2021-08-11 18:13   ` William Tu
2021-08-12 20:05 ` [dpdk-dev] [PATCHv3] " William Tu
2021-08-12 21:58   ` Dmitry Kozlyuk
2021-08-13  1:02   ` [dpdk-dev] [PATCHv4] eal: remove sys/queue.h from public headers William Tu
2021-08-13  1:11     ` Stephen Hemminger
2021-08-13  1:36       ` William Tu
2021-08-13  3:36     ` [dpdk-dev] [PATCHv5] " William Tu
2021-08-13 18:59       ` Dmitry Kozlyuk
2021-08-14  2:31         ` William Tu
2021-08-14  2:51       ` [dpdk-dev] [PATCH v6] " William Tu
2021-08-17 22:06         ` Dmitry Kozlyuk
2021-08-18 23:26         ` [dpdk-dev] [PATCH v7] " William Tu
2021-08-19 23:29           ` Dmitry Kozlyuk
2021-08-23 12:34             ` William Tu
2021-08-23 13:03           ` [dpdk-dev] [PATCH v8] " William Tu
2021-08-23 19:14             ` Dmitry Kozlyuk
2021-08-24 16:11               ` William Tu
2021-08-24 16:21             ` [dpdk-dev] [PATCH v9] " William Tu
2021-09-20 20:11               ` Narcisa Ana Maria Vasile
2021-09-30 22:16                 ` William Tu
2021-10-01  7:27                   ` David Marchand [this message]
2021-10-01  9:36                     ` Dmitry Kozlyuk
2021-10-01  9:51                       ` Dmitry Kozlyuk
2021-10-01  9:55                         ` David Marchand
2021-10-01 10:12                           ` Bruce Richardson
2021-10-01 10:34                 ` 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=CAJFAV8x0GPmmpHscE-kQQWHXYAGCVk+9cKzmhGJPnXNoXSFJ9w@mail.gmail.com \
    --to=david.marchand@redhat.com \
    --cc=Dmitry.Kozliuk@gmail.com \
    --cc=dev@dpdk.org \
    --cc=navasile@linux.microsoft.com \
    --cc=nick.connolly@mayadata.io \
    --cc=ocardona@microsoft.com \
    --cc=pallavi.kadam@intel.com \
    --cc=thomas@monjalon.net \
    --cc=u9012063@gmail.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).