[dpdk-dev] [PATCHv4] eal: remove sys/queue.h from public headers.

Stephen Hemminger stephen at networkplumber.org
Fri Aug 13 03:11:12 CEST 2021


On Fri, 13 Aug 2021 01:02:50 +0000
William Tu <u9012063 at gmail.com> wrote:

> Currently there are some public headers that include 'sys/queue.h', which
> is not POSIX, but usually provided by 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 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 error due to no such file.
> 
> One solution is to installl the 'lib/eal/windows/include/sys/queue.h' into
> Windows environment, such as [1]. However, this means DPDK exports the
> functinoalities 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 system to provide 'sys/queue.h'. When these public headers use
> macros such as TAILQ_xxx, we replace it with RTE_ prefix.
> For Windows, we copy the definitions from <sys/queue.h> to rte_os.h
> under windows. Note that these RTE_ macros are compatible with
> <sys/queue.h>, only 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.
> With this patch, all the public headers no longer have
> "#include <sys/queue.h>" or "TAILQ_xxx" macros.


Please run a spell checker on the commit message if you resubmit.


More information about the dev mailing list