DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
To: William Tu <u9012063@gmail.com>
Cc: dev@dpdk.org, nick.connolly@mayadata.io,
	Bruce Richardson <bruce.richardson@intel.com>,
	David Marchand <david.marchand@redhat.com>,
	Ray Kinsella <mdr@ashroe.eu>,
	Tyler Retzlaff <roretzla@linux.microsoft.com>
Subject: Re: [dpdk-dev] [PATCHv2] include: fix sys/queue.h.
Date: Wed, 11 Aug 2021 18:50:18 +0300	[thread overview]
Message-ID: <20210811185018.4d363f6c@sovereign> (raw)
In-Reply-To: <20210811204627.213-1-u9012063@gmail.com>

Hi William,

2021-08-11 20:46 (UTC+0000), William Tu:
> Currently there are a couple of header files include 'sys/queue.h',
> which is a POSIX functionality.  When compiling DPDK with OVS on
> Windows, we encountered issues such as, found the missing header.
> In file included from ../lib/dpdk.c:27:
> C:\temp\dpdk\include\rte_log.h:24:10: fatal error: 'sys/queue.h' file
> not found
> 
> The patch fixes it by 1) removing the #include <sys/queue.h> from
> a couple of headers, replace it with  #include <rte_os.h>, and
> 2) include sys/queue.h in the rte_os.h. As a result, for Linux/BSD,
> it is using the sys/queue.h from its POSIX library, and for Windows,
> DPDK will use the bundled sys/queue.h.
> 
> 1) fixes the case that DPDK library shouldn't export POSIX functionality
> into the environment (symbols, macros, headers etc), which cause definitions
> clashing with the application.
> 2) fixes the case that DPDK should depend only on the C library and not
> require POSIX functionality from the underlying system.

Sorry, this is not exactly what was suggested here:

	http://inbox.dpdk.org/dev/20210811013325.34c36220@sovereign/

The point was not to install <sys/queue.h>. Its full content is not needed
for DPDK interface, only for implementation. Public headers only need a
handful of macros for list/tailq heads and links. Those macros should be
provided by DPDK, with RTE_ prefix. For Linux and FreeBSD it will just be:

	#include <sys/queue.h>
	#define RTE_TAILQ_ENTRY(type) TAILQ_ENTRY(type)
	/* ... */

For Windows you would have to copy definitions from <sys/queue.h>
to some public header, <rte_os.h> seems OK. All public headers that need
<sys/queue.h> macros must have them replaced with RTE_ version.
Implementation remains unchanged. No new files need to be installed,
because when DPDK is built on Windows, it uses the bundled <sys/queue.h>,
and when it is installed, only RTE_ macros you created are visible.

Macro documentation should clearly state that they are compatible with system
<sys/queue.h> for Linux and FreeBSD, and for Windows they are compatible with
the version used during build.

+Bruce, David, Ray, Tyler to confirm/object the idea.

> There are still a couple of headers using sys/queue.h, ex:
> rte_bus_pci.h. Since it's not been used in Windows yet, we can
> fix them later.

Another item I think of is a checkpatch rule to prohibit TAILQ_xxx, etc
macro in public headers after replacing them all.

> Suggested-by: Nick Connolly <nick.connolly@mayadata.io>
> Suggested-by: Dmitry Kozliuk <Dmitry.Kozliuk@gmail.com>
> Signed-off-by: William Tu <u9012063@gmail.com>
> ---
> v1->v2:
>   - follow the suggestion by Nick and Dmitry 
>   - http://mails.dpdk.org/archives/dev/2021-August/216304.html

Please send new versions as replies to the previous ones:

	git send-email --in-reply-to MSGID ...

https://doc.dpdk.org/guides/contributing/patches.html

  reply	other threads:[~2021-08-11 15:50 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11 20:46 William Tu
2021-08-11 15:50 ` Dmitry Kozlyuk [this message]
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
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=20210811185018.4d363f6c@sovereign \
    --to=dmitry.kozliuk@gmail.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=mdr@ashroe.eu \
    --cc=nick.connolly@mayadata.io \
    --cc=roretzla@linux.microsoft.com \
    --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).