From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9BB55A0C43; Wed, 11 Aug 2021 17:16:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1CF74410EC; Wed, 11 Aug 2021 17:16:56 +0200 (CEST) Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by mails.dpdk.org (Postfix) with ESMTP id EF74D40C35 for ; Wed, 11 Aug 2021 17:16:54 +0200 (CEST) Received: by mail-pj1-f42.google.com with SMTP id lw7-20020a17090b1807b029017881cc80b7so10091805pjb.3 for ; Wed, 11 Aug 2021 08:16:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xud/LRUQD5bfA6Gee6zF/RDH6RGt4xDTKd3GpPv88Hs=; b=EhNH4QfpDuYkxR6UMaCVktlngOncDftvn2JD+nOw6N9oWsYABw1sOZKZB3x/3w+dCB pu4SLMhdpwmVBYg5DX1Do7+0+0E2dmyqiPaiFkrJi6sVEVB2FgeP30G9dV+uqacaAuFn 5QceIurw2Pb3rakxnDwM9oLeRsdJjikd/mG3+8YKFBjuGoA2fBn3sMkex0SS2CaUfADg 2fd8Bmuv3OuH4E8R2Hv1rT6Xy62U9b1NKHbYA8BxU1vQKP30eAQuA4x6koeNBoEONaIE TOGZY6jQvNVA9Fpfob4/3t2Ju41AA/6JYsJsD+22fXO+cC5UI89PjfmhOjL7AMpO7o7g TPtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xud/LRUQD5bfA6Gee6zF/RDH6RGt4xDTKd3GpPv88Hs=; b=sB2oJUA/fK3PPSay8no4rDGQk+oRPo6Cjmg6MOG3p7guiGtCJmVGjq5Znb+HNvsqF6 AqjCo1NDlz0xKV9pakSTp8SKJfB8idFO2+n9egQIbp8Xx4/hDcxGQnP9dTB4Z7T0ldBl DYVSO3bImNKoCEM27rqLTQ49ipOIQaRo0mtCbszGAKSerpkK7Ma3SbpiyCjJa3FO3TUu q5AchikwdzCk0hjvDEsizfoqEe6pEv6WXI1jC6q8rv+9TtdI+SCFvTcMvGw2NVb9O7iW CohIjvymvevvGrMx3v1oamRbxN6Q4/5ufZjT8IjIbmbNXVXUVpMvlxptJZos3NOSYIjZ XYdQ== X-Gm-Message-State: AOAM531r496m3SgFJxN73lemkkQck63n9jw/kNhpFxa6AldwM08j1yYU LXreDKEM/7emjjXsj8OO67mFfswlEf0= X-Google-Smtp-Source: ABdhPJxxRJc8HQWFBfi9LSFxcnYSw9bV+DoDbEkk+ufV7QEHTRcRwgZVRmvRcOEga+Nwdu333Lj6Lg== X-Received: by 2002:a05:6a00:10cb:b029:3c6:8cc9:5098 with SMTP id d11-20020a056a0010cbb02903c68cc95098mr34722440pfu.41.1628695013590; Wed, 11 Aug 2021 08:16:53 -0700 (PDT) Received: from sc9-mailhost3.vmware.com ([66.170.99.1]) by smtp.gmail.com with ESMTPSA id 16sm28349918pfu.109.2021.08.11.08.16.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 08:16:52 -0700 (PDT) From: William Tu To: dev@dpdk.org Cc: Dmitry.Kozliuk@gmail.com, nick.connolly@mayadata.io Date: Wed, 11 Aug 2021 20:46:27 +0000 Message-Id: <20210811204627.213-1-u9012063@gmail.com> X-Mailer: git-send-email 2.32.0.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCHv2] include: fix sys/queue.h. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 from a couple of headers, replace it with #include , 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. 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. Suggested-by: Nick Connolly Suggested-by: Dmitry Kozliuk Signed-off-by: William Tu --- v1->v2: - follow the suggestion by Nick and Dmitry - http://mails.dpdk.org/archives/dev/2021-August/216304.html --- lib/eal/freebsd/include/rte_os.h | 1 + lib/eal/include/rte_bus.h | 2 +- lib/eal/include/rte_class.h | 2 -- lib/eal/include/rte_dev.h | 2 +- lib/eal/include/rte_devargs.h | 1 - lib/eal/include/rte_log.h | 1 - lib/eal/include/rte_service.h | 1 - lib/eal/include/rte_tailq.h | 2 +- lib/eal/linux/include/rte_os.h | 1 + lib/eal/windows/include/meson.build | 4 ++++ lib/eal/windows/include/rte_os.h | 1 + lib/eal/windows/include/sys/meson.build | 6 ++++++ lib/mempool/rte_mempool.h | 1 - 13 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 lib/eal/windows/include/sys/meson.build diff --git a/lib/eal/freebsd/include/rte_os.h b/lib/eal/freebsd/include/rte_os.h index 627f0483ab..c0fa9791a1 100644 --- a/lib/eal/freebsd/include/rte_os.h +++ b/lib/eal/freebsd/include/rte_os.h @@ -11,6 +11,7 @@ */ #include +#include typedef cpuset_t rte_cpuset_t; #define RTE_HAS_CPUSET diff --git a/lib/eal/include/rte_bus.h b/lib/eal/include/rte_bus.h index 80b154fb98..8e90d768bd 100644 --- a/lib/eal/include/rte_bus.h +++ b/lib/eal/include/rte_bus.h @@ -19,8 +19,8 @@ extern "C" { #endif #include -#include +#include #include #include diff --git a/lib/eal/include/rte_class.h b/lib/eal/include/rte_class.h index 856d09b22d..1430c62943 100644 --- a/lib/eal/include/rte_class.h +++ b/lib/eal/include/rte_class.h @@ -22,8 +22,6 @@ extern "C" { #endif -#include - #include /** Double linked list of classes */ diff --git a/lib/eal/include/rte_dev.h b/lib/eal/include/rte_dev.h index 6dd72c11a1..7d1bf32a42 100644 --- a/lib/eal/include/rte_dev.h +++ b/lib/eal/include/rte_dev.h @@ -18,8 +18,8 @@ extern "C" { #endif #include -#include +#include #include #include #include diff --git a/lib/eal/include/rte_devargs.h b/lib/eal/include/rte_devargs.h index cd90944fe8..9ec2786812 100644 --- a/lib/eal/include/rte_devargs.h +++ b/lib/eal/include/rte_devargs.h @@ -21,7 +21,6 @@ extern "C" { #endif #include -#include #include #include diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index b706bb8710..bb3523467b 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -21,7 +21,6 @@ extern "C" { #include #include #include -#include #include #include diff --git a/lib/eal/include/rte_service.h b/lib/eal/include/rte_service.h index c7d037d862..1c9275c32a 100644 --- a/lib/eal/include/rte_service.h +++ b/lib/eal/include/rte_service.h @@ -29,7 +29,6 @@ extern "C" { #include #include -#include #include #include diff --git a/lib/eal/include/rte_tailq.h b/lib/eal/include/rte_tailq.h index b6fe4e5f78..b948ccd45c 100644 --- a/lib/eal/include/rte_tailq.h +++ b/lib/eal/include/rte_tailq.h @@ -15,8 +15,8 @@ extern "C" { #endif -#include #include +#include #include /** dummy structure type used by the rte_tailq APIs */ diff --git a/lib/eal/linux/include/rte_os.h b/lib/eal/linux/include/rte_os.h index 1618b4df22..9077e9b614 100644 --- a/lib/eal/linux/include/rte_os.h +++ b/lib/eal/linux/include/rte_os.h @@ -11,6 +11,7 @@ */ #include +#include #ifdef CPU_SETSIZE /* may require _GNU_SOURCE */ typedef cpu_set_t rte_cpuset_t; diff --git a/lib/eal/windows/include/meson.build b/lib/eal/windows/include/meson.build index b3534b025f..875cc1cf0d 100644 --- a/lib/eal/windows/include/meson.build +++ b/lib/eal/windows/include/meson.build @@ -8,3 +8,7 @@ headers += files( 'rte_virt2phys.h', 'rte_windows.h', ) + +sys_headers = [] +subdir('sys') +install_headers(sys_headers, subdir: 'sys') diff --git a/lib/eal/windows/include/rte_os.h b/lib/eal/windows/include/rte_os.h index 66c711d458..81457a1b8b 100644 --- a/lib/eal/windows/include/rte_os.h +++ b/lib/eal/windows/include/rte_os.h @@ -13,6 +13,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/lib/eal/windows/include/sys/meson.build b/lib/eal/windows/include/sys/meson.build new file mode 100644 index 0000000000..6896cbf678 --- /dev/null +++ b/lib/eal/windows/include/sys/meson.build @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2021 VMware, Inc + +sys_headers += files( + 'queue.h', +) diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h index 4235d6f0bf..1cc013ac4e 100644 --- a/lib/mempool/rte_mempool.h +++ b/lib/mempool/rte_mempool.h @@ -38,7 +38,6 @@ #include #include #include -#include #include #include -- 2.30.2