DPDK patches and discussions
 help / color / mirror / Atom feed
* [RFC 0/6] Add a stricter headers check
@ 2024-11-27 11:26 David Marchand
  2024-11-27 11:26 ` [RFC 1/6] baseband/acc: fix exported header David Marchand
                   ` (9 more replies)
  0 siblings, 10 replies; 75+ messages in thread
From: David Marchand @ 2024-11-27 11:26 UTC (permalink / raw)
  To: dev; +Cc: thomas, bruce.richardson

As explained in patch 6, the current headers check can not catch
issues when a public header includes an internal header.
Fixing this from meson does not seem an easy task.

The approach of this RFC is to reimplement the check in a Makefile invoked
out of DPDK (like what is done for external compilation of examples).
This has the advantage of being simple, and avoiding any (non intentional)
implicit include path coming from the meson framework.

As there was no easy way to distinguish "indirect" headers in an
installed DPDK, I chose to move those headers in a new sub directory
(patch 5).

Patch 1-4 fixes have not been marked as backport material as those bugs
seems minor/easy to fix externally (by either including missing headers,
or enabling enable_driver_sdk option).

For now, I left the check_includes= option untouched, as there may be
users of this check and this check still catches issues without
requiring to install DPDK.


-- 
David Marchand

David Marchand (6):
  baseband/acc: fix exported header
  drivers: drop export of driver headers
  eventdev: do not include driver header in DMA adapter
  drivers: fix exported headers
  build: install indirect headers to a dedicated directory
  buildtools: externally check exported headers

 .ci/linux-build.sh                            |  7 +-
 buildtools/chkincs/Makefile                   | 77 +++++++++++++++++++
 buildtools/pkg-config/meson.build             |  8 +-
 devtools/test-meson-builds.sh                 |  6 +-
 drivers/baseband/acc/meson.build              |  2 +-
 drivers/bus/vmbus/rte_vmbus_reg.h             |  6 ++
 drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h     |  4 +
 drivers/net/dpaa/rte_pmd_dpaa.h               |  2 +
 drivers/net/iavf/rte_pmd_iavf.h               |  6 ++
 drivers/net/mlx5/rte_pmd_mlx5.h               |  3 +
 drivers/raw/cnxk_bphy/rte_pmd_bphy.h          | 16 ++++
 drivers/raw/cnxk_gpio/rte_pmd_cnxk_gpio.h     |  3 +
 drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h |  2 +
 drivers/raw/ntb/rte_pmd_ntb.h                 |  2 +
 lib/bbdev/meson.build                         |  5 +-
 lib/eal/x86/include/meson.build               |  3 +-
 lib/ethdev/meson.build                        |  6 +-
 lib/eventdev/rte_event_dma_adapter.h          |  2 +-
 lib/meson.build                               |  2 +-
 lib/mldev/meson.build                         |  5 +-
 lib/rawdev/meson.build                        |  3 +-
 lib/regexdev/meson.build                      |  3 +-
 lib/security/meson.build                      |  3 +-
 23 files changed, 153 insertions(+), 23 deletions(-)
 create mode 100644 buildtools/chkincs/Makefile

-- 
2.47.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [RFC 1/6] baseband/acc: fix exported header
  2024-11-27 11:26 [RFC 0/6] Add a stricter headers check David Marchand
@ 2024-11-27 11:26 ` David Marchand
  2024-11-27 11:26 ` [RFC 2/6] drivers: drop export of driver headers David Marchand
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2024-11-27 11:26 UTC (permalink / raw)
  To: dev; +Cc: thomas, bruce.richardson, Nicolas Chautru, Maxime Coquelin

rte_acc_cfg.h relies on rte_acc_common_cfg.h.

Fixes: 32e8b7ea35dd ("baseband/acc100: refactor to segregate common code")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/baseband/acc/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/baseband/acc/meson.build b/drivers/baseband/acc/meson.build
index 64fcf1537a..d9fb947eaa 100644
--- a/drivers/baseband/acc/meson.build
+++ b/drivers/baseband/acc/meson.build
@@ -26,4 +26,4 @@ deps += ['bus_pci']
 
 sources = files('acc_common.c', 'rte_acc100_pmd.c', 'rte_vrb_pmd.c')
 
-headers = files('rte_acc_cfg.h')
+headers = files('rte_acc_cfg.h', 'rte_acc_common_cfg.h')
-- 
2.47.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [RFC 2/6] drivers: drop export of driver headers
  2024-11-27 11:26 [RFC 0/6] Add a stricter headers check David Marchand
  2024-11-27 11:26 ` [RFC 1/6] baseband/acc: fix exported header David Marchand
@ 2024-11-27 11:26 ` David Marchand
  2024-11-27 11:26 ` [RFC 3/6] eventdev: do not include driver header in DMA adapter David Marchand
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2024-11-27 11:26 UTC (permalink / raw)
  To: dev
  Cc: thomas, bruce.richardson, Nicolas Chautru, Ferruh Yigit,
	Andrew Rybchenko, Srikanth Yalavarthi, Sachin Saxena,
	Hemant Agrawal, Ori Kam, Akhil Goyal, Anoob Joseph

Many classes are exposing driver only headers as public headers.
Move them to the driver_sdk_headers list.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/bbdev/meson.build    | 5 ++---
 lib/ethdev/meson.build   | 6 +++---
 lib/mldev/meson.build    | 5 +----
 lib/rawdev/meson.build   | 3 ++-
 lib/regexdev/meson.build | 3 ++-
 lib/security/meson.build | 3 ++-
 6 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/lib/bbdev/meson.build b/lib/bbdev/meson.build
index 07685e7578..7d035065f1 100644
--- a/lib/bbdev/meson.build
+++ b/lib/bbdev/meson.build
@@ -8,7 +8,6 @@ if is_windows
 endif
 
 sources = files('rte_bbdev.c')
-headers = files('rte_bbdev.h',
-        'rte_bbdev_pmd.h',
-        'rte_bbdev_op.h')
+headers = files('rte_bbdev.h', 'rte_bbdev_op.h')
+driver_sdk_headers = files('rte_bbdev_pmd.h')
 deps += ['mbuf']
diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build
index f1d2586591..8ba6c708a2 100644
--- a/lib/ethdev/meson.build
+++ b/lib/ethdev/meson.build
@@ -26,11 +26,8 @@ headers = files(
         'rte_ethdev_trace_fp.h',
         'rte_dev_info.h',
         'rte_flow.h',
-        'rte_flow_driver.h',
         'rte_mtr.h',
-        'rte_mtr_driver.h',
         'rte_tm.h',
-        'rte_tm_driver.h',
 )
 
 indirect_headers += files(
@@ -42,6 +39,9 @@ driver_sdk_headers += files(
         'ethdev_driver.h',
         'ethdev_pci.h',
         'ethdev_vdev.h',
+        'rte_flow_driver.h',
+        'rte_mtr_driver.h',
+        'rte_tm_driver.h',
 )
 
 if is_linux
diff --git a/lib/mldev/meson.build b/lib/mldev/meson.build
index 2c933baad6..efc3edd288 100644
--- a/lib/mldev/meson.build
+++ b/lib/mldev/meson.build
@@ -32,11 +32,8 @@ headers = files(
         'rte_mldev.h',
 )
 
-indirect_headers += files(
-        'rte_mldev_core.h',
-)
-
 driver_sdk_headers += files(
+        'rte_mldev_core.h',
         'rte_mldev_pmd.h',
         'mldev_utils.h',
 )
diff --git a/lib/rawdev/meson.build b/lib/rawdev/meson.build
index 7dfc3d5cf9..ccfd922fda 100644
--- a/lib/rawdev/meson.build
+++ b/lib/rawdev/meson.build
@@ -8,6 +8,7 @@ if is_windows
 endif
 
 sources = files('rte_rawdev.c')
-headers = files('rte_rawdev.h', 'rte_rawdev_pmd.h')
+headers = files('rte_rawdev.h')
+driver_sdk_headers = files('rte_rawdev_pmd.h')
 
 deps += ['telemetry']
diff --git a/lib/regexdev/meson.build b/lib/regexdev/meson.build
index 426e764ece..05040051c5 100644
--- a/lib/regexdev/meson.build
+++ b/lib/regexdev/meson.build
@@ -8,6 +8,7 @@ if is_windows
 endif
 
 sources = files('rte_regexdev.c')
-headers = files('rte_regexdev.h', 'rte_regexdev_driver.h')
+headers = files('rte_regexdev.h')
 indirect_headers += files('rte_regexdev_core.h')
+driver_sdk_headers = files('rte_regexdev_driver.h')
 deps += ['mbuf']
diff --git a/lib/security/meson.build b/lib/security/meson.build
index 1034a7a299..d5431d472c 100644
--- a/lib/security/meson.build
+++ b/lib/security/meson.build
@@ -2,5 +2,6 @@
 # Copyright(c) 2017-2019 Intel Corporation
 
 sources = files('rte_security.c')
-headers = files('rte_security.h', 'rte_security_driver.h')
+headers = files('rte_security.h')
+driver_sdk_headers = files('rte_security_driver.h')
 deps += ['mempool', 'cryptodev', 'net']
-- 
2.47.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [RFC 3/6] eventdev: do not include driver header in DMA adapter
  2024-11-27 11:26 [RFC 0/6] Add a stricter headers check David Marchand
  2024-11-27 11:26 ` [RFC 1/6] baseband/acc: fix exported header David Marchand
  2024-11-27 11:26 ` [RFC 2/6] drivers: drop export of driver headers David Marchand
@ 2024-11-27 11:26 ` David Marchand
  2024-11-27 13:49   ` [EXTERNAL] " Amit Prakash Shukla
  2024-11-27 11:26 ` [RFC 4/6] drivers: fix exported headers David Marchand
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 75+ messages in thread
From: David Marchand @ 2024-11-27 11:26 UTC (permalink / raw)
  To: dev; +Cc: thomas, bruce.richardson, Amit Prakash Shukla, Jerin Jacob

The dma adapter header does not require including rte_dmadev_pmd.h which
is a driver header.

Fixes: 66a30a29387a ("eventdev/dma: introduce DMA adapter")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/eventdev/rte_event_dma_adapter.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eventdev/rte_event_dma_adapter.h b/lib/eventdev/rte_event_dma_adapter.h
index 5c480b82ff..34142f26db 100644
--- a/lib/eventdev/rte_event_dma_adapter.h
+++ b/lib/eventdev/rte_event_dma_adapter.h
@@ -144,7 +144,7 @@
 #include <stdint.h>
 
 #include <rte_common.h>
-#include <rte_dmadev_pmd.h>
+#include <rte_dmadev.h>
 #include <rte_eventdev.h>
 
 #ifdef __cplusplus
-- 
2.47.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [RFC 4/6] drivers: fix exported headers
  2024-11-27 11:26 [RFC 0/6] Add a stricter headers check David Marchand
                   ` (2 preceding siblings ...)
  2024-11-27 11:26 ` [RFC 3/6] eventdev: do not include driver header in DMA adapter David Marchand
@ 2024-11-27 11:26 ` David Marchand
  2024-11-27 11:26 ` [RFC 5/6] build: install indirect headers to a dedicated directory David Marchand
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2024-11-27 11:26 UTC (permalink / raw)
  To: dev
  Cc: thomas, bruce.richardson, Long Li, Wei Hu, Ankur Dwivedi,
	Anoob Joseph, Tejasree Kondoj, Hemant Agrawal, Sachin Saxena,
	Vladimir Medvedkin, Ian Stokes, Dariusz Sosnowski,
	Viacheslav Ovsiienko, Bing Zhao, Ori Kam, Suanming Mou,
	Matan Azrad, Jakub Palider, Tomasz Duszynski, Gagandeep Singh,
	Jingjing Wu, Stephen Hemminger, Akhil Goyal, Haiyue Wang,
	Jeff Guo, Michael Baum, Jerin Jacob, Nipun Gupta, Shreyansh Jain,
	Xiaoyun Li

Those headers could not be included individually as they were not
including their dependencies, or were subject to some build warnings.

Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
Fixes: 5b2a1a02dcaf ("crypto/cnxk: fix experimental version for PMD API")
Fixes: e5abbeeeefa5 ("crypto/cnxk: add PMD API for getting CPTR")
Fixes: 3ca607402c4d ("crypto/cnxk: add PMD API to flush CTX")
Fixes: 8c3495f5d2dd ("net/dpaa: support loopback API")
Fixes: 12b435bf8f2f ("net/iavf: support flex desc metadata extraction")
Fixes: 23f627e0ed28 ("net/mlx5: add flow sync API")
Fixes: f5177bdc8b76 ("net/mlx5: add GENEVE TLV options parser API")
Fixes: 7cf197684589 ("raw/cnxk_bphy: support interrupt init and cleanup")
Fixes: 633dae698070 ("raw/cnxk_gpio: add standard GPIO operations")
Fixes: 53c71586c789 ("raw/dpaa2_cmdif: support enqueue/dequeue operations")
Fixes: c39d1e082a4b ("raw/ntb: setup queues")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/bus/vmbus/rte_vmbus_reg.h             |  6 ++++++
 drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h     |  4 ++++
 drivers/net/dpaa/rte_pmd_dpaa.h               |  2 ++
 drivers/net/iavf/rte_pmd_iavf.h               |  6 ++++++
 drivers/net/mlx5/rte_pmd_mlx5.h               |  3 +++
 drivers/raw/cnxk_bphy/rte_pmd_bphy.h          | 16 ++++++++++++++++
 drivers/raw/cnxk_gpio/rte_pmd_cnxk_gpio.h     |  3 +++
 drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h |  2 ++
 drivers/raw/ntb/rte_pmd_ntb.h                 |  2 ++
 9 files changed, 44 insertions(+)

diff --git a/drivers/bus/vmbus/rte_vmbus_reg.h b/drivers/bus/vmbus/rte_vmbus_reg.h
index e3299aa871..95c8eb29b4 100644
--- a/drivers/bus/vmbus/rte_vmbus_reg.h
+++ b/drivers/bus/vmbus/rte_vmbus_reg.h
@@ -6,6 +6,12 @@
 #ifndef _VMBUS_REG_H_
 #define _VMBUS_REG_H_
 
+#include <stdint.h>
+
+#include <rte_common.h>
+#include <rte_stdatomic.h>
+#include <rte_uuid.h>
+
 /*
  * Hyper-V SynIC message format.
  */
diff --git a/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h b/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
index 02278605a2..2bb0ff9e95 100644
--- a/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
+++ b/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
@@ -11,8 +11,12 @@
 #ifndef _PMD_CNXK_CRYPTO_H_
 #define _PMD_CNXK_CRYPTO_H_
 
+#include <stdbool.h>
 #include <stdint.h>
 
+#include <rte_compat.h>
+#include <rte_crypto.h>
+
 /* Forward declarations */
 
 /**
diff --git a/drivers/net/dpaa/rte_pmd_dpaa.h b/drivers/net/dpaa/rte_pmd_dpaa.h
index ec45633ba2..0a57e2097a 100644
--- a/drivers/net/dpaa/rte_pmd_dpaa.h
+++ b/drivers/net/dpaa/rte_pmd_dpaa.h
@@ -5,6 +5,8 @@
 #ifndef _PMD_DPAA_H_
 #define _PMD_DPAA_H_
 
+#include <stdint.h>
+
 /**
  * @file rte_pmd_dpaa.h
  *
diff --git a/drivers/net/iavf/rte_pmd_iavf.h b/drivers/net/iavf/rte_pmd_iavf.h
index 56d453fc4c..04b86a5dd7 100644
--- a/drivers/net/iavf/rte_pmd_iavf.h
+++ b/drivers/net/iavf/rte_pmd_iavf.h
@@ -15,6 +15,7 @@
  */
 
 #include <stdio.h>
+
 #include <rte_compat.h>
 #include <rte_mbuf.h>
 #include <rte_mbuf_dyn.h>
@@ -184,6 +185,7 @@ __rte_experimental
 static inline void
 rte_pmd_ifd_dump_proto_xtr_metadata(struct rte_mbuf *m)
 {
+#ifdef ALLOW_EXPERIMENTAL_API
 	union rte_pmd_ifd_proto_xtr_metadata data;
 
 	if (!rte_pmd_ifd_dynf_proto_xtr_metadata_avail())
@@ -243,6 +245,10 @@ rte_pmd_ifd_dump_proto_xtr_metadata(struct rte_mbuf *m)
 	else if (m->ol_flags & RTE_IAVF_PKT_RX_DYNF_PROTO_XTR_IP_OFFSET)
 		printf(" - Flexible descriptor's Extraction: ip_offset=%u",
 		       data.ip_ofs);
+#else
+	RTE_SET_USED(m);
+	RTE_VERIFY(false);
+#endif
 }
 
 #ifdef __cplusplus
diff --git a/drivers/net/mlx5/rte_pmd_mlx5.h b/drivers/net/mlx5/rte_pmd_mlx5.h
index fdd2f65888..f2c6aebe0b 100644
--- a/drivers/net/mlx5/rte_pmd_mlx5.h
+++ b/drivers/net/mlx5/rte_pmd_mlx5.h
@@ -5,6 +5,9 @@
 #ifndef RTE_PMD_PRIVATE_MLX5_H_
 #define RTE_PMD_PRIVATE_MLX5_H_
 
+#include <stdint.h>
+
+#include <rte_byteorder.h>
 #include <rte_compat.h>
 
 /**
diff --git a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
index f668e6ea82..c200c935ff 100644
--- a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
+++ b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
@@ -391,6 +391,7 @@ rte_pmd_bphy_intr_init(uint16_t dev_id)
 {
 	struct cnxk_bphy_irq_msg msg = {
 		.type = CNXK_BPHY_IRQ_MSG_TYPE_INIT,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, CNXK_BPHY_DEF_QUEUE, &msg,
@@ -411,6 +412,7 @@ rte_pmd_bphy_intr_fini(uint16_t dev_id)
 {
 	struct cnxk_bphy_irq_msg msg = {
 		.type = CNXK_BPHY_IRQ_MSG_TYPE_FINI,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, CNXK_BPHY_DEF_QUEUE, &msg,
@@ -470,6 +472,9 @@ rte_pmd_bphy_intr_unregister(uint16_t dev_id, int irq_num)
 {
 	struct cnxk_bphy_irq_info info = {
 		.irq_num = irq_num,
+		.handler = NULL,
+		.data = NULL,
+		.cpu = -1,
 	};
 	struct cnxk_bphy_irq_msg msg = {
 		.type = CNXK_BPHY_IRQ_MSG_TYPE_UNREGISTER,
@@ -496,6 +501,7 @@ rte_pmd_bphy_intr_mem_get(uint16_t dev_id, struct cnxk_bphy_mem *mem)
 {
 	struct cnxk_bphy_irq_msg msg = {
 		.type = CNXK_BPHY_IRQ_MSG_TYPE_MEM_GET,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, CNXK_BPHY_DEF_QUEUE, &msg,
@@ -518,6 +524,7 @@ rte_pmd_bphy_npa_pf_func_get(uint16_t dev_id, uint16_t *pf_func)
 {
 	struct cnxk_bphy_irq_msg msg = {
 		.type = CNXK_BPHY_MSG_TYPE_NPA_PF_FUNC,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, CNXK_BPHY_DEF_QUEUE, &msg,
@@ -540,6 +547,7 @@ rte_pmd_bphy_sso_pf_func_get(uint16_t dev_id, uint16_t *pf_func)
 {
 	struct cnxk_bphy_irq_msg msg = {
 		.type = CNXK_BPHY_MSG_TYPE_SSO_PF_FUNC,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, CNXK_BPHY_DEF_QUEUE, &msg,
@@ -565,6 +573,7 @@ rte_pmd_bphy_cgx_get_link_info(uint16_t dev_id, uint16_t lmac,
 {
 	struct cnxk_bphy_cgx_msg msg = {
 		.type = CNXK_BPHY_CGX_MSG_TYPE_GET_LINKINFO,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, info, sizeof(*info));
@@ -586,6 +595,7 @@ rte_pmd_bphy_cgx_intlbk_disable(uint16_t dev_id, uint16_t lmac)
 {
 	struct cnxk_bphy_cgx_msg msg = {
 		.type = CNXK_BPHY_CGX_MSG_TYPE_INTLBK_DISABLE,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);
@@ -607,6 +617,7 @@ rte_pmd_bphy_cgx_intlbk_enable(uint16_t dev_id, uint16_t lmac)
 {
 	struct cnxk_bphy_cgx_msg msg = {
 		.type = CNXK_BPHY_CGX_MSG_TYPE_INTLBK_ENABLE,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);
@@ -628,6 +639,7 @@ rte_pmd_bphy_cgx_ptp_rx_disable(uint16_t dev_id, uint16_t lmac)
 {
 	struct cnxk_bphy_cgx_msg msg = {
 		.type = CNXK_BPHY_CGX_MSG_TYPE_PTP_RX_DISABLE,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);
@@ -649,6 +661,7 @@ rte_pmd_bphy_cgx_ptp_rx_enable(uint16_t dev_id, uint16_t lmac)
 {
 	struct cnxk_bphy_cgx_msg msg = {
 		.type = CNXK_BPHY_CGX_MSG_TYPE_PTP_RX_ENABLE,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);
@@ -720,6 +733,7 @@ rte_pmd_bphy_cgx_start_rxtx(uint16_t dev_id, uint16_t lmac)
 {
 	struct cnxk_bphy_cgx_msg msg = {
 		.type = CNXK_BPHY_CGX_MSG_TYPE_START_RXTX,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);
@@ -741,6 +755,7 @@ rte_pmd_bphy_cgx_stop_rxtx(uint16_t dev_id, uint16_t lmac)
 {
 	struct cnxk_bphy_cgx_msg msg = {
 		.type = CNXK_BPHY_CGX_MSG_TYPE_STOP_RXTX,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);
@@ -765,6 +780,7 @@ rte_pmd_bphy_cgx_get_supported_fec(uint16_t dev_id, uint16_t lmac,
 {
 	struct cnxk_bphy_cgx_msg msg = {
 		.type = CNXK_BPHY_CGX_MSG_TYPE_GET_SUPPORTED_FEC,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, fec, sizeof(*fec));
diff --git a/drivers/raw/cnxk_gpio/rte_pmd_cnxk_gpio.h b/drivers/raw/cnxk_gpio/rte_pmd_cnxk_gpio.h
index 80a37be9c7..72d138ab1d 100644
--- a/drivers/raw/cnxk_gpio/rte_pmd_cnxk_gpio.h
+++ b/drivers/raw/cnxk_gpio/rte_pmd_cnxk_gpio.h
@@ -261,6 +261,7 @@ rte_pmd_gpio_get_pin_value(uint16_t dev_id, int gpio, int *val)
 {
 	struct cnxk_gpio_msg msg = {
 		.type = CNXK_GPIO_MSG_TYPE_GET_PIN_VALUE,
+		.data = NULL,
 	};
 
 	return __rte_pmd_gpio_enq_deq(dev_id, gpio, &msg, val, sizeof(*val));
@@ -285,6 +286,7 @@ rte_pmd_gpio_get_pin_edge(uint16_t dev_id, int gpio,
 {
 	struct cnxk_gpio_msg msg = {
 		.type = CNXK_GPIO_MSG_TYPE_GET_PIN_EDGE,
+		.data = NULL,
 	};
 
 	return __rte_pmd_gpio_enq_deq(dev_id, gpio, &msg, edge, sizeof(*edge));
@@ -308,6 +310,7 @@ rte_pmd_gpio_get_pin_dir(uint16_t dev_id, int gpio, enum cnxk_gpio_pin_dir *dir)
 {
 	struct cnxk_gpio_msg msg = {
 		.type = CNXK_GPIO_MSG_TYPE_GET_PIN_DIR,
+		.data = NULL,
 	};
 
 	return __rte_pmd_gpio_enq_deq(dev_id, gpio, &msg, dir, sizeof(*dir));
diff --git a/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h b/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h
index 483b66eaae..7731fc6363 100644
--- a/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h
+++ b/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h
@@ -12,6 +12,8 @@
  *
  */
 
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/drivers/raw/ntb/rte_pmd_ntb.h b/drivers/raw/ntb/rte_pmd_ntb.h
index 6591ce7931..76da3be026 100644
--- a/drivers/raw/ntb/rte_pmd_ntb.h
+++ b/drivers/raw/ntb/rte_pmd_ntb.h
@@ -5,6 +5,8 @@
 #ifndef _RTE_PMD_NTB_H_
 #define _RTE_PMD_NTB_H_
 
+#include <stdint.h>
+
 /* App needs to set/get these attrs */
 #define NTB_QUEUE_SZ_NAME           "queue_size"
 #define NTB_QUEUE_NUM_NAME          "queue_num"
-- 
2.47.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [RFC 5/6] build: install indirect headers to a dedicated directory
  2024-11-27 11:26 [RFC 0/6] Add a stricter headers check David Marchand
                   ` (3 preceding siblings ...)
  2024-11-27 11:26 ` [RFC 4/6] drivers: fix exported headers David Marchand
@ 2024-11-27 11:26 ` David Marchand
  2024-11-27 11:42   ` Bruce Richardson
  2024-11-27 11:26 ` [RFC 6/6] buildtools: externally check exported headers David Marchand
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 75+ messages in thread
From: David Marchand @ 2024-11-27 11:26 UTC (permalink / raw)
  To: dev; +Cc: thomas, bruce.richardson, Konstantin Ananyev

The headers check currently skips "indirect" headers as instrusted via
the indirect_headers meson variable.

This headers check has some limitation that will be addressed in a next
change by inspected all exported headers.
However, exported headers lack the information about "indirect" quality.

Separate "indirect" headers by exporting them in a internal/ sub directory.
This also makes it more obvious which headers are not to be directly used
by an application.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 buildtools/pkg-config/meson.build | 8 +++++++-
 lib/eal/x86/include/meson.build   | 3 ++-
 lib/meson.build                   | 2 +-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/buildtools/pkg-config/meson.build b/buildtools/pkg-config/meson.build
index b36add17e3..809706fe3e 100644
--- a/buildtools/pkg-config/meson.build
+++ b/buildtools/pkg-config/meson.build
@@ -27,12 +27,18 @@ endif
 # are skipped in the case of static linkage thanks to the flag --as-needed.
 
 
+subdirs = [ '.', 'internal' ]
+if get_option('include_subdir_arch') != ''
+    subdirs = [ subdirs, get_option('include_subdir_arch') ]
+    subdirs = [ subdirs, join_paths(get_option('include_subdir_arch'), 'internal')]
+endif
+
 pkg.generate(name: 'dpdk-libs',
         filebase: 'libdpdk-libs',
         description: '''Internal-only DPDK pkgconfig file. Not for direct use.
 Use libdpdk.pc instead of this file to query DPDK compile/link arguments''',
         version: meson.project_version(),
-        subdirs: [get_option('include_subdir_arch'), '.'],
+        subdirs: subdirs,
         extra_cflags: pkg_extra_cflags,
         libraries: ['-Wl,--as-needed'] + dpdk_libraries,
         libraries_private: dpdk_extra_ldflags)
diff --git a/lib/eal/x86/include/meson.build b/lib/eal/x86/include/meson.build
index 52d2f8e969..a100330208 100644
--- a/lib/eal/x86/include/meson.build
+++ b/lib/eal/x86/include/meson.build
@@ -22,5 +22,6 @@ arch_indirect_headers = files(
         'rte_byteorder_32.h',
         'rte_byteorder_64.h',
 )
-install_headers(arch_headers + arch_indirect_headers, subdir: get_option('include_subdir_arch'))
+install_headers(arch_headers, subdir: get_option('include_subdir_arch'))
+install_headers(arch_indirect_headers, subdir: join_paths(get_option('include_subdir_arch'), 'internal'))
 dpdk_chkinc_headers += arch_headers
diff --git a/lib/meson.build b/lib/meson.build
index ce92cb5537..78ada7782e 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -202,7 +202,7 @@ foreach l:libraries
     dpdk_libs_enabled += name
     dpdk_conf.set('RTE_LIB_' + name.to_upper(), 1)
     install_headers(headers)
-    install_headers(indirect_headers)
+    install_headers(indirect_headers, subdir: 'internal')
     if get_option('enable_driver_sdk')
         install_headers(driver_sdk_headers)
     endif
-- 
2.47.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [RFC 6/6] buildtools: externally check exported headers
  2024-11-27 11:26 [RFC 0/6] Add a stricter headers check David Marchand
                   ` (4 preceding siblings ...)
  2024-11-27 11:26 ` [RFC 5/6] build: install indirect headers to a dedicated directory David Marchand
@ 2024-11-27 11:26 ` David Marchand
  2024-12-13 10:50 ` [PATCH v2 0/6] Add a stricter headers check David Marchand
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2024-11-27 11:26 UTC (permalink / raw)
  To: dev; +Cc: thomas, bruce.richardson, Aaron Conole, Michael Santana

At the moment, the headers check (triggered via the check_includes meson
option) is run "internally", iow with compilation flags and include path
coming from the meson components.

One issue is that both internal and public headers are usually stored
in a single directory in the DPDK components.
If a lib/foo library exports a header rte_foo.h (iow rte_foo.h is part
of the headers list in lib/foo/meson.build) and this rte_foo.h includes
an internal header foo_internal.h, then the headers check won't detect
such an issue as rte_foo.h is compiled with -Ilib/foo.

Reimplement the headers check by inspecting (compiling) all DPDK headers
installed in a staging directory.
To identify the directory where DPDK headers are, this check relies on
pkg-config and skips EAL generic/ and internal/ headers.

The existing headers check (though less accurate) is kept as is,
as it provides a first level of check and may have existing users.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 .ci/linux-build.sh            |  7 ++--
 buildtools/chkincs/Makefile   | 77 +++++++++++++++++++++++++++++++++++
 devtools/test-meson-builds.sh |  6 ++-
 3 files changed, 85 insertions(+), 5 deletions(-)
 create mode 100644 buildtools/chkincs/Makefile

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index fdb5787621..3146d9ccd8 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -95,8 +95,6 @@ OPTS="$OPTS -Ddefault_library=$DEF_LIB"
 OPTS="$OPTS -Dbuildtype=$buildtype"
 if [ "$STDATOMIC" = "true" ]; then
 	OPTS="$OPTS -Denable_stdatomic=true"
-else
-	OPTS="$OPTS -Dcheck_includes=true"
 fi
 if [ "$MINI" = "true" ]; then
     OPTS="$OPTS -Denable_drivers=net/null"
@@ -176,13 +174,16 @@ if [ "$RUN_TESTS" = "true" ]; then
     [ "$failed" != "true" ]
 fi
 
-# Test examples compilation with an installed dpdk
+# Test headers and examples compilation with an installed dpdk
 if [ "$BUILD_EXAMPLES" = "true" ]; then
     [ -d install ] || DESTDIR=$(pwd)/install meson install -C build
     export LD_LIBRARY_PATH=$(dirname $(find $(pwd)/install -name librte_eal.so)):$LD_LIBRARY_PATH
     export PATH=$(dirname $(find $(pwd)/install -name dpdk-devbind.py)):$PATH
     export PKG_CONFIG_PATH=$(dirname $(find $(pwd)/install -name libdpdk.pc)):$PKG_CONFIG_PATH
     export PKGCONF="pkg-config --define-prefix"
+
+    make -C buildtools/chkincs O=build/buildtools/chkincs
+
     find build/examples -maxdepth 1 -type f -name "dpdk-*" |
     while read target; do
         target=${target%%:*}
diff --git a/buildtools/chkincs/Makefile b/buildtools/chkincs/Makefile
new file mode 100644
index 0000000000..838819c617
--- /dev/null
+++ b/buildtools/chkincs/Makefile
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2024 Red Hat, Inc.
+
+ifeq ($(V),)
+Q ?= @
+else
+Q =
+endif
+
+O ?= build
+
+PKGCONF ?= pkg-config
+
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
+$(error "no installation of DPDK found")
+endif
+
+ifeq ($(I),)
+
+.PHONY: headers_list
+.ONESHELL:
+headers_list:
+	$(Q)for dir in $$($(PKGCONF) --cflags-only-I libdpdk); do
+		dir=$${dir##-I}
+		[ -e $$dir/rte_build_config.h ] || continue
+		$(MAKE) I="$$dir" O="$(O)"
+		break
+	done
+else
+
+HEADERS := $(shell find $(I) -name "*.h" | grep -vE $(I)'/(generic|internal)/')
+SRCS := $(patsubst $(I)/%.h, $(O)/%.c, $(HEADERS))
+.PRECIOUS: $(SRCS)
+
+PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
+CFLAGS = $(shell $(PKGCONF) --cflags libdpdk) -Wall -Wextra -Werror
+LDFLAGS = $(shell $(PKGCONF) --libs libdpdk)
+
+OBJS := $(patsubst $(I)/%.h, $(O)/%.o, $(HEADERS))
+OBJS_EXP := $(patsubst $(I)/%.h, $(O)/%+exp.o, $(HEADERS))
+OBJS_ALL := $(patsubst $(I)/%.h, $(O)/%+all.o, $(HEADERS))
+
+all: $(OBJS) $(OBJS_EXP) $(OBJS_ALL)
+
+$(O):
+	$(Q)mkdir -p $@
+
+$(O)/%.c: $(I)/%.h $(O) gen_c_file_for_header.py Makefile
+	$(Q)python3 gen_c_file_for_header.py $< $@
+
+$(O)/%.o: $(O)/%.c Makefile $(PC_FILE)
+	$(Q)$(CC) $(CFLAGS) -o $@ -c $<
+
+$(O)/%+exp.o: $(O)/%.c Makefile $(PC_FILE)
+	$(Q)$(CC) $(CFLAGS) -DALLOW_EXPERIMENTAL_API -o $@ -c $<
+
+$(O)/%+all.o: $(O)/%.c Makefile $(PC_FILE)
+	$(Q)$(CC) $(CFLAGS) -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API -o $@ -c $<
+
+CXXFLAGS = $(shell $(PKGCONF) --cflags libdpdk) -Wall -Wextra -Werror
+
+OBJS_CPP := $(patsubst $(I)/%.h, $(O)/%.cpp.o, $(HEADERS))
+OBJS_CPP_EXP := $(patsubst $(I)/%.h, $(O)/%.cpp+exp.o, $(HEADERS))
+OBJS_CPP_ALL := $(patsubst $(I)/%.h, $(O)/%.cpp+all.o, $(HEADERS))
+
+all: $(OBJS_CPP) $(OBJS_CPP_EXP) $(OBJS_CPP_ALL)
+
+$(O)/%.cpp.o: $(O)/%.c Makefile $(PC_FILE)
+	$(Q)$(CXX) $(CXXFLAGS) -o $@ -c $<
+
+$(O)/%.cpp+exp.o: $(O)/%.c Makefile $(PC_FILE)
+	$(Q)$(CXX) $(CXXFLAGS) -DALLOW_EXPERIMENTAL_API -o $@ -c $<
+
+$(O)/%.cpp+all.o: $(O)/%.c Makefile $(PC_FILE)
+	$(Q)$(CXX) $(CXXFLAGS) -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API -o $@ -c $<
+
+endif
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 4fff1f7177..c3cebead70 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -248,7 +248,7 @@ generic_isa='nehalem'
 if ! check_cc_flags "-march=$generic_isa" ; then
 	generic_isa='corei7'
 fi
-build build-x86-generic cc skipABI -Dcheck_includes=true \
+build build-x86-generic cc skipABI \
 	-Dlibdir=lib -Dcpu_instruction_set=$generic_isa $use_shared
 
 # 32-bit with default compiler
@@ -318,9 +318,11 @@ if [ "$examples" = 'all' ]; then
 	done | sort -u |
 	tr '\n' ' ')
 fi
-# if pkg-config defines the necessary flags, test building some examples
+# if pkg-config defines the necessary flags, check headers and test building some examples
 if pkg-config --define-prefix libdpdk >/dev/null 2>&1; then
 	export PKGCONF="pkg-config --define-prefix"
+	echo "## Checking exported headers"
+	$MAKE -C buildtools/chkincs O=$build_path/buildtools/chkincs -j
 	for example in $examples; do
 		echo "## Building $example"
 		[ $example = helloworld ] && static=static || static= # save disk space
-- 
2.47.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [RFC 5/6] build: install indirect headers to a dedicated directory
  2024-11-27 11:26 ` [RFC 5/6] build: install indirect headers to a dedicated directory David Marchand
@ 2024-11-27 11:42   ` Bruce Richardson
  2024-12-10 13:36     ` David Marchand
  0 siblings, 1 reply; 75+ messages in thread
From: Bruce Richardson @ 2024-11-27 11:42 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, thomas, Konstantin Ananyev

On Wed, Nov 27, 2024 at 12:26:15PM +0100, David Marchand wrote:
> The headers check currently skips "indirect" headers as instrusted via
> the indirect_headers meson variable.
> 
> This headers check has some limitation that will be addressed in a next
> change by inspected all exported headers.
> However, exported headers lack the information about "indirect" quality.
> 
> Separate "indirect" headers by exporting them in a internal/ sub directory.
> This also makes it more obvious which headers are not to be directly used
> by an application.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  buildtools/pkg-config/meson.build | 8 +++++++-
>  lib/eal/x86/include/meson.build   | 3 ++-
>  lib/meson.build                   | 2 +-
>  3 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/buildtools/pkg-config/meson.build b/buildtools/pkg-config/meson.build
> index b36add17e3..809706fe3e 100644
> --- a/buildtools/pkg-config/meson.build
> +++ b/buildtools/pkg-config/meson.build
> @@ -27,12 +27,18 @@ endif
>  # are skipped in the case of static linkage thanks to the flag --as-needed.
>  
>  
> +subdirs = [ '.', 'internal' ]
> +if get_option('include_subdir_arch') != ''
> +    subdirs = [ subdirs, get_option('include_subdir_arch') ]
> +    subdirs = [ subdirs, join_paths(get_option('include_subdir_arch'), 'internal')]

minor nit, I tend to prefer using "+=" rather than relying on flattening to
extend the arrays.


> +endif
> +
>  pkg.generate(name: 'dpdk-libs',
>          filebase: 'libdpdk-libs',
>          description: '''Internal-only DPDK pkgconfig file. Not for direct use.
>  Use libdpdk.pc instead of this file to query DPDK compile/link arguments''',
>          version: meson.project_version(),
> -        subdirs: [get_option('include_subdir_arch'), '.'],
> +        subdirs: subdirs,
>          extra_cflags: pkg_extra_cflags,
>          libraries: ['-Wl,--as-needed'] + dpdk_libraries,
>          libraries_private: dpdk_extra_ldflags)
> diff --git a/lib/eal/x86/include/meson.build b/lib/eal/x86/include/meson.build
> index 52d2f8e969..a100330208 100644
> --- a/lib/eal/x86/include/meson.build
> +++ b/lib/eal/x86/include/meson.build
> @@ -22,5 +22,6 @@ arch_indirect_headers = files(
>          'rte_byteorder_32.h',
>          'rte_byteorder_64.h',
>  )
> -install_headers(arch_headers + arch_indirect_headers, subdir: get_option('include_subdir_arch'))
> +install_headers(arch_headers, subdir: get_option('include_subdir_arch'))
> +install_headers(arch_indirect_headers, subdir: join_paths(get_option('include_subdir_arch'), 'internal'))
>  dpdk_chkinc_headers += arch_headers
> diff --git a/lib/meson.build b/lib/meson.build
> index ce92cb5537..78ada7782e 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -202,7 +202,7 @@ foreach l:libraries
>      dpdk_libs_enabled += name
>      dpdk_conf.set('RTE_LIB_' + name.to_upper(), 1)
>      install_headers(headers)
> -    install_headers(indirect_headers)
> +    install_headers(indirect_headers, subdir: 'internal')
>      if get_option('enable_driver_sdk')
>          install_headers(driver_sdk_headers)
>      endif
> -- 
> 2.47.0
> 

^ permalink raw reply	[flat|nested] 75+ messages in thread

* RE: [EXTERNAL] [RFC 3/6] eventdev: do not include driver header in DMA adapter
  2024-11-27 11:26 ` [RFC 3/6] eventdev: do not include driver header in DMA adapter David Marchand
@ 2024-11-27 13:49   ` Amit Prakash Shukla
  0 siblings, 0 replies; 75+ messages in thread
From: Amit Prakash Shukla @ 2024-11-27 13:49 UTC (permalink / raw)
  To: David Marchand, dev; +Cc: thomas, bruce.richardson, Jerin Jacob

> Subject: [EXTERNAL] [RFC 3/6] eventdev: do not include driver header in DMA
> adapter
> 
> The dma adapter header does not require including rte_dmadev_pmd. h
> which is a driver header. Fixes: 66a30a29387a ("eventdev/dma: introduce
> DMA adapter") Signed-off-by: David Marchand
> <david. marchand@ redhat. com> --- lib/eventdev/rte_event_dma_adapter. h
> The dma adapter header does not require including rte_dmadev_pmd.h
> which is a driver header.
> 
> Fixes: 66a30a29387a ("eventdev/dma: introduce DMA adapter")
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  lib/eventdev/rte_event_dma_adapter.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Acked-by: Amit Prakash Shukla <amitprakashs@marvell.com>

Thanks

> diff --git a/lib/eventdev/rte_event_dma_adapter.h
> b/lib/eventdev/rte_event_dma_adapter.h
> index 5c480b82ff..34142f26db 100644
> --- a/lib/eventdev/rte_event_dma_adapter.h
> +++ b/lib/eventdev/rte_event_dma_adapter.h
> @@ -144,7 +144,7 @@
>  #include <stdint.h>
> 
>  #include <rte_common.h>
> -#include <rte_dmadev_pmd.h>
> +#include <rte_dmadev.h>
>  #include <rte_eventdev.h>
> 
>  #ifdef __cplusplus
> --
> 2.47.0

^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [RFC 5/6] build: install indirect headers to a dedicated directory
  2024-11-27 11:42   ` Bruce Richardson
@ 2024-12-10 13:36     ` David Marchand
  0 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2024-12-10 13:36 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, thomas, Konstantin Ananyev

On Wed, Nov 27, 2024 at 12:43 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
> > diff --git a/buildtools/pkg-config/meson.build b/buildtools/pkg-config/meson.build
> > index b36add17e3..809706fe3e 100644
> > --- a/buildtools/pkg-config/meson.build
> > +++ b/buildtools/pkg-config/meson.build
> > @@ -27,12 +27,18 @@ endif
> >  # are skipped in the case of static linkage thanks to the flag --as-needed.
> >
> >
> > +subdirs = [ '.', 'internal' ]
> > +if get_option('include_subdir_arch') != ''
> > +    subdirs = [ subdirs, get_option('include_subdir_arch') ]
> > +    subdirs = [ subdirs, join_paths(get_option('include_subdir_arch'), 'internal')]
>
> minor nit, I tend to prefer using "+=" rather than relying on flattening to
> extend the arrays.

Hum, yes, I also prefer +=.
I think I mixed this with a different warning I hit when playing with
other meson objects...

I'll update in next revision.


--
David Marchand


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v2 0/6] Add a stricter headers check
  2024-11-27 11:26 [RFC 0/6] Add a stricter headers check David Marchand
                   ` (5 preceding siblings ...)
  2024-11-27 11:26 ` [RFC 6/6] buildtools: externally check exported headers David Marchand
@ 2024-12-13 10:50 ` David Marchand
  2024-12-13 10:50   ` [PATCH v2 1/6] baseband/acc: fix exported header David Marchand
                     ` (6 more replies)
  2025-09-24 17:25 ` [PATCH v3 0/7] " David Marchand
                   ` (2 subsequent siblings)
  9 siblings, 7 replies; 75+ messages in thread
From: David Marchand @ 2024-12-13 10:50 UTC (permalink / raw)
  To: dev; +Cc: thomas, bruce.richardson

As explained in patch 6, the current headers check can not catch
issues when a public header includes an internal header.
Fixing this from meson does not seem an easy task.

This series approach is to reimplement the check in a Makefile invoked
out of DPDK (like what is done for external compilation of examples).
This has the advantage of being simple, and avoiding any (non intentional)
implicit include path coming from the meson framework.

As there was no easy way to distinguish "indirect" headers in an
installed DPDK, I chose to move those headers in a new sub directory
(patch 5).

Patch 1-4 fixes have not been marked as backport material as those bugs
seems minor/easy to fix externally (by either including missing headers,
or enabling enable_driver_sdk option).

For now, I left the check_includes= option untouched, as there may be
users of this check and this check still catches issues without
requiring to install DPDK.


-- 
David Marchand

David Marchand (6):
  baseband/acc: fix exported header
  drivers: drop export of driver headers
  eventdev: do not include driver header in DMA adapter
  drivers: fix exported headers
  build: install indirect headers to a dedicated directory
  buildtools: externally check exported headers

 .ci/linux-build.sh                            |  7 +-
 buildtools/chkincs/Makefile                   | 77 +++++++++++++++++++
 buildtools/pkg-config/meson.build             |  8 +-
 devtools/test-meson-builds.sh                 |  6 +-
 drivers/baseband/acc/meson.build              |  2 +-
 drivers/bus/vmbus/rte_vmbus_reg.h             |  6 ++
 drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h     |  4 +
 drivers/net/dpaa/rte_pmd_dpaa.h               |  2 +
 drivers/net/iavf/rte_pmd_iavf.h               |  6 ++
 drivers/net/mlx5/rte_pmd_mlx5.h               |  3 +
 drivers/raw/cnxk_bphy/rte_pmd_bphy.h          | 16 ++++
 drivers/raw/cnxk_gpio/rte_pmd_cnxk_gpio.h     |  3 +
 drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h |  2 +
 drivers/raw/ntb/rte_pmd_ntb.h                 |  2 +
 lib/bbdev/meson.build                         |  5 +-
 lib/eal/x86/include/meson.build               |  3 +-
 lib/ethdev/meson.build                        |  6 +-
 lib/eventdev/rte_event_dma_adapter.h          |  2 +-
 lib/meson.build                               |  2 +-
 lib/mldev/meson.build                         |  5 +-
 lib/rawdev/meson.build                        |  3 +-
 lib/regexdev/meson.build                      |  3 +-
 lib/security/meson.build                      |  3 +-
 23 files changed, 153 insertions(+), 23 deletions(-)
 create mode 100644 buildtools/chkincs/Makefile

-- 
2.47.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v2 1/6] baseband/acc: fix exported header
  2024-12-13 10:50 ` [PATCH v2 0/6] Add a stricter headers check David Marchand
@ 2024-12-13 10:50   ` David Marchand
  2024-12-13 11:01     ` Bruce Richardson
  2024-12-13 10:50   ` [PATCH v2 2/6] drivers: drop export of driver headers David Marchand
                     ` (5 subsequent siblings)
  6 siblings, 1 reply; 75+ messages in thread
From: David Marchand @ 2024-12-13 10:50 UTC (permalink / raw)
  To: dev; +Cc: thomas, bruce.richardson, Nicolas Chautru, Maxime Coquelin

rte_acc_cfg.h relies on rte_acc_common_cfg.h.

Fixes: 32e8b7ea35dd ("baseband/acc100: refactor to segregate common code")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/baseband/acc/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/baseband/acc/meson.build b/drivers/baseband/acc/meson.build
index 64fcf1537a..d9fb947eaa 100644
--- a/drivers/baseband/acc/meson.build
+++ b/drivers/baseband/acc/meson.build
@@ -26,4 +26,4 @@ deps += ['bus_pci']
 
 sources = files('acc_common.c', 'rte_acc100_pmd.c', 'rte_vrb_pmd.c')
 
-headers = files('rte_acc_cfg.h')
+headers = files('rte_acc_cfg.h', 'rte_acc_common_cfg.h')
-- 
2.47.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v2 2/6] drivers: drop export of driver headers
  2024-12-13 10:50 ` [PATCH v2 0/6] Add a stricter headers check David Marchand
  2024-12-13 10:50   ` [PATCH v2 1/6] baseband/acc: fix exported header David Marchand
@ 2024-12-13 10:50   ` David Marchand
  2024-12-13 11:03     ` Bruce Richardson
  2024-12-13 10:50   ` [PATCH v2 3/6] eventdev: do not include driver header in DMA adapter David Marchand
                     ` (4 subsequent siblings)
  6 siblings, 1 reply; 75+ messages in thread
From: David Marchand @ 2024-12-13 10:50 UTC (permalink / raw)
  To: dev
  Cc: thomas, bruce.richardson, Nicolas Chautru, Ferruh Yigit,
	Andrew Rybchenko, Srikanth Yalavarthi, Sachin Saxena,
	Hemant Agrawal, Ori Kam, Akhil Goyal, Anoob Joseph

Many classes are exposing driver only headers as public headers.
Move them to the driver_sdk_headers list.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/bbdev/meson.build    | 5 ++---
 lib/ethdev/meson.build   | 6 +++---
 lib/mldev/meson.build    | 5 +----
 lib/rawdev/meson.build   | 3 ++-
 lib/regexdev/meson.build | 3 ++-
 lib/security/meson.build | 3 ++-
 6 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/lib/bbdev/meson.build b/lib/bbdev/meson.build
index 07685e7578..7d035065f1 100644
--- a/lib/bbdev/meson.build
+++ b/lib/bbdev/meson.build
@@ -8,7 +8,6 @@ if is_windows
 endif
 
 sources = files('rte_bbdev.c')
-headers = files('rte_bbdev.h',
-        'rte_bbdev_pmd.h',
-        'rte_bbdev_op.h')
+headers = files('rte_bbdev.h', 'rte_bbdev_op.h')
+driver_sdk_headers = files('rte_bbdev_pmd.h')
 deps += ['mbuf']
diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build
index f1d2586591..8ba6c708a2 100644
--- a/lib/ethdev/meson.build
+++ b/lib/ethdev/meson.build
@@ -26,11 +26,8 @@ headers = files(
         'rte_ethdev_trace_fp.h',
         'rte_dev_info.h',
         'rte_flow.h',
-        'rte_flow_driver.h',
         'rte_mtr.h',
-        'rte_mtr_driver.h',
         'rte_tm.h',
-        'rte_tm_driver.h',
 )
 
 indirect_headers += files(
@@ -42,6 +39,9 @@ driver_sdk_headers += files(
         'ethdev_driver.h',
         'ethdev_pci.h',
         'ethdev_vdev.h',
+        'rte_flow_driver.h',
+        'rte_mtr_driver.h',
+        'rte_tm_driver.h',
 )
 
 if is_linux
diff --git a/lib/mldev/meson.build b/lib/mldev/meson.build
index 2c933baad6..efc3edd288 100644
--- a/lib/mldev/meson.build
+++ b/lib/mldev/meson.build
@@ -32,11 +32,8 @@ headers = files(
         'rte_mldev.h',
 )
 
-indirect_headers += files(
-        'rte_mldev_core.h',
-)
-
 driver_sdk_headers += files(
+        'rte_mldev_core.h',
         'rte_mldev_pmd.h',
         'mldev_utils.h',
 )
diff --git a/lib/rawdev/meson.build b/lib/rawdev/meson.build
index 7dfc3d5cf9..ccfd922fda 100644
--- a/lib/rawdev/meson.build
+++ b/lib/rawdev/meson.build
@@ -8,6 +8,7 @@ if is_windows
 endif
 
 sources = files('rte_rawdev.c')
-headers = files('rte_rawdev.h', 'rte_rawdev_pmd.h')
+headers = files('rte_rawdev.h')
+driver_sdk_headers = files('rte_rawdev_pmd.h')
 
 deps += ['telemetry']
diff --git a/lib/regexdev/meson.build b/lib/regexdev/meson.build
index 426e764ece..05040051c5 100644
--- a/lib/regexdev/meson.build
+++ b/lib/regexdev/meson.build
@@ -8,6 +8,7 @@ if is_windows
 endif
 
 sources = files('rte_regexdev.c')
-headers = files('rte_regexdev.h', 'rte_regexdev_driver.h')
+headers = files('rte_regexdev.h')
 indirect_headers += files('rte_regexdev_core.h')
+driver_sdk_headers = files('rte_regexdev_driver.h')
 deps += ['mbuf']
diff --git a/lib/security/meson.build b/lib/security/meson.build
index 1034a7a299..d5431d472c 100644
--- a/lib/security/meson.build
+++ b/lib/security/meson.build
@@ -2,5 +2,6 @@
 # Copyright(c) 2017-2019 Intel Corporation
 
 sources = files('rte_security.c')
-headers = files('rte_security.h', 'rte_security_driver.h')
+headers = files('rte_security.h')
+driver_sdk_headers = files('rte_security_driver.h')
 deps += ['mempool', 'cryptodev', 'net']
-- 
2.47.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v2 3/6] eventdev: do not include driver header in DMA adapter
  2024-12-13 10:50 ` [PATCH v2 0/6] Add a stricter headers check David Marchand
  2024-12-13 10:50   ` [PATCH v2 1/6] baseband/acc: fix exported header David Marchand
  2024-12-13 10:50   ` [PATCH v2 2/6] drivers: drop export of driver headers David Marchand
@ 2024-12-13 10:50   ` David Marchand
  2024-12-13 11:04     ` Bruce Richardson
  2024-12-13 10:50   ` [PATCH v2 4/6] drivers: fix exported headers David Marchand
                     ` (3 subsequent siblings)
  6 siblings, 1 reply; 75+ messages in thread
From: David Marchand @ 2024-12-13 10:50 UTC (permalink / raw)
  To: dev; +Cc: thomas, bruce.richardson, Amit Prakash Shukla, Jerin Jacob

The dma adapter header does not require including rte_dmadev_pmd.h which
is a driver header.

Fixes: 66a30a29387a ("eventdev/dma: introduce DMA adapter")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Amit Prakash Shukla <amitprakashs@marvell.com>
---
 lib/eventdev/rte_event_dma_adapter.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eventdev/rte_event_dma_adapter.h b/lib/eventdev/rte_event_dma_adapter.h
index 5c480b82ff..34142f26db 100644
--- a/lib/eventdev/rte_event_dma_adapter.h
+++ b/lib/eventdev/rte_event_dma_adapter.h
@@ -144,7 +144,7 @@
 #include <stdint.h>
 
 #include <rte_common.h>
-#include <rte_dmadev_pmd.h>
+#include <rte_dmadev.h>
 #include <rte_eventdev.h>
 
 #ifdef __cplusplus
-- 
2.47.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v2 4/6] drivers: fix exported headers
  2024-12-13 10:50 ` [PATCH v2 0/6] Add a stricter headers check David Marchand
                     ` (2 preceding siblings ...)
  2024-12-13 10:50   ` [PATCH v2 3/6] eventdev: do not include driver header in DMA adapter David Marchand
@ 2024-12-13 10:50   ` David Marchand
  2024-12-13 11:14     ` Bruce Richardson
  2024-12-13 17:10     ` Stephen Hemminger
  2024-12-13 10:50   ` [PATCH v2 5/6] build: install indirect headers to a dedicated directory David Marchand
                     ` (2 subsequent siblings)
  6 siblings, 2 replies; 75+ messages in thread
From: David Marchand @ 2024-12-13 10:50 UTC (permalink / raw)
  To: dev
  Cc: thomas, bruce.richardson, Long Li, Wei Hu, Ankur Dwivedi,
	Anoob Joseph, Tejasree Kondoj, Hemant Agrawal, Sachin Saxena,
	Vladimir Medvedkin, Ian Stokes, Dariusz Sosnowski,
	Viacheslav Ovsiienko, Bing Zhao, Ori Kam, Suanming Mou,
	Matan Azrad, Jakub Palider, Tomasz Duszynski, Gagandeep Singh,
	Jingjing Wu, Stephen Hemminger, Akhil Goyal, Haiyue Wang,
	Jeff Guo, Michael Baum, Jerin Jacob, Shreyansh Jain, Nipun Gupta,
	Xiaoyun Li

Those headers could not be included individually as they were not
including their dependencies, or were subject to some build warnings.

Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
Fixes: 5b2a1a02dcaf ("crypto/cnxk: fix experimental version for PMD API")
Fixes: e5abbeeeefa5 ("crypto/cnxk: add PMD API for getting CPTR")
Fixes: 3ca607402c4d ("crypto/cnxk: add PMD API to flush CTX")
Fixes: 8c3495f5d2dd ("net/dpaa: support loopback API")
Fixes: 12b435bf8f2f ("net/iavf: support flex desc metadata extraction")
Fixes: 23f627e0ed28 ("net/mlx5: add flow sync API")
Fixes: f5177bdc8b76 ("net/mlx5: add GENEVE TLV options parser API")
Fixes: 7cf197684589 ("raw/cnxk_bphy: support interrupt init and cleanup")
Fixes: 633dae698070 ("raw/cnxk_gpio: add standard GPIO operations")
Fixes: 53c71586c789 ("raw/dpaa2_cmdif: support enqueue/dequeue operations")
Fixes: c39d1e082a4b ("raw/ntb: setup queues")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/bus/vmbus/rte_vmbus_reg.h             |  6 ++++++
 drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h     |  4 ++++
 drivers/net/dpaa/rte_pmd_dpaa.h               |  2 ++
 drivers/net/iavf/rte_pmd_iavf.h               |  6 ++++++
 drivers/net/mlx5/rte_pmd_mlx5.h               |  3 +++
 drivers/raw/cnxk_bphy/rte_pmd_bphy.h          | 16 ++++++++++++++++
 drivers/raw/cnxk_gpio/rte_pmd_cnxk_gpio.h     |  3 +++
 drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h |  2 ++
 drivers/raw/ntb/rte_pmd_ntb.h                 |  2 ++
 9 files changed, 44 insertions(+)

diff --git a/drivers/bus/vmbus/rte_vmbus_reg.h b/drivers/bus/vmbus/rte_vmbus_reg.h
index e3299aa871..95c8eb29b4 100644
--- a/drivers/bus/vmbus/rte_vmbus_reg.h
+++ b/drivers/bus/vmbus/rte_vmbus_reg.h
@@ -6,6 +6,12 @@
 #ifndef _VMBUS_REG_H_
 #define _VMBUS_REG_H_
 
+#include <stdint.h>
+
+#include <rte_common.h>
+#include <rte_stdatomic.h>
+#include <rte_uuid.h>
+
 /*
  * Hyper-V SynIC message format.
  */
diff --git a/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h b/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
index 02278605a2..2bb0ff9e95 100644
--- a/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
+++ b/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
@@ -11,8 +11,12 @@
 #ifndef _PMD_CNXK_CRYPTO_H_
 #define _PMD_CNXK_CRYPTO_H_
 
+#include <stdbool.h>
 #include <stdint.h>
 
+#include <rte_compat.h>
+#include <rte_crypto.h>
+
 /* Forward declarations */
 
 /**
diff --git a/drivers/net/dpaa/rte_pmd_dpaa.h b/drivers/net/dpaa/rte_pmd_dpaa.h
index ec45633ba2..0a57e2097a 100644
--- a/drivers/net/dpaa/rte_pmd_dpaa.h
+++ b/drivers/net/dpaa/rte_pmd_dpaa.h
@@ -5,6 +5,8 @@
 #ifndef _PMD_DPAA_H_
 #define _PMD_DPAA_H_
 
+#include <stdint.h>
+
 /**
  * @file rte_pmd_dpaa.h
  *
diff --git a/drivers/net/iavf/rte_pmd_iavf.h b/drivers/net/iavf/rte_pmd_iavf.h
index 56d453fc4c..04b86a5dd7 100644
--- a/drivers/net/iavf/rte_pmd_iavf.h
+++ b/drivers/net/iavf/rte_pmd_iavf.h
@@ -15,6 +15,7 @@
  */
 
 #include <stdio.h>
+
 #include <rte_compat.h>
 #include <rte_mbuf.h>
 #include <rte_mbuf_dyn.h>
@@ -184,6 +185,7 @@ __rte_experimental
 static inline void
 rte_pmd_ifd_dump_proto_xtr_metadata(struct rte_mbuf *m)
 {
+#ifdef ALLOW_EXPERIMENTAL_API
 	union rte_pmd_ifd_proto_xtr_metadata data;
 
 	if (!rte_pmd_ifd_dynf_proto_xtr_metadata_avail())
@@ -243,6 +245,10 @@ rte_pmd_ifd_dump_proto_xtr_metadata(struct rte_mbuf *m)
 	else if (m->ol_flags & RTE_IAVF_PKT_RX_DYNF_PROTO_XTR_IP_OFFSET)
 		printf(" - Flexible descriptor's Extraction: ip_offset=%u",
 		       data.ip_ofs);
+#else
+	RTE_SET_USED(m);
+	RTE_VERIFY(false);
+#endif
 }
 
 #ifdef __cplusplus
diff --git a/drivers/net/mlx5/rte_pmd_mlx5.h b/drivers/net/mlx5/rte_pmd_mlx5.h
index fdd2f65888..f2c6aebe0b 100644
--- a/drivers/net/mlx5/rte_pmd_mlx5.h
+++ b/drivers/net/mlx5/rte_pmd_mlx5.h
@@ -5,6 +5,9 @@
 #ifndef RTE_PMD_PRIVATE_MLX5_H_
 #define RTE_PMD_PRIVATE_MLX5_H_
 
+#include <stdint.h>
+
+#include <rte_byteorder.h>
 #include <rte_compat.h>
 
 /**
diff --git a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
index f668e6ea82..c200c935ff 100644
--- a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
+++ b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
@@ -391,6 +391,7 @@ rte_pmd_bphy_intr_init(uint16_t dev_id)
 {
 	struct cnxk_bphy_irq_msg msg = {
 		.type = CNXK_BPHY_IRQ_MSG_TYPE_INIT,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, CNXK_BPHY_DEF_QUEUE, &msg,
@@ -411,6 +412,7 @@ rte_pmd_bphy_intr_fini(uint16_t dev_id)
 {
 	struct cnxk_bphy_irq_msg msg = {
 		.type = CNXK_BPHY_IRQ_MSG_TYPE_FINI,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, CNXK_BPHY_DEF_QUEUE, &msg,
@@ -470,6 +472,9 @@ rte_pmd_bphy_intr_unregister(uint16_t dev_id, int irq_num)
 {
 	struct cnxk_bphy_irq_info info = {
 		.irq_num = irq_num,
+		.handler = NULL,
+		.data = NULL,
+		.cpu = -1,
 	};
 	struct cnxk_bphy_irq_msg msg = {
 		.type = CNXK_BPHY_IRQ_MSG_TYPE_UNREGISTER,
@@ -496,6 +501,7 @@ rte_pmd_bphy_intr_mem_get(uint16_t dev_id, struct cnxk_bphy_mem *mem)
 {
 	struct cnxk_bphy_irq_msg msg = {
 		.type = CNXK_BPHY_IRQ_MSG_TYPE_MEM_GET,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, CNXK_BPHY_DEF_QUEUE, &msg,
@@ -518,6 +524,7 @@ rte_pmd_bphy_npa_pf_func_get(uint16_t dev_id, uint16_t *pf_func)
 {
 	struct cnxk_bphy_irq_msg msg = {
 		.type = CNXK_BPHY_MSG_TYPE_NPA_PF_FUNC,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, CNXK_BPHY_DEF_QUEUE, &msg,
@@ -540,6 +547,7 @@ rte_pmd_bphy_sso_pf_func_get(uint16_t dev_id, uint16_t *pf_func)
 {
 	struct cnxk_bphy_irq_msg msg = {
 		.type = CNXK_BPHY_MSG_TYPE_SSO_PF_FUNC,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, CNXK_BPHY_DEF_QUEUE, &msg,
@@ -565,6 +573,7 @@ rte_pmd_bphy_cgx_get_link_info(uint16_t dev_id, uint16_t lmac,
 {
 	struct cnxk_bphy_cgx_msg msg = {
 		.type = CNXK_BPHY_CGX_MSG_TYPE_GET_LINKINFO,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, info, sizeof(*info));
@@ -586,6 +595,7 @@ rte_pmd_bphy_cgx_intlbk_disable(uint16_t dev_id, uint16_t lmac)
 {
 	struct cnxk_bphy_cgx_msg msg = {
 		.type = CNXK_BPHY_CGX_MSG_TYPE_INTLBK_DISABLE,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);
@@ -607,6 +617,7 @@ rte_pmd_bphy_cgx_intlbk_enable(uint16_t dev_id, uint16_t lmac)
 {
 	struct cnxk_bphy_cgx_msg msg = {
 		.type = CNXK_BPHY_CGX_MSG_TYPE_INTLBK_ENABLE,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);
@@ -628,6 +639,7 @@ rte_pmd_bphy_cgx_ptp_rx_disable(uint16_t dev_id, uint16_t lmac)
 {
 	struct cnxk_bphy_cgx_msg msg = {
 		.type = CNXK_BPHY_CGX_MSG_TYPE_PTP_RX_DISABLE,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);
@@ -649,6 +661,7 @@ rte_pmd_bphy_cgx_ptp_rx_enable(uint16_t dev_id, uint16_t lmac)
 {
 	struct cnxk_bphy_cgx_msg msg = {
 		.type = CNXK_BPHY_CGX_MSG_TYPE_PTP_RX_ENABLE,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);
@@ -720,6 +733,7 @@ rte_pmd_bphy_cgx_start_rxtx(uint16_t dev_id, uint16_t lmac)
 {
 	struct cnxk_bphy_cgx_msg msg = {
 		.type = CNXK_BPHY_CGX_MSG_TYPE_START_RXTX,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);
@@ -741,6 +755,7 @@ rte_pmd_bphy_cgx_stop_rxtx(uint16_t dev_id, uint16_t lmac)
 {
 	struct cnxk_bphy_cgx_msg msg = {
 		.type = CNXK_BPHY_CGX_MSG_TYPE_STOP_RXTX,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);
@@ -765,6 +780,7 @@ rte_pmd_bphy_cgx_get_supported_fec(uint16_t dev_id, uint16_t lmac,
 {
 	struct cnxk_bphy_cgx_msg msg = {
 		.type = CNXK_BPHY_CGX_MSG_TYPE_GET_SUPPORTED_FEC,
+		.data = NULL,
 	};
 
 	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, fec, sizeof(*fec));
diff --git a/drivers/raw/cnxk_gpio/rte_pmd_cnxk_gpio.h b/drivers/raw/cnxk_gpio/rte_pmd_cnxk_gpio.h
index 80a37be9c7..72d138ab1d 100644
--- a/drivers/raw/cnxk_gpio/rte_pmd_cnxk_gpio.h
+++ b/drivers/raw/cnxk_gpio/rte_pmd_cnxk_gpio.h
@@ -261,6 +261,7 @@ rte_pmd_gpio_get_pin_value(uint16_t dev_id, int gpio, int *val)
 {
 	struct cnxk_gpio_msg msg = {
 		.type = CNXK_GPIO_MSG_TYPE_GET_PIN_VALUE,
+		.data = NULL,
 	};
 
 	return __rte_pmd_gpio_enq_deq(dev_id, gpio, &msg, val, sizeof(*val));
@@ -285,6 +286,7 @@ rte_pmd_gpio_get_pin_edge(uint16_t dev_id, int gpio,
 {
 	struct cnxk_gpio_msg msg = {
 		.type = CNXK_GPIO_MSG_TYPE_GET_PIN_EDGE,
+		.data = NULL,
 	};
 
 	return __rte_pmd_gpio_enq_deq(dev_id, gpio, &msg, edge, sizeof(*edge));
@@ -308,6 +310,7 @@ rte_pmd_gpio_get_pin_dir(uint16_t dev_id, int gpio, enum cnxk_gpio_pin_dir *dir)
 {
 	struct cnxk_gpio_msg msg = {
 		.type = CNXK_GPIO_MSG_TYPE_GET_PIN_DIR,
+		.data = NULL,
 	};
 
 	return __rte_pmd_gpio_enq_deq(dev_id, gpio, &msg, dir, sizeof(*dir));
diff --git a/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h b/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h
index 483b66eaae..7731fc6363 100644
--- a/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h
+++ b/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h
@@ -12,6 +12,8 @@
  *
  */
 
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/drivers/raw/ntb/rte_pmd_ntb.h b/drivers/raw/ntb/rte_pmd_ntb.h
index 6591ce7931..76da3be026 100644
--- a/drivers/raw/ntb/rte_pmd_ntb.h
+++ b/drivers/raw/ntb/rte_pmd_ntb.h
@@ -5,6 +5,8 @@
 #ifndef _RTE_PMD_NTB_H_
 #define _RTE_PMD_NTB_H_
 
+#include <stdint.h>
+
 /* App needs to set/get these attrs */
 #define NTB_QUEUE_SZ_NAME           "queue_size"
 #define NTB_QUEUE_NUM_NAME          "queue_num"
-- 
2.47.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v2 5/6] build: install indirect headers to a dedicated directory
  2024-12-13 10:50 ` [PATCH v2 0/6] Add a stricter headers check David Marchand
                     ` (3 preceding siblings ...)
  2024-12-13 10:50   ` [PATCH v2 4/6] drivers: fix exported headers David Marchand
@ 2024-12-13 10:50   ` David Marchand
  2024-12-13 10:50   ` [PATCH v2 6/6] buildtools: externally check exported headers David Marchand
  2024-12-13 11:27   ` [PATCH v2 0/6] Add a stricter headers check Bruce Richardson
  6 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2024-12-13 10:50 UTC (permalink / raw)
  To: dev; +Cc: thomas, bruce.richardson, Konstantin Ananyev

The headers check currently skips "indirect" headers as instructed via
the indirect_headers meson variable.

This headers check has some limitation that will be addressed in a next
change by inspected all exported headers.
However, exported headers lack the information about "indirect" quality.

Separate "indirect" headers by exporting them in a internal/ sub directory.
This also makes it more obvious which headers are not to be directly used
by an application.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 buildtools/pkg-config/meson.build | 8 +++++++-
 lib/eal/x86/include/meson.build   | 3 ++-
 lib/meson.build                   | 2 +-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/buildtools/pkg-config/meson.build b/buildtools/pkg-config/meson.build
index b36add17e3..b2afca9eec 100644
--- a/buildtools/pkg-config/meson.build
+++ b/buildtools/pkg-config/meson.build
@@ -27,12 +27,18 @@ endif
 # are skipped in the case of static linkage thanks to the flag --as-needed.
 
 
+subdirs = ['.', 'internal']
+if get_option('include_subdir_arch') != ''
+    subdirs += [get_option('include_subdir_arch')]
+    subdirs += [join_paths(get_option('include_subdir_arch'), 'internal')]
+endif
+
 pkg.generate(name: 'dpdk-libs',
         filebase: 'libdpdk-libs',
         description: '''Internal-only DPDK pkgconfig file. Not for direct use.
 Use libdpdk.pc instead of this file to query DPDK compile/link arguments''',
         version: meson.project_version(),
-        subdirs: [get_option('include_subdir_arch'), '.'],
+        subdirs: subdirs,
         extra_cflags: pkg_extra_cflags,
         libraries: ['-Wl,--as-needed'] + dpdk_libraries,
         libraries_private: dpdk_extra_ldflags)
diff --git a/lib/eal/x86/include/meson.build b/lib/eal/x86/include/meson.build
index 52d2f8e969..a100330208 100644
--- a/lib/eal/x86/include/meson.build
+++ b/lib/eal/x86/include/meson.build
@@ -22,5 +22,6 @@ arch_indirect_headers = files(
         'rte_byteorder_32.h',
         'rte_byteorder_64.h',
 )
-install_headers(arch_headers + arch_indirect_headers, subdir: get_option('include_subdir_arch'))
+install_headers(arch_headers, subdir: get_option('include_subdir_arch'))
+install_headers(arch_indirect_headers, subdir: join_paths(get_option('include_subdir_arch'), 'internal'))
 dpdk_chkinc_headers += arch_headers
diff --git a/lib/meson.build b/lib/meson.build
index ce92cb5537..78ada7782e 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -202,7 +202,7 @@ foreach l:libraries
     dpdk_libs_enabled += name
     dpdk_conf.set('RTE_LIB_' + name.to_upper(), 1)
     install_headers(headers)
-    install_headers(indirect_headers)
+    install_headers(indirect_headers, subdir: 'internal')
     if get_option('enable_driver_sdk')
         install_headers(driver_sdk_headers)
     endif
-- 
2.47.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v2 6/6] buildtools: externally check exported headers
  2024-12-13 10:50 ` [PATCH v2 0/6] Add a stricter headers check David Marchand
                     ` (4 preceding siblings ...)
  2024-12-13 10:50   ` [PATCH v2 5/6] build: install indirect headers to a dedicated directory David Marchand
@ 2024-12-13 10:50   ` David Marchand
  2024-12-13 11:27   ` [PATCH v2 0/6] Add a stricter headers check Bruce Richardson
  6 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2024-12-13 10:50 UTC (permalink / raw)
  To: dev; +Cc: thomas, bruce.richardson, Aaron Conole, Michael Santana

At the moment, the headers check (triggered via the check_includes meson
option) is run "internally", iow with compilation flags and include path
coming from the meson components.

One issue is that both internal and public headers are usually stored
in a single directory in the DPDK components.
If a lib/foo library exports a header rte_foo.h (iow rte_foo.h is part
of the headers list in lib/foo/meson.build) and this rte_foo.h includes
an internal header foo_internal.h, then the headers check won't detect
such an issue as rte_foo.h is compiled with -Ilib/foo.

Reimplement the headers check by inspecting (compiling) all DPDK headers
installed in a staging directory.
To identify the directory where DPDK headers are, this check relies on
pkg-config and skips EAL generic/ and internal/ headers.

The existing headers check (though less accurate) is kept as is,
as it provides a first level of check and may have existing users.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 .ci/linux-build.sh            |  7 ++--
 buildtools/chkincs/Makefile   | 77 +++++++++++++++++++++++++++++++++++
 devtools/test-meson-builds.sh |  6 ++-
 3 files changed, 85 insertions(+), 5 deletions(-)
 create mode 100644 buildtools/chkincs/Makefile

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index fdb5787621..3146d9ccd8 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -95,8 +95,6 @@ OPTS="$OPTS -Ddefault_library=$DEF_LIB"
 OPTS="$OPTS -Dbuildtype=$buildtype"
 if [ "$STDATOMIC" = "true" ]; then
 	OPTS="$OPTS -Denable_stdatomic=true"
-else
-	OPTS="$OPTS -Dcheck_includes=true"
 fi
 if [ "$MINI" = "true" ]; then
     OPTS="$OPTS -Denable_drivers=net/null"
@@ -176,13 +174,16 @@ if [ "$RUN_TESTS" = "true" ]; then
     [ "$failed" != "true" ]
 fi
 
-# Test examples compilation with an installed dpdk
+# Test headers and examples compilation with an installed dpdk
 if [ "$BUILD_EXAMPLES" = "true" ]; then
     [ -d install ] || DESTDIR=$(pwd)/install meson install -C build
     export LD_LIBRARY_PATH=$(dirname $(find $(pwd)/install -name librte_eal.so)):$LD_LIBRARY_PATH
     export PATH=$(dirname $(find $(pwd)/install -name dpdk-devbind.py)):$PATH
     export PKG_CONFIG_PATH=$(dirname $(find $(pwd)/install -name libdpdk.pc)):$PKG_CONFIG_PATH
     export PKGCONF="pkg-config --define-prefix"
+
+    make -C buildtools/chkincs O=build/buildtools/chkincs
+
     find build/examples -maxdepth 1 -type f -name "dpdk-*" |
     while read target; do
         target=${target%%:*}
diff --git a/buildtools/chkincs/Makefile b/buildtools/chkincs/Makefile
new file mode 100644
index 0000000000..838819c617
--- /dev/null
+++ b/buildtools/chkincs/Makefile
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2024 Red Hat, Inc.
+
+ifeq ($(V),)
+Q ?= @
+else
+Q =
+endif
+
+O ?= build
+
+PKGCONF ?= pkg-config
+
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
+$(error "no installation of DPDK found")
+endif
+
+ifeq ($(I),)
+
+.PHONY: headers_list
+.ONESHELL:
+headers_list:
+	$(Q)for dir in $$($(PKGCONF) --cflags-only-I libdpdk); do
+		dir=$${dir##-I}
+		[ -e $$dir/rte_build_config.h ] || continue
+		$(MAKE) I="$$dir" O="$(O)"
+		break
+	done
+else
+
+HEADERS := $(shell find $(I) -name "*.h" | grep -vE $(I)'/(generic|internal)/')
+SRCS := $(patsubst $(I)/%.h, $(O)/%.c, $(HEADERS))
+.PRECIOUS: $(SRCS)
+
+PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
+CFLAGS = $(shell $(PKGCONF) --cflags libdpdk) -Wall -Wextra -Werror
+LDFLAGS = $(shell $(PKGCONF) --libs libdpdk)
+
+OBJS := $(patsubst $(I)/%.h, $(O)/%.o, $(HEADERS))
+OBJS_EXP := $(patsubst $(I)/%.h, $(O)/%+exp.o, $(HEADERS))
+OBJS_ALL := $(patsubst $(I)/%.h, $(O)/%+all.o, $(HEADERS))
+
+all: $(OBJS) $(OBJS_EXP) $(OBJS_ALL)
+
+$(O):
+	$(Q)mkdir -p $@
+
+$(O)/%.c: $(I)/%.h $(O) gen_c_file_for_header.py Makefile
+	$(Q)python3 gen_c_file_for_header.py $< $@
+
+$(O)/%.o: $(O)/%.c Makefile $(PC_FILE)
+	$(Q)$(CC) $(CFLAGS) -o $@ -c $<
+
+$(O)/%+exp.o: $(O)/%.c Makefile $(PC_FILE)
+	$(Q)$(CC) $(CFLAGS) -DALLOW_EXPERIMENTAL_API -o $@ -c $<
+
+$(O)/%+all.o: $(O)/%.c Makefile $(PC_FILE)
+	$(Q)$(CC) $(CFLAGS) -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API -o $@ -c $<
+
+CXXFLAGS = $(shell $(PKGCONF) --cflags libdpdk) -Wall -Wextra -Werror
+
+OBJS_CPP := $(patsubst $(I)/%.h, $(O)/%.cpp.o, $(HEADERS))
+OBJS_CPP_EXP := $(patsubst $(I)/%.h, $(O)/%.cpp+exp.o, $(HEADERS))
+OBJS_CPP_ALL := $(patsubst $(I)/%.h, $(O)/%.cpp+all.o, $(HEADERS))
+
+all: $(OBJS_CPP) $(OBJS_CPP_EXP) $(OBJS_CPP_ALL)
+
+$(O)/%.cpp.o: $(O)/%.c Makefile $(PC_FILE)
+	$(Q)$(CXX) $(CXXFLAGS) -o $@ -c $<
+
+$(O)/%.cpp+exp.o: $(O)/%.c Makefile $(PC_FILE)
+	$(Q)$(CXX) $(CXXFLAGS) -DALLOW_EXPERIMENTAL_API -o $@ -c $<
+
+$(O)/%.cpp+all.o: $(O)/%.c Makefile $(PC_FILE)
+	$(Q)$(CXX) $(CXXFLAGS) -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API -o $@ -c $<
+
+endif
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 4fff1f7177..c3cebead70 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -248,7 +248,7 @@ generic_isa='nehalem'
 if ! check_cc_flags "-march=$generic_isa" ; then
 	generic_isa='corei7'
 fi
-build build-x86-generic cc skipABI -Dcheck_includes=true \
+build build-x86-generic cc skipABI \
 	-Dlibdir=lib -Dcpu_instruction_set=$generic_isa $use_shared
 
 # 32-bit with default compiler
@@ -318,9 +318,11 @@ if [ "$examples" = 'all' ]; then
 	done | sort -u |
 	tr '\n' ' ')
 fi
-# if pkg-config defines the necessary flags, test building some examples
+# if pkg-config defines the necessary flags, check headers and test building some examples
 if pkg-config --define-prefix libdpdk >/dev/null 2>&1; then
 	export PKGCONF="pkg-config --define-prefix"
+	echo "## Checking exported headers"
+	$MAKE -C buildtools/chkincs O=$build_path/buildtools/chkincs -j
 	for example in $examples; do
 		echo "## Building $example"
 		[ $example = helloworld ] && static=static || static= # save disk space
-- 
2.47.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v2 1/6] baseband/acc: fix exported header
  2024-12-13 10:50   ` [PATCH v2 1/6] baseband/acc: fix exported header David Marchand
@ 2024-12-13 11:01     ` Bruce Richardson
  0 siblings, 0 replies; 75+ messages in thread
From: Bruce Richardson @ 2024-12-13 11:01 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, thomas, Nicolas Chautru, Maxime Coquelin

On Fri, Dec 13, 2024 at 11:50:05AM +0100, David Marchand wrote:
> rte_acc_cfg.h relies on rte_acc_common_cfg.h.
> 
> Fixes: 32e8b7ea35dd ("baseband/acc100: refactor to segregate common code")
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
Indeed it does depend on it!

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v2 2/6] drivers: drop export of driver headers
  2024-12-13 10:50   ` [PATCH v2 2/6] drivers: drop export of driver headers David Marchand
@ 2024-12-13 11:03     ` Bruce Richardson
  2024-12-16  9:13       ` Andrew Rybchenko
  0 siblings, 1 reply; 75+ messages in thread
From: Bruce Richardson @ 2024-12-13 11:03 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, thomas, Nicolas Chautru, Ferruh Yigit, Andrew Rybchenko,
	Srikanth Yalavarthi, Sachin Saxena, Hemant Agrawal, Ori Kam,
	Akhil Goyal, Anoob Joseph

On Fri, Dec 13, 2024 at 11:50:06AM +0100, David Marchand wrote:
> Many classes are exposing driver only headers as public headers.
> Move them to the driver_sdk_headers list.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---

LGTM. The names of most of the headers are pretty clear that they should be
sdk-only headers.

Acked-by: Bruce Richardson <bruce.richardson@intel.com>


^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v2 3/6] eventdev: do not include driver header in DMA adapter
  2024-12-13 10:50   ` [PATCH v2 3/6] eventdev: do not include driver header in DMA adapter David Marchand
@ 2024-12-13 11:04     ` Bruce Richardson
  0 siblings, 0 replies; 75+ messages in thread
From: Bruce Richardson @ 2024-12-13 11:04 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, thomas, Amit Prakash Shukla, Jerin Jacob

On Fri, Dec 13, 2024 at 11:50:07AM +0100, David Marchand wrote:
> The dma adapter header does not require including rte_dmadev_pmd.h which
> is a driver header.
> 
> Fixes: 66a30a29387a ("eventdev/dma: introduce DMA adapter")
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Amit Prakash Shukla <amitprakashs@marvell.com>

Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  lib/eventdev/rte_event_dma_adapter.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/eventdev/rte_event_dma_adapter.h b/lib/eventdev/rte_event_dma_adapter.h
> index 5c480b82ff..34142f26db 100644
> --- a/lib/eventdev/rte_event_dma_adapter.h
> +++ b/lib/eventdev/rte_event_dma_adapter.h
> @@ -144,7 +144,7 @@
>  #include <stdint.h>
>  
>  #include <rte_common.h>
> -#include <rte_dmadev_pmd.h>
> +#include <rte_dmadev.h>
>  #include <rte_eventdev.h>
>  
>  #ifdef __cplusplus
> -- 
> 2.47.0
> 

^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v2 4/6] drivers: fix exported headers
  2024-12-13 10:50   ` [PATCH v2 4/6] drivers: fix exported headers David Marchand
@ 2024-12-13 11:14     ` Bruce Richardson
  2024-12-13 13:46       ` David Marchand
  2024-12-13 17:10     ` Stephen Hemminger
  1 sibling, 1 reply; 75+ messages in thread
From: Bruce Richardson @ 2024-12-13 11:14 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, thomas, Long Li, Wei Hu, Ankur Dwivedi, Anoob Joseph,
	Tejasree Kondoj, Hemant Agrawal, Sachin Saxena,
	Vladimir Medvedkin, Ian Stokes, Dariusz Sosnowski,
	Viacheslav Ovsiienko, Bing Zhao, Ori Kam, Suanming Mou,
	Matan Azrad, Jakub Palider, Tomasz Duszynski, Gagandeep Singh,
	Jingjing Wu, Stephen Hemminger, Akhil Goyal, Haiyue Wang,
	Jeff Guo, Michael Baum, Jerin Jacob, Shreyansh Jain, Nipun Gupta,
	Xiaoyun Li

On Fri, Dec 13, 2024 at 11:50:08AM +0100, David Marchand wrote:
> Those headers could not be included individually as they were not
> including their dependencies, or were subject to some build warnings.
> 
> Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
> Fixes: 5b2a1a02dcaf ("crypto/cnxk: fix experimental version for PMD API")
> Fixes: e5abbeeeefa5 ("crypto/cnxk: add PMD API for getting CPTR")
> Fixes: 3ca607402c4d ("crypto/cnxk: add PMD API to flush CTX")
> Fixes: 8c3495f5d2dd ("net/dpaa: support loopback API")
> Fixes: 12b435bf8f2f ("net/iavf: support flex desc metadata extraction")
> Fixes: 23f627e0ed28 ("net/mlx5: add flow sync API")
> Fixes: f5177bdc8b76 ("net/mlx5: add GENEVE TLV options parser API")
> Fixes: 7cf197684589 ("raw/cnxk_bphy: support interrupt init and cleanup")
> Fixes: 633dae698070 ("raw/cnxk_gpio: add standard GPIO operations")
> Fixes: 53c71586c789 ("raw/dpaa2_cmdif: support enqueue/dequeue operations")
> Fixes: c39d1e082a4b ("raw/ntb: setup queues")
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Generally LGTM, some queries inline below.

/Bruce

> ---
>  drivers/bus/vmbus/rte_vmbus_reg.h             |  6 ++++++
>  drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h     |  4 ++++
>  drivers/net/dpaa/rte_pmd_dpaa.h               |  2 ++
>  drivers/net/iavf/rte_pmd_iavf.h               |  6 ++++++
>  drivers/net/mlx5/rte_pmd_mlx5.h               |  3 +++
>  drivers/raw/cnxk_bphy/rte_pmd_bphy.h          | 16 ++++++++++++++++
>  drivers/raw/cnxk_gpio/rte_pmd_cnxk_gpio.h     |  3 +++
>  drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h |  2 ++
>  drivers/raw/ntb/rte_pmd_ntb.h                 |  2 ++
>  9 files changed, 44 insertions(+)
> 
> diff --git a/drivers/bus/vmbus/rte_vmbus_reg.h b/drivers/bus/vmbus/rte_vmbus_reg.h
> index e3299aa871..95c8eb29b4 100644
> --- a/drivers/bus/vmbus/rte_vmbus_reg.h
> +++ b/drivers/bus/vmbus/rte_vmbus_reg.h
> @@ -6,6 +6,12 @@
>  #ifndef _VMBUS_REG_H_
>  #define _VMBUS_REG_H_
>  
> +#include <stdint.h>
> +
> +#include <rte_common.h>
> +#include <rte_stdatomic.h>
> +#include <rte_uuid.h>
> +
>  /*
>   * Hyper-V SynIC message format.
>   */
> diff --git a/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h b/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
> index 02278605a2..2bb0ff9e95 100644
> --- a/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
> +++ b/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
> @@ -11,8 +11,12 @@
>  #ifndef _PMD_CNXK_CRYPTO_H_
>  #define _PMD_CNXK_CRYPTO_H_
>  
> +#include <stdbool.h>
>  #include <stdint.h>
>  
> +#include <rte_compat.h>
> +#include <rte_crypto.h>
> +
>  /* Forward declarations */
>  
>  /**
> diff --git a/drivers/net/dpaa/rte_pmd_dpaa.h b/drivers/net/dpaa/rte_pmd_dpaa.h
> index ec45633ba2..0a57e2097a 100644
> --- a/drivers/net/dpaa/rte_pmd_dpaa.h
> +++ b/drivers/net/dpaa/rte_pmd_dpaa.h
> @@ -5,6 +5,8 @@
>  #ifndef _PMD_DPAA_H_
>  #define _PMD_DPAA_H_
>  
> +#include <stdint.h>
> +
>  /**
>   * @file rte_pmd_dpaa.h
>   *
> diff --git a/drivers/net/iavf/rte_pmd_iavf.h b/drivers/net/iavf/rte_pmd_iavf.h
> index 56d453fc4c..04b86a5dd7 100644
> --- a/drivers/net/iavf/rte_pmd_iavf.h
> +++ b/drivers/net/iavf/rte_pmd_iavf.h
> @@ -15,6 +15,7 @@
>   */
>  
>  #include <stdio.h>
> +
>  #include <rte_compat.h>
>  #include <rte_mbuf.h>
>  #include <rte_mbuf_dyn.h>
> @@ -184,6 +185,7 @@ __rte_experimental
>  static inline void
>  rte_pmd_ifd_dump_proto_xtr_metadata(struct rte_mbuf *m)
>  {
> +#ifdef ALLOW_EXPERIMENTAL_API
>  	union rte_pmd_ifd_proto_xtr_metadata data;
>  
>  	if (!rte_pmd_ifd_dynf_proto_xtr_metadata_avail())
> @@ -243,6 +245,10 @@ rte_pmd_ifd_dump_proto_xtr_metadata(struct rte_mbuf *m)
>  	else if (m->ol_flags & RTE_IAVF_PKT_RX_DYNF_PROTO_XTR_IP_OFFSET)
>  		printf(" - Flexible descriptor's Extraction: ip_offset=%u",
>  		       data.ip_ofs);
> +#else
> +	RTE_SET_USED(m);
> +	RTE_VERIFY(false);

Is panicking the behaviour we want here? Seems rather severe, no?

> +#endif
>  }
>  
>  #ifdef __cplusplus
> diff --git a/drivers/net/mlx5/rte_pmd_mlx5.h b/drivers/net/mlx5/rte_pmd_mlx5.h
> index fdd2f65888..f2c6aebe0b 100644
> --- a/drivers/net/mlx5/rte_pmd_mlx5.h
> +++ b/drivers/net/mlx5/rte_pmd_mlx5.h
> @@ -5,6 +5,9 @@
>  #ifndef RTE_PMD_PRIVATE_MLX5_H_
>  #define RTE_PMD_PRIVATE_MLX5_H_
>  
> +#include <stdint.h>
> +
> +#include <rte_byteorder.h>
>  #include <rte_compat.h>
>  
>  /**
> diff --git a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
> index f668e6ea82..c200c935ff 100644
> --- a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
> +++ b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
> @@ -391,6 +391,7 @@ rte_pmd_bphy_intr_init(uint16_t dev_id)
>  {
>  	struct cnxk_bphy_irq_msg msg = {
>  		.type = CNXK_BPHY_IRQ_MSG_TYPE_INIT,
> +		.data = NULL,
>  	};
> 

Why is this addition necessary? Is it for C++ compile?
 
>  	return __rte_pmd_bphy_enq_deq(dev_id, CNXK_BPHY_DEF_QUEUE, &msg,
> @@ -411,6 +412,7 @@ rte_pmd_bphy_intr_fini(uint16_t dev_id)
>  {
>  	struct cnxk_bphy_irq_msg msg = {
>  		.type = CNXK_BPHY_IRQ_MSG_TYPE_FINI,
> +		.data = NULL,
>  	};
>  
>  	return __rte_pmd_bphy_enq_deq(dev_id, CNXK_BPHY_DEF_QUEUE, &msg,
> @@ -470,6 +472,9 @@ rte_pmd_bphy_intr_unregister(uint16_t dev_id, int irq_num)
>  {
>  	struct cnxk_bphy_irq_info info = {
>  		.irq_num = irq_num,
> +		.handler = NULL,
> +		.data = NULL,
> +		.cpu = -1,
>  	};
>  	struct cnxk_bphy_irq_msg msg = {
>  		.type = CNXK_BPHY_IRQ_MSG_TYPE_UNREGISTER,
> @@ -496,6 +501,7 @@ rte_pmd_bphy_intr_mem_get(uint16_t dev_id, struct cnxk_bphy_mem *mem)
>  {
>  	struct cnxk_bphy_irq_msg msg = {
>  		.type = CNXK_BPHY_IRQ_MSG_TYPE_MEM_GET,
> +		.data = NULL,
>  	};
>  
>  	return __rte_pmd_bphy_enq_deq(dev_id, CNXK_BPHY_DEF_QUEUE, &msg,
> @@ -518,6 +524,7 @@ rte_pmd_bphy_npa_pf_func_get(uint16_t dev_id, uint16_t *pf_func)
>  {
>  	struct cnxk_bphy_irq_msg msg = {
>  		.type = CNXK_BPHY_MSG_TYPE_NPA_PF_FUNC,
> +		.data = NULL,
>  	};
>  
>  	return __rte_pmd_bphy_enq_deq(dev_id, CNXK_BPHY_DEF_QUEUE, &msg,
> @@ -540,6 +547,7 @@ rte_pmd_bphy_sso_pf_func_get(uint16_t dev_id, uint16_t *pf_func)
>  {
>  	struct cnxk_bphy_irq_msg msg = {
>  		.type = CNXK_BPHY_MSG_TYPE_SSO_PF_FUNC,
> +		.data = NULL,
>  	};
>  
>  	return __rte_pmd_bphy_enq_deq(dev_id, CNXK_BPHY_DEF_QUEUE, &msg,
> @@ -565,6 +573,7 @@ rte_pmd_bphy_cgx_get_link_info(uint16_t dev_id, uint16_t lmac,
>  {
>  	struct cnxk_bphy_cgx_msg msg = {
>  		.type = CNXK_BPHY_CGX_MSG_TYPE_GET_LINKINFO,
> +		.data = NULL,
>  	};
>  
>  	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, info, sizeof(*info));
> @@ -586,6 +595,7 @@ rte_pmd_bphy_cgx_intlbk_disable(uint16_t dev_id, uint16_t lmac)
>  {
>  	struct cnxk_bphy_cgx_msg msg = {
>  		.type = CNXK_BPHY_CGX_MSG_TYPE_INTLBK_DISABLE,
> +		.data = NULL,
>  	};
>  
>  	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);
> @@ -607,6 +617,7 @@ rte_pmd_bphy_cgx_intlbk_enable(uint16_t dev_id, uint16_t lmac)
>  {
>  	struct cnxk_bphy_cgx_msg msg = {
>  		.type = CNXK_BPHY_CGX_MSG_TYPE_INTLBK_ENABLE,
> +		.data = NULL,
>  	};
>  
>  	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);
> @@ -628,6 +639,7 @@ rte_pmd_bphy_cgx_ptp_rx_disable(uint16_t dev_id, uint16_t lmac)
>  {
>  	struct cnxk_bphy_cgx_msg msg = {
>  		.type = CNXK_BPHY_CGX_MSG_TYPE_PTP_RX_DISABLE,
> +		.data = NULL,
>  	};
>  
>  	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);
> @@ -649,6 +661,7 @@ rte_pmd_bphy_cgx_ptp_rx_enable(uint16_t dev_id, uint16_t lmac)
>  {
>  	struct cnxk_bphy_cgx_msg msg = {
>  		.type = CNXK_BPHY_CGX_MSG_TYPE_PTP_RX_ENABLE,
> +		.data = NULL,
>  	};
>  
>  	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);
> @@ -720,6 +733,7 @@ rte_pmd_bphy_cgx_start_rxtx(uint16_t dev_id, uint16_t lmac)
>  {
>  	struct cnxk_bphy_cgx_msg msg = {
>  		.type = CNXK_BPHY_CGX_MSG_TYPE_START_RXTX,
> +		.data = NULL,
>  	};
>  
>  	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);
> @@ -741,6 +755,7 @@ rte_pmd_bphy_cgx_stop_rxtx(uint16_t dev_id, uint16_t lmac)
>  {
>  	struct cnxk_bphy_cgx_msg msg = {
>  		.type = CNXK_BPHY_CGX_MSG_TYPE_STOP_RXTX,
> +		.data = NULL,
>  	};
>  
>  	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);
> @@ -765,6 +780,7 @@ rte_pmd_bphy_cgx_get_supported_fec(uint16_t dev_id, uint16_t lmac,
>  {
>  	struct cnxk_bphy_cgx_msg msg = {
>  		.type = CNXK_BPHY_CGX_MSG_TYPE_GET_SUPPORTED_FEC,
> +		.data = NULL,
>  	};
>  
>  	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, fec, sizeof(*fec));
> diff --git a/drivers/raw/cnxk_gpio/rte_pmd_cnxk_gpio.h b/drivers/raw/cnxk_gpio/rte_pmd_cnxk_gpio.h
> index 80a37be9c7..72d138ab1d 100644
> --- a/drivers/raw/cnxk_gpio/rte_pmd_cnxk_gpio.h
> +++ b/drivers/raw/cnxk_gpio/rte_pmd_cnxk_gpio.h
> @@ -261,6 +261,7 @@ rte_pmd_gpio_get_pin_value(uint16_t dev_id, int gpio, int *val)
>  {
>  	struct cnxk_gpio_msg msg = {
>  		.type = CNXK_GPIO_MSG_TYPE_GET_PIN_VALUE,
> +		.data = NULL,
>  	};
>  
>  	return __rte_pmd_gpio_enq_deq(dev_id, gpio, &msg, val, sizeof(*val));
> @@ -285,6 +286,7 @@ rte_pmd_gpio_get_pin_edge(uint16_t dev_id, int gpio,
>  {
>  	struct cnxk_gpio_msg msg = {
>  		.type = CNXK_GPIO_MSG_TYPE_GET_PIN_EDGE,
> +		.data = NULL,
>  	};
>  
>  	return __rte_pmd_gpio_enq_deq(dev_id, gpio, &msg, edge, sizeof(*edge));
> @@ -308,6 +310,7 @@ rte_pmd_gpio_get_pin_dir(uint16_t dev_id, int gpio, enum cnxk_gpio_pin_dir *dir)
>  {
>  	struct cnxk_gpio_msg msg = {
>  		.type = CNXK_GPIO_MSG_TYPE_GET_PIN_DIR,
> +		.data = NULL,
>  	};
>  
>  	return __rte_pmd_gpio_enq_deq(dev_id, gpio, &msg, dir, sizeof(*dir));
> diff --git a/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h b/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h
> index 483b66eaae..7731fc6363 100644
> --- a/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h
> +++ b/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h
> @@ -12,6 +12,8 @@
>   *
>   */
>  
> +#include <stdint.h>
> +
>  #ifdef __cplusplus
>  extern "C" {
>  #endif
> diff --git a/drivers/raw/ntb/rte_pmd_ntb.h b/drivers/raw/ntb/rte_pmd_ntb.h
> index 6591ce7931..76da3be026 100644
> --- a/drivers/raw/ntb/rte_pmd_ntb.h
> +++ b/drivers/raw/ntb/rte_pmd_ntb.h
> @@ -5,6 +5,8 @@
>  #ifndef _RTE_PMD_NTB_H_
>  #define _RTE_PMD_NTB_H_
>  
> +#include <stdint.h>
> +
>  /* App needs to set/get these attrs */
>  #define NTB_QUEUE_SZ_NAME           "queue_size"
>  #define NTB_QUEUE_NUM_NAME          "queue_num"
> -- 
> 2.47.0
> 

^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v2 0/6] Add a stricter headers check
  2024-12-13 10:50 ` [PATCH v2 0/6] Add a stricter headers check David Marchand
                     ` (5 preceding siblings ...)
  2024-12-13 10:50   ` [PATCH v2 6/6] buildtools: externally check exported headers David Marchand
@ 2024-12-13 11:27   ` Bruce Richardson
  2024-12-13 13:38     ` David Marchand
  6 siblings, 1 reply; 75+ messages in thread
From: Bruce Richardson @ 2024-12-13 11:27 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, thomas

On Fri, Dec 13, 2024 at 11:50:04AM +0100, David Marchand wrote:
> As explained in patch 6, the current headers check can not catch
> issues when a public header includes an internal header.
> Fixing this from meson does not seem an easy task.
> 
> This series approach is to reimplement the check in a Makefile invoked
> out of DPDK (like what is done for external compilation of examples).
> This has the advantage of being simple, and avoiding any (non intentional)
> implicit include path coming from the meson framework.
> 
> As there was no easy way to distinguish "indirect" headers in an
> installed DPDK, I chose to move those headers in a new sub directory
> (patch 5).
> 
> Patch 1-4 fixes have not been marked as backport material as those bugs
> seems minor/easy to fix externally (by either including missing headers,
> or enabling enable_driver_sdk option).
> 
> For now, I left the check_includes= option untouched, as there may be
> users of this check and this check still catches issues without
> requiring to install DPDK.
> 
For patches 5 & 6, I wonder if we can find a slightly different way to do
this. I like the idea of using make to build chkincs free from possible
environmental contamination from meson, but I really don't like the
complexity of the resulting makefile!

Rather than having to move the indirect headers to a subdirectory, and then
have a makefile run a scan from the headers directory, how about instead
generating the makefile (or possibly a build.ninja file) directly from
meson itself? This means the makefile can already have the list of headers
and C files necessary - no need for an extra subdirectory - and no need for
large amounts of wildcard matching and replacements.

The downside is that the makefile is no longer with the source, but in the
build directory. However, since the most likely use for this makefile is
from the test-meson-builds script and from automated CIs, I don't see this
being a major issue.

WDYT?

/Bruce

^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v2 0/6] Add a stricter headers check
  2024-12-13 11:27   ` [PATCH v2 0/6] Add a stricter headers check Bruce Richardson
@ 2024-12-13 13:38     ` David Marchand
  0 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2024-12-13 13:38 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, thomas

On Fri, Dec 13, 2024 at 12:27 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Fri, Dec 13, 2024 at 11:50:04AM +0100, David Marchand wrote:
> > As explained in patch 6, the current headers check can not catch
> > issues when a public header includes an internal header.
> > Fixing this from meson does not seem an easy task.
> >
> > This series approach is to reimplement the check in a Makefile invoked
> > out of DPDK (like what is done for external compilation of examples).
> > This has the advantage of being simple, and avoiding any (non intentional)
> > implicit include path coming from the meson framework.
> >
> > As there was no easy way to distinguish "indirect" headers in an
> > installed DPDK, I chose to move those headers in a new sub directory
> > (patch 5).
> >
> > Patch 1-4 fixes have not been marked as backport material as those bugs
> > seems minor/easy to fix externally (by either including missing headers,
> > or enabling enable_driver_sdk option).
> >
> > For now, I left the check_includes= option untouched, as there may be
> > users of this check and this check still catches issues without
> > requiring to install DPDK.
> >
> For patches 5 & 6, I wonder if we can find a slightly different way to do
> this. I like the idea of using make to build chkincs free from possible
> environmental contamination from meson, but I really don't like the
> complexity of the resulting makefile!

Well, I am no makefile expert, though I find this one straightforward.
Thomas could probably enhance it :-).


> Rather than having to move the indirect headers to a subdirectory, and then
> have a makefile run a scan from the headers directory, how about instead
> generating the makefile (or possibly a build.ninja file) directly from
> meson itself? This means the makefile can already have the list of headers
> and C files necessary - no need for an extra subdirectory - and no need for
> large amounts of wildcard matching and replacements.

Scanning a staging directory insulates from bugs in meson and this is
the main point of this series.
If we add a new framework in meson (a list of headers or whatever),
any driver can still add some install_headers() somewhere and we are
back with a new hole.

What will ensure that nobody introduce a bug back with some include
path to the sources, being passed into the generated Makefile?

Headers should be checked from an installed directory (like a final
user) with minimal (ideally no) knowledge of what header is safe to
include.


> The downside is that the makefile is no longer with the source, but in the
> build directory. However, since the most likely use for this makefile is
> from the test-meson-builds script and from automated CIs, I don't see this
> being a major issue.

This part is not an issue.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v2 4/6] drivers: fix exported headers
  2024-12-13 11:14     ` Bruce Richardson
@ 2024-12-13 13:46       ` David Marchand
  2024-12-16  8:15         ` David Marchand
  0 siblings, 1 reply; 75+ messages in thread
From: David Marchand @ 2024-12-13 13:46 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: dev, thomas, Long Li, Wei Hu, Ankur Dwivedi, Anoob Joseph,
	Tejasree Kondoj, Hemant Agrawal, Sachin Saxena,
	Vladimir Medvedkin, Ian Stokes, Dariusz Sosnowski,
	Viacheslav Ovsiienko, Bing Zhao, Ori Kam, Suanming Mou,
	Matan Azrad, Jakub Palider, Tomasz Duszynski, Gagandeep Singh,
	Jingjing Wu, Stephen Hemminger, Akhil Goyal, Haiyue Wang,
	Jeff Guo, Michael Baum, Jerin Jacob, Shreyansh Jain, Nipun Gupta,
	Xiaoyun Li

On Fri, Dec 13, 2024 at 12:15 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Fri, Dec 13, 2024 at 11:50:08AM +0100, David Marchand wrote:
> > Those headers could not be included individually as they were not
> > including their dependencies, or were subject to some build warnings.
> >
> > Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
> > Fixes: 5b2a1a02dcaf ("crypto/cnxk: fix experimental version for PMD API")
> > Fixes: e5abbeeeefa5 ("crypto/cnxk: add PMD API for getting CPTR")
> > Fixes: 3ca607402c4d ("crypto/cnxk: add PMD API to flush CTX")
> > Fixes: 8c3495f5d2dd ("net/dpaa: support loopback API")
> > Fixes: 12b435bf8f2f ("net/iavf: support flex desc metadata extraction")
> > Fixes: 23f627e0ed28 ("net/mlx5: add flow sync API")
> > Fixes: f5177bdc8b76 ("net/mlx5: add GENEVE TLV options parser API")
> > Fixes: 7cf197684589 ("raw/cnxk_bphy: support interrupt init and cleanup")
> > Fixes: 633dae698070 ("raw/cnxk_gpio: add standard GPIO operations")
> > Fixes: 53c71586c789 ("raw/dpaa2_cmdif: support enqueue/dequeue operations")
> > Fixes: c39d1e082a4b ("raw/ntb: setup queues")
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
>
> Generally LGTM, some queries inline below.
>
> /Bruce
>
> > ---
> >  drivers/bus/vmbus/rte_vmbus_reg.h             |  6 ++++++
> >  drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h     |  4 ++++
> >  drivers/net/dpaa/rte_pmd_dpaa.h               |  2 ++
> >  drivers/net/iavf/rte_pmd_iavf.h               |  6 ++++++
> >  drivers/net/mlx5/rte_pmd_mlx5.h               |  3 +++
> >  drivers/raw/cnxk_bphy/rte_pmd_bphy.h          | 16 ++++++++++++++++
> >  drivers/raw/cnxk_gpio/rte_pmd_cnxk_gpio.h     |  3 +++
> >  drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h |  2 ++
> >  drivers/raw/ntb/rte_pmd_ntb.h                 |  2 ++
> >  9 files changed, 44 insertions(+)
> >
> > diff --git a/drivers/bus/vmbus/rte_vmbus_reg.h b/drivers/bus/vmbus/rte_vmbus_reg.h
> > index e3299aa871..95c8eb29b4 100644
> > --- a/drivers/bus/vmbus/rte_vmbus_reg.h
> > +++ b/drivers/bus/vmbus/rte_vmbus_reg.h
> > @@ -6,6 +6,12 @@
> >  #ifndef _VMBUS_REG_H_
> >  #define _VMBUS_REG_H_
> >
> > +#include <stdint.h>
> > +
> > +#include <rte_common.h>
> > +#include <rte_stdatomic.h>
> > +#include <rte_uuid.h>
> > +
> >  /*
> >   * Hyper-V SynIC message format.
> >   */
> > diff --git a/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h b/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
> > index 02278605a2..2bb0ff9e95 100644
> > --- a/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
> > +++ b/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
> > @@ -11,8 +11,12 @@
> >  #ifndef _PMD_CNXK_CRYPTO_H_
> >  #define _PMD_CNXK_CRYPTO_H_
> >
> > +#include <stdbool.h>
> >  #include <stdint.h>
> >
> > +#include <rte_compat.h>
> > +#include <rte_crypto.h>
> > +
> >  /* Forward declarations */
> >
> >  /**
> > diff --git a/drivers/net/dpaa/rte_pmd_dpaa.h b/drivers/net/dpaa/rte_pmd_dpaa.h
> > index ec45633ba2..0a57e2097a 100644
> > --- a/drivers/net/dpaa/rte_pmd_dpaa.h
> > +++ b/drivers/net/dpaa/rte_pmd_dpaa.h
> > @@ -5,6 +5,8 @@
> >  #ifndef _PMD_DPAA_H_
> >  #define _PMD_DPAA_H_
> >
> > +#include <stdint.h>
> > +
> >  /**
> >   * @file rte_pmd_dpaa.h
> >   *
> > diff --git a/drivers/net/iavf/rte_pmd_iavf.h b/drivers/net/iavf/rte_pmd_iavf.h
> > index 56d453fc4c..04b86a5dd7 100644
> > --- a/drivers/net/iavf/rte_pmd_iavf.h
> > +++ b/drivers/net/iavf/rte_pmd_iavf.h
> > @@ -15,6 +15,7 @@
> >   */
> >
> >  #include <stdio.h>
> > +
> >  #include <rte_compat.h>
> >  #include <rte_mbuf.h>
> >  #include <rte_mbuf_dyn.h>
> > @@ -184,6 +185,7 @@ __rte_experimental
> >  static inline void
> >  rte_pmd_ifd_dump_proto_xtr_metadata(struct rte_mbuf *m)
> >  {
> > +#ifdef ALLOW_EXPERIMENTAL_API
> >       union rte_pmd_ifd_proto_xtr_metadata data;
> >
> >       if (!rte_pmd_ifd_dynf_proto_xtr_metadata_avail())
> > @@ -243,6 +245,10 @@ rte_pmd_ifd_dump_proto_xtr_metadata(struct rte_mbuf *m)
> >       else if (m->ol_flags & RTE_IAVF_PKT_RX_DYNF_PROTO_XTR_IP_OFFSET)
> >               printf(" - Flexible descriptor's Extraction: ip_offset=%u",
> >                      data.ip_ofs);
> > +#else
> > +     RTE_SET_USED(m);
> > +     RTE_VERIFY(false);
>
> Is panicking the behaviour we want here? Seems rather severe, no?

You are not supposed to call this symbol without building with
ALLOW_EXPERIMENTAL_API.

Another option would be to mark those symbols as stable (they have
been untouched for years).
12b435bf8f2 (Jeff Guo          2020-10-30 16:40:30 +0800 186)
rte_pmd_ifd_dump_proto_xtr_metadata(struct rte_mbuf *m)


>
> > +#endif
> >  }
> >
> >  #ifdef __cplusplus
> > diff --git a/drivers/net/mlx5/rte_pmd_mlx5.h b/drivers/net/mlx5/rte_pmd_mlx5.h
> > index fdd2f65888..f2c6aebe0b 100644
> > --- a/drivers/net/mlx5/rte_pmd_mlx5.h
> > +++ b/drivers/net/mlx5/rte_pmd_mlx5.h
> > @@ -5,6 +5,9 @@
> >  #ifndef RTE_PMD_PRIVATE_MLX5_H_
> >  #define RTE_PMD_PRIVATE_MLX5_H_
> >
> > +#include <stdint.h>
> > +
> > +#include <rte_byteorder.h>
> >  #include <rte_compat.h>
> >
> >  /**
> > diff --git a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
> > index f668e6ea82..c200c935ff 100644
> > --- a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
> > +++ b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
> > @@ -391,6 +391,7 @@ rte_pmd_bphy_intr_init(uint16_t dev_id)
> >  {
> >       struct cnxk_bphy_irq_msg msg = {
> >               .type = CNXK_BPHY_IRQ_MSG_TYPE_INIT,
> > +             .data = NULL,
> >       };
> >
>
> Why is this addition necessary? Is it for C++ compile?

IIRC, this is because DPDK meson passes
-Wno-missing-field-initializers globally, and the Makefile I wrote
does not.
I'll double check.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v2 4/6] drivers: fix exported headers
  2024-12-13 10:50   ` [PATCH v2 4/6] drivers: fix exported headers David Marchand
  2024-12-13 11:14     ` Bruce Richardson
@ 2024-12-13 17:10     ` Stephen Hemminger
  1 sibling, 0 replies; 75+ messages in thread
From: Stephen Hemminger @ 2024-12-13 17:10 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, thomas, bruce.richardson, Long Li, Wei Hu, Ankur Dwivedi,
	Anoob Joseph, Tejasree Kondoj, Hemant Agrawal, Sachin Saxena,
	Vladimir Medvedkin, Ian Stokes, Dariusz Sosnowski,
	Viacheslav Ovsiienko, Bing Zhao, Ori Kam, Suanming Mou,
	Matan Azrad, Jakub Palider, Tomasz Duszynski, Gagandeep Singh,
	Jingjing Wu, Stephen Hemminger, Akhil Goyal, Haiyue Wang,
	Jeff Guo, Michael Baum, Jerin Jacob, Shreyansh Jain, Nipun Gupta,
	Xiaoyun Li

On Fri, 13 Dec 2024 11:50:08 +0100
David Marchand <david.marchand@redhat.com> wrote:

> @@ -496,6 +501,7 @@ rte_pmd_bphy_intr_mem_get(uint16_t dev_id, struct cnxk_bphy_mem *mem)
>  {
>  	struct cnxk_bphy_irq_msg msg = {
>  		.type = CNXK_BPHY_IRQ_MSG_TYPE_MEM_GET,
> +		.data = NULL,
>  	};
>  

Why add these, compiler already initializes these to NULL.
Are you trying to enable -Wmissing-field-initializers?

^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v2 4/6] drivers: fix exported headers
  2024-12-13 13:46       ` David Marchand
@ 2024-12-16  8:15         ` David Marchand
  0 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2024-12-16  8:15 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: dev, thomas, Long Li, Wei Hu, Ankur Dwivedi, Anoob Joseph,
	Tejasree Kondoj, Hemant Agrawal, Sachin Saxena,
	Vladimir Medvedkin, Ian Stokes, Dariusz Sosnowski,
	Viacheslav Ovsiienko, Bing Zhao, Ori Kam, Suanming Mou,
	Matan Azrad, Jakub Palider, Tomasz Duszynski, Gagandeep Singh,
	Jingjing Wu, Stephen Hemminger, Akhil Goyal, Haiyue Wang,
	Jeff Guo, Michael Baum, Jerin Jacob, Shreyansh Jain, Nipun Gupta,
	Xiaoyun Li

On Fri, Dec 13, 2024 at 2:46 PM David Marchand
<david.marchand@redhat.com> wrote:
> > > diff --git a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
> > > index f668e6ea82..c200c935ff 100644
> > > --- a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
> > > +++ b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
> > > @@ -391,6 +391,7 @@ rte_pmd_bphy_intr_init(uint16_t dev_id)
> > >  {
> > >       struct cnxk_bphy_irq_msg msg = {
> > >               .type = CNXK_BPHY_IRQ_MSG_TYPE_INIT,
> > > +             .data = NULL,
> > >       };
> > >
> >
> > Why is this addition necessary? Is it for C++ compile?
>
> IIRC, this is because DPDK meson passes
> -Wno-missing-field-initializers globally, and the Makefile I wrote
> does not.
> I'll double check.

Yep, confirmed.

...
In file included from
/home/dmarchan/builds/main/build-x86-generic/buildtools/chkincs/rte_pmd_cnxk_gpio.c:1:
/home/dmarchan/builds/main/build-x86-generic/install/usr/local/include/rte_pmd_cnxk_gpio.h:
In function ‘int rte_pmd_gpio_get_pin_value(uint16_t, int, int*)’:
/home/dmarchan/builds/main/build-x86-generic/install/usr/local/include/rte_pmd_cnxk_gpio.h:264:9:
error: missing initializer for member ‘cnxk_gpio_msg::data’
[-Werror=missing-field-initializers]
  264 |         };
      |         ^
...

On the other hand, -Wmissing-field-initializers comes from -Wextra and
it is explicitly disabled in meson.
If we want to stick with -Wmissing-field-initializers "internally", I
will drop those changes (and disable missing-field-initializers,
trying to keep -Wextra in the "external" check)


-- 
David Marchand


^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v2 2/6] drivers: drop export of driver headers
  2024-12-13 11:03     ` Bruce Richardson
@ 2024-12-16  9:13       ` Andrew Rybchenko
  0 siblings, 0 replies; 75+ messages in thread
From: Andrew Rybchenko @ 2024-12-16  9:13 UTC (permalink / raw)
  To: Bruce Richardson, David Marchand
  Cc: dev, thomas, Nicolas Chautru, Ferruh Yigit, Srikanth Yalavarthi,
	Sachin Saxena, Hemant Agrawal, Ori Kam, Akhil Goyal,
	Anoob Joseph

On 12/13/24 14:03, Bruce Richardson wrote:
> On Fri, Dec 13, 2024 at 11:50:06AM +0100, David Marchand wrote:
>> Many classes are exposing driver only headers as public headers.
>> Move them to the driver_sdk_headers list.
>>
>> Signed-off-by: David Marchand <david.marchand@redhat.com>
>> ---
> 
> LGTM. The names of most of the headers are pretty clear that they should be
> sdk-only headers.
> 
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 

Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v3 0/7] Add a stricter headers check
  2024-11-27 11:26 [RFC 0/6] Add a stricter headers check David Marchand
                   ` (6 preceding siblings ...)
  2024-12-13 10:50 ` [PATCH v2 0/6] Add a stricter headers check David Marchand
@ 2025-09-24 17:25 ` David Marchand
  2025-09-24 17:25   ` [PATCH v3 1/7] baseband/acc: fix exported header David Marchand
                     ` (6 more replies)
  2025-09-25 12:31 ` [PATCH v4 0/7] Add a stricter headers check David Marchand
  2025-09-26 12:40 ` [PATCH v5 0/9] Add a stricter headers check David Marchand
  9 siblings, 7 replies; 75+ messages in thread
From: David Marchand @ 2025-09-24 17:25 UTC (permalink / raw)
  To: dev

As explained in patch 6, the current headers check can not catch
issues when a public header includes an internal header.

Patch 1-5 fixes have not been marked as backport material as those bugs
seems minor/easy to fix externally (by either including missing headers,
or enabling enable_driver_sdk option).


-- 
David Marchand

Changes since v2:
- major rework, dropping the makefile approach, and instead copying
  headers to a staging directory used by the check,
- rebased,
- dropped changes on raw cnxk drivers and disabled the associated
  build warning in the headers check,

David Marchand (7):
  baseband/acc: fix exported header
  drivers: drop export of driver headers
  eventdev: do not include driver header in DMA adapter
  gpudev: fix driver header for Windows
  drivers: fix some exported headers
  buildtools/chkincs: use a staging directory for headers
  power: separate public and driver headers

 MAINTAINERS                                   |  3 ++
 buildtools/chkincs/meson.build                | 41 +++++++++----------
 buildtools/meson.build                        |  1 +
 buildtools/stage-headers.py                   | 32 +++++++++++++++
 drivers/baseband/acc/meson.build              |  2 +-
 drivers/bus/vmbus/rte_vmbus_reg.h             |  6 +++
 drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h     |  2 +
 drivers/meson.build                           | 28 +++++++++++--
 drivers/net/dpaa/rte_pmd_dpaa.h               |  2 +
 drivers/net/intel/iavf/rte_pmd_iavf.h         |  6 +++
 drivers/net/mlx5/rte_pmd_mlx5.h               |  3 ++
 drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h |  2 +
 drivers/raw/ntb/rte_pmd_ntb.h                 |  2 +
 lib/bbdev/meson.build                         | 14 ++++---
 lib/eal/include/meson.build                   |  8 ++++
 lib/eal/meson.build                           | 10 +++++
 lib/ethdev/meson.build                        |  6 +--
 lib/eventdev/rte_event_dma_adapter.h          |  2 +-
 lib/gpudev/gpudev.c                           |  1 +
 lib/gpudev/gpudev_driver.h                    |  4 +-
 lib/meson.build                               | 41 +++++++++++++++----
 lib/mldev/meson.build                         |  5 +--
 lib/power/meson.build                         |  7 +++-
 lib/power/power_cpufreq.h                     | 14 +------
 lib/power/power_uncore_ops.h                  |  1 +
 lib/power/rte_power_cpufreq.c                 |  2 +-
 lib/power/rte_power_cpufreq.h                 | 15 ++++++-
 lib/power/rte_power_uncore.c                  |  2 +-
 lib/power/rte_power_uncore.h                  |  3 +-
 lib/rawdev/meson.build                        |  3 +-
 lib/regexdev/meson.build                      |  3 +-
 lib/security/meson.build                      |  3 +-
 meson.build                                   |  4 ++
 staging/drivers/meson.build                   |  5 +++
 staging/meson.build                           |  7 ++++
 35 files changed, 217 insertions(+), 73 deletions(-)
 create mode 100644 buildtools/stage-headers.py
 create mode 100644 staging/drivers/meson.build
 create mode 100644 staging/meson.build

-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v3 1/7] baseband/acc: fix exported header
  2025-09-24 17:25 ` [PATCH v3 0/7] " David Marchand
@ 2025-09-24 17:25   ` David Marchand
  2025-09-24 17:25   ` [PATCH v3 2/7] drivers: drop export of driver headers David Marchand
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2025-09-24 17:25 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Nicolas Chautru, Maxime Coquelin

rte_acc_cfg.h relies on rte_acc_common_cfg.h.

Fixes: 32e8b7ea35dd ("baseband/acc100: refactor to segregate common code")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/baseband/acc/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/baseband/acc/meson.build b/drivers/baseband/acc/meson.build
index 64fcf1537a..d9fb947eaa 100644
--- a/drivers/baseband/acc/meson.build
+++ b/drivers/baseband/acc/meson.build
@@ -26,4 +26,4 @@ deps += ['bus_pci']
 
 sources = files('acc_common.c', 'rte_acc100_pmd.c', 'rte_vrb_pmd.c')
 
-headers = files('rte_acc_cfg.h')
+headers = files('rte_acc_cfg.h', 'rte_acc_common_cfg.h')
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v3 2/7] drivers: drop export of driver headers
  2025-09-24 17:25 ` [PATCH v3 0/7] " David Marchand
  2025-09-24 17:25   ` [PATCH v3 1/7] baseband/acc: fix exported header David Marchand
@ 2025-09-24 17:25   ` David Marchand
  2025-09-24 17:25   ` [PATCH v3 3/7] eventdev: do not include driver header in DMA adapter David Marchand
                     ` (4 subsequent siblings)
  6 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2025-09-24 17:25 UTC (permalink / raw)
  To: dev
  Cc: Bruce Richardson, Andrew Rybchenko, Nicolas Chautru,
	Thomas Monjalon, Srikanth Yalavarthi, Sachin Saxena,
	Hemant Agrawal, Ori Kam, Akhil Goyal, Anoob Joseph

Many classes are exposing driver only headers as public headers.
Move them to the driver_sdk_headers list.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
Changes since v2:
- rebased,

---
 lib/bbdev/meson.build    | 14 +++++++++-----
 lib/ethdev/meson.build   |  6 +++---
 lib/mldev/meson.build    |  5 +----
 lib/rawdev/meson.build   |  3 ++-
 lib/regexdev/meson.build |  3 ++-
 lib/security/meson.build |  3 ++-
 6 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/lib/bbdev/meson.build b/lib/bbdev/meson.build
index 2e48d5f3da..002fc3f1ac 100644
--- a/lib/bbdev/meson.build
+++ b/lib/bbdev/meson.build
@@ -1,10 +1,14 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-sources = files('rte_bbdev.c',
-        'bbdev_trace_points.c')
-headers = files('rte_bbdev.h',
-        'rte_bbdev_pmd.h',
+sources = files(
+        'rte_bbdev.c',
+        'bbdev_trace_points.c',
+)
+headers = files(
+        'rte_bbdev.h',
         'rte_bbdev_op.h',
-        'rte_bbdev_trace_fp.h')
+        'rte_bbdev_trace_fp.h',
+)
+driver_sdk_headers = files('rte_bbdev_pmd.h')
 deps += ['mbuf']
diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build
index f1d2586591..8ba6c708a2 100644
--- a/lib/ethdev/meson.build
+++ b/lib/ethdev/meson.build
@@ -26,11 +26,8 @@ headers = files(
         'rte_ethdev_trace_fp.h',
         'rte_dev_info.h',
         'rte_flow.h',
-        'rte_flow_driver.h',
         'rte_mtr.h',
-        'rte_mtr_driver.h',
         'rte_tm.h',
-        'rte_tm_driver.h',
 )
 
 indirect_headers += files(
@@ -42,6 +39,9 @@ driver_sdk_headers += files(
         'ethdev_driver.h',
         'ethdev_pci.h',
         'ethdev_vdev.h',
+        'rte_flow_driver.h',
+        'rte_mtr_driver.h',
+        'rte_tm_driver.h',
 )
 
 if is_linux
diff --git a/lib/mldev/meson.build b/lib/mldev/meson.build
index 0079ccd205..39f1fba927 100644
--- a/lib/mldev/meson.build
+++ b/lib/mldev/meson.build
@@ -26,11 +26,8 @@ headers = files(
         'rte_mldev.h',
 )
 
-indirect_headers += files(
-        'rte_mldev_core.h',
-)
-
 driver_sdk_headers += files(
+        'rte_mldev_core.h',
         'rte_mldev_pmd.h',
         'mldev_utils.h',
 )
diff --git a/lib/rawdev/meson.build b/lib/rawdev/meson.build
index 7dfc3d5cf9..ccfd922fda 100644
--- a/lib/rawdev/meson.build
+++ b/lib/rawdev/meson.build
@@ -8,6 +8,7 @@ if is_windows
 endif
 
 sources = files('rte_rawdev.c')
-headers = files('rte_rawdev.h', 'rte_rawdev_pmd.h')
+headers = files('rte_rawdev.h')
+driver_sdk_headers = files('rte_rawdev_pmd.h')
 
 deps += ['telemetry']
diff --git a/lib/regexdev/meson.build b/lib/regexdev/meson.build
index 7e12d8cd6d..2684da3825 100644
--- a/lib/regexdev/meson.build
+++ b/lib/regexdev/meson.build
@@ -2,6 +2,7 @@
 # Copyright 2020 Mellanox Technologies, Ltd
 
 sources = files('rte_regexdev.c')
-headers = files('rte_regexdev.h', 'rte_regexdev_driver.h')
+headers = files('rte_regexdev.h')
 indirect_headers += files('rte_regexdev_core.h')
+driver_sdk_headers = files('rte_regexdev_driver.h')
 deps += ['mbuf']
diff --git a/lib/security/meson.build b/lib/security/meson.build
index 1034a7a299..d5431d472c 100644
--- a/lib/security/meson.build
+++ b/lib/security/meson.build
@@ -2,5 +2,6 @@
 # Copyright(c) 2017-2019 Intel Corporation
 
 sources = files('rte_security.c')
-headers = files('rte_security.h', 'rte_security_driver.h')
+headers = files('rte_security.h')
+driver_sdk_headers = files('rte_security_driver.h')
 deps += ['mempool', 'cryptodev', 'net']
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v3 3/7] eventdev: do not include driver header in DMA adapter
  2025-09-24 17:25 ` [PATCH v3 0/7] " David Marchand
  2025-09-24 17:25   ` [PATCH v3 1/7] baseband/acc: fix exported header David Marchand
  2025-09-24 17:25   ` [PATCH v3 2/7] drivers: drop export of driver headers David Marchand
@ 2025-09-24 17:25   ` David Marchand
  2025-09-24 17:25   ` [PATCH v3 4/7] gpudev: fix driver header for Windows David Marchand
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2025-09-24 17:25 UTC (permalink / raw)
  To: dev; +Cc: Amit Prakash Shukla, Bruce Richardson, Jerin Jacob

The dma adapter header does not require including rte_dmadev_pmd.h which
is a driver header.

Fixes: 66a30a29387a ("eventdev/dma: introduce DMA adapter")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Amit Prakash Shukla <amitprakashs@marvell.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/eventdev/rte_event_dma_adapter.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eventdev/rte_event_dma_adapter.h b/lib/eventdev/rte_event_dma_adapter.h
index 5c480b82ff..34142f26db 100644
--- a/lib/eventdev/rte_event_dma_adapter.h
+++ b/lib/eventdev/rte_event_dma_adapter.h
@@ -144,7 +144,7 @@
 #include <stdint.h>
 
 #include <rte_common.h>
-#include <rte_dmadev_pmd.h>
+#include <rte_dmadev.h>
 #include <rte_eventdev.h>
 
 #ifdef __cplusplus
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v3 4/7] gpudev: fix driver header for Windows
  2025-09-24 17:25 ` [PATCH v3 0/7] " David Marchand
                     ` (2 preceding siblings ...)
  2025-09-24 17:25   ` [PATCH v3 3/7] eventdev: do not include driver header in DMA adapter David Marchand
@ 2025-09-24 17:25   ` David Marchand
  2025-09-25  7:53     ` Bruce Richardson
  2025-09-24 17:25   ` [PATCH v3 5/7] drivers: fix some exported headers David Marchand
                     ` (2 subsequent siblings)
  6 siblings, 1 reply; 75+ messages in thread
From: David Marchand @ 2025-09-24 17:25 UTC (permalink / raw)
  To: dev; +Cc: Elena Agostini, Thomas Monjalon

Use rte_os.h and its RTE_TAILQ_HEAD definition compatible with BSD
sys/queue.h

Fixes: 18cb07563165 ("gpudev: add event notification")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/gpudev/gpudev.c        | 1 +
 lib/gpudev/gpudev_driver.h | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/gpudev/gpudev.c b/lib/gpudev/gpudev.c
index 0473d9ffb3..4a2335834c 100644
--- a/lib/gpudev/gpudev.c
+++ b/lib/gpudev/gpudev.c
@@ -3,6 +3,7 @@
  */
 
 #include <stdlib.h>
+#include <sys/queue.h>
 
 #include <eal_export.h>
 #include <rte_eal.h>
diff --git a/lib/gpudev/gpudev_driver.h b/lib/gpudev/gpudev_driver.h
index 37b6ae3149..b7621f6e5a 100644
--- a/lib/gpudev/gpudev_driver.h
+++ b/lib/gpudev/gpudev_driver.h
@@ -12,11 +12,11 @@
 #define RTE_GPUDEV_DRIVER_H
 
 #include <stdint.h>
-#include <sys/queue.h>
 
 #include <dev_driver.h>
 
 #include <rte_compat.h>
+#include <rte_os.h>
 #include "rte_gpudev.h"
 
 #ifdef __cplusplus
@@ -80,7 +80,7 @@ struct __rte_cache_aligned rte_gpu {
 	/* Driver functions. */
 	struct rte_gpu_ops ops;
 	/* Event callback list. */
-	TAILQ_HEAD(rte_gpu_callback_list, rte_gpu_callback) callbacks;
+	RTE_TAILQ_HEAD(rte_gpu_callback_list, rte_gpu_callback) callbacks;
 	/* Current state (used or not) in the running process. */
 	enum rte_gpu_state process_state; /* Updated by this library. */
 	/* Driver-specific private data for the running process. */
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v3 5/7] drivers: fix some exported headers
  2025-09-24 17:25 ` [PATCH v3 0/7] " David Marchand
                     ` (3 preceding siblings ...)
  2025-09-24 17:25   ` [PATCH v3 4/7] gpudev: fix driver header for Windows David Marchand
@ 2025-09-24 17:25   ` David Marchand
  2025-09-24 17:25   ` [PATCH v3 6/7] buildtools/chkincs: use a staging directory for headers David Marchand
  2025-09-24 17:25   ` [PATCH v3 7/7] power: separate public and driver headers David Marchand
  6 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2025-09-24 17:25 UTC (permalink / raw)
  To: dev
  Cc: Long Li, Wei Hu, Ankur Dwivedi, Anoob Joseph, Tejasree Kondoj,
	Hemant Agrawal, Sachin Saxena, Vladimir Medvedkin,
	Dariusz Sosnowski, Viacheslav Ovsiienko, Bing Zhao, Ori Kam,
	Suanming Mou, Matan Azrad, Gagandeep Singh, Jingjing Wu,
	Stephen Hemminger, Akhil Goyal, Haiyue Wang, Jeff Guo,
	Michael Baum, Shreyansh Jain, Nipun Gupta, Xiaoyun Li

Those headers could not be included individually as they were not
including their dependencies, were subject to some build warnings,
or were not compiling on Windows.

Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
Fixes: 5b2a1a02dcaf ("crypto/cnxk: fix experimental version for PMD API")
Fixes: e5abbeeeefa5 ("crypto/cnxk: add PMD API for getting CPTR")
Fixes: 3ca607402c4d ("crypto/cnxk: add PMD API to flush CTX")
Fixes: 8c3495f5d2dd ("net/dpaa: support loopback API")
Fixes: 12b435bf8f2f ("net/iavf: support flex desc metadata extraction")
Fixes: 23f627e0ed28 ("net/mlx5: add flow sync API")
Fixes: f5177bdc8b76 ("net/mlx5: add GENEVE TLV options parser API")
Fixes: 53c71586c789 ("raw/dpaa2_cmdif: support enqueue/dequeue operations")
Fixes: c39d1e082a4b ("raw/ntb: setup queues")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changes since v2:
- rebased,
- dropped changes on raw/cnxk drivers,

---
 drivers/bus/vmbus/rte_vmbus_reg.h             | 6 ++++++
 drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h     | 2 ++
 drivers/net/dpaa/rte_pmd_dpaa.h               | 2 ++
 drivers/net/intel/iavf/rte_pmd_iavf.h         | 6 ++++++
 drivers/net/mlx5/rte_pmd_mlx5.h               | 3 +++
 drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h | 2 ++
 drivers/raw/ntb/rte_pmd_ntb.h                 | 2 ++
 7 files changed, 23 insertions(+)

diff --git a/drivers/bus/vmbus/rte_vmbus_reg.h b/drivers/bus/vmbus/rte_vmbus_reg.h
index fb7e3043ec..6370a07f95 100644
--- a/drivers/bus/vmbus/rte_vmbus_reg.h
+++ b/drivers/bus/vmbus/rte_vmbus_reg.h
@@ -6,6 +6,12 @@
 #ifndef _VMBUS_REG_H_
 #define _VMBUS_REG_H_
 
+#include <stdint.h>
+
+#include <rte_common.h>
+#include <rte_stdatomic.h>
+#include <rte_uuid.h>
+
 /*
  * Hyper-V SynIC message format.
  */
diff --git a/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h b/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
index 46861ab2cf..70c019e94c 100644
--- a/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
+++ b/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
@@ -11,8 +11,10 @@
 #ifndef _PMD_CNXK_CRYPTO_H_
 #define _PMD_CNXK_CRYPTO_H_
 
+#include <stdbool.h>
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_crypto.h>
 #include <rte_security.h>
 
diff --git a/drivers/net/dpaa/rte_pmd_dpaa.h b/drivers/net/dpaa/rte_pmd_dpaa.h
index ec45633ba2..0a57e2097a 100644
--- a/drivers/net/dpaa/rte_pmd_dpaa.h
+++ b/drivers/net/dpaa/rte_pmd_dpaa.h
@@ -5,6 +5,8 @@
 #ifndef _PMD_DPAA_H_
 #define _PMD_DPAA_H_
 
+#include <stdint.h>
+
 /**
  * @file rte_pmd_dpaa.h
  *
diff --git a/drivers/net/intel/iavf/rte_pmd_iavf.h b/drivers/net/intel/iavf/rte_pmd_iavf.h
index 56d453fc4c..04b86a5dd7 100644
--- a/drivers/net/intel/iavf/rte_pmd_iavf.h
+++ b/drivers/net/intel/iavf/rte_pmd_iavf.h
@@ -15,6 +15,7 @@
  */
 
 #include <stdio.h>
+
 #include <rte_compat.h>
 #include <rte_mbuf.h>
 #include <rte_mbuf_dyn.h>
@@ -184,6 +185,7 @@ __rte_experimental
 static inline void
 rte_pmd_ifd_dump_proto_xtr_metadata(struct rte_mbuf *m)
 {
+#ifdef ALLOW_EXPERIMENTAL_API
 	union rte_pmd_ifd_proto_xtr_metadata data;
 
 	if (!rte_pmd_ifd_dynf_proto_xtr_metadata_avail())
@@ -243,6 +245,10 @@ rte_pmd_ifd_dump_proto_xtr_metadata(struct rte_mbuf *m)
 	else if (m->ol_flags & RTE_IAVF_PKT_RX_DYNF_PROTO_XTR_IP_OFFSET)
 		printf(" - Flexible descriptor's Extraction: ip_offset=%u",
 		       data.ip_ofs);
+#else
+	RTE_SET_USED(m);
+	RTE_VERIFY(false);
+#endif
 }
 
 #ifdef __cplusplus
diff --git a/drivers/net/mlx5/rte_pmd_mlx5.h b/drivers/net/mlx5/rte_pmd_mlx5.h
index fdd2f65888..f2c6aebe0b 100644
--- a/drivers/net/mlx5/rte_pmd_mlx5.h
+++ b/drivers/net/mlx5/rte_pmd_mlx5.h
@@ -5,6 +5,9 @@
 #ifndef RTE_PMD_PRIVATE_MLX5_H_
 #define RTE_PMD_PRIVATE_MLX5_H_
 
+#include <stdint.h>
+
+#include <rte_byteorder.h>
 #include <rte_compat.h>
 
 /**
diff --git a/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h b/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h
index 483b66eaae..7731fc6363 100644
--- a/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h
+++ b/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h
@@ -12,6 +12,8 @@
  *
  */
 
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/drivers/raw/ntb/rte_pmd_ntb.h b/drivers/raw/ntb/rte_pmd_ntb.h
index 6591ce7931..76da3be026 100644
--- a/drivers/raw/ntb/rte_pmd_ntb.h
+++ b/drivers/raw/ntb/rte_pmd_ntb.h
@@ -5,6 +5,8 @@
 #ifndef _RTE_PMD_NTB_H_
 #define _RTE_PMD_NTB_H_
 
+#include <stdint.h>
+
 /* App needs to set/get these attrs */
 #define NTB_QUEUE_SZ_NAME           "queue_size"
 #define NTB_QUEUE_NUM_NAME          "queue_num"
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v3 6/7] buildtools/chkincs: use a staging directory for headers
  2025-09-24 17:25 ` [PATCH v3 0/7] " David Marchand
                     ` (4 preceding siblings ...)
  2025-09-24 17:25   ` [PATCH v3 5/7] drivers: fix some exported headers David Marchand
@ 2025-09-24 17:25   ` David Marchand
  2025-09-25  8:00     ` Bruce Richardson
  2025-09-24 17:25   ` [PATCH v3 7/7] power: separate public and driver headers David Marchand
  6 siblings, 1 reply; 75+ messages in thread
From: David Marchand @ 2025-09-24 17:25 UTC (permalink / raw)
  To: dev; +Cc: Thomas Monjalon, Bruce Richardson, Tyler Retzlaff

A problem with the current headers check is that it relies on
meson dependencies objects that come with their include_directories
directives, and all of those point at the library / driver sources.

This means that we won't detect a public header including a private
(as in, not exported) header, or a driver only header.

To address this issue, a staging directory is added and every header
is copied to it.

Drivers and library headers are staged to two different directories
and the check is updated accordingly.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 MAINTAINERS                    |  3 +++
 buildtools/chkincs/meson.build | 41 ++++++++++++++++------------------
 buildtools/meson.build         |  1 +
 buildtools/stage-headers.py    | 32 ++++++++++++++++++++++++++
 drivers/meson.build            | 28 ++++++++++++++++++++---
 lib/eal/include/meson.build    |  8 +++++++
 lib/eal/meson.build            | 10 +++++++++
 lib/meson.build                | 41 ++++++++++++++++++++++++++--------
 meson.build                    |  4 ++++
 staging/drivers/meson.build    |  5 +++++
 staging/meson.build            |  7 ++++++
 11 files changed, 146 insertions(+), 34 deletions(-)
 create mode 100644 buildtools/stage-headers.py
 create mode 100644 staging/drivers/meson.build
 create mode 100644 staging/meson.build

diff --git a/MAINTAINERS b/MAINTAINERS
index 1a2729be66..f309e20a22 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -131,10 +131,13 @@ F: buildtools/get-numa-count.py
 F: buildtools/list-dir-globs.py
 F: buildtools/map-list-symbol.sh
 F: buildtools/pkg-config/
+F: buildtools/stage-headers.py
 F: buildtools/symlink-drivers-solibs.sh
 F: buildtools/symlink-drivers-solibs.py
 F: devtools/test-meson-builds.sh
 F: devtools/check-meson.py
+F: staging/drivers/meson.build
+F: staging/meson.build
 
 Public CI
 M: Aaron Conole <aconole@redhat.com>
diff --git a/buildtools/chkincs/meson.build b/buildtools/chkincs/meson.build
index 49dbc55254..10298b71a1 100644
--- a/buildtools/chkincs/meson.build
+++ b/buildtools/chkincs/meson.build
@@ -12,38 +12,41 @@ gen_c_files = generator(gen_c_file_for_header,
         arguments: ['@INPUT@', '@OUTPUT@'])
 
 cflags = machine_args
+cflags += '-Wno-missing-field-initializers'
 cflags += no_wvla_cflag
+cflags += '-I../config'
+cflags += '-I.'
+cflags += '-Istaging'
 
 sources = files('main.c')
 sources += gen_c_files.process(dpdk_chkinc_headers)
 
-# some driver SDK headers depend on these two buses, which are mandatory in build
-# so we always include them in deps list
-deps = [get_variable('shared_rte_bus_vdev'), get_variable('shared_rte_bus_pci')]
-if dpdk_conf.has('RTE_BUS_VMBUS')
-    deps += get_variable('shared_rte_bus_vmbus')
-endif
-# add the rest of the libs to the dependencies
-foreach l:dpdk_libs_enabled
-    deps += get_variable('shared_rte_' + l)
-endforeach
+cflags_drivers = '-Istaging/drivers'
+sources_drivers = files('main.c')
+sources_drivers += gen_c_files.process(dpdk_chkinc_driver_headers)
 
 executable('chkincs', sources,
         c_args: cflags,
-        include_directories: includes,
-        dependencies: deps,
         install: false)
 
 executable('chkincs-exp', sources,
         c_args: [cflags, '-DALLOW_EXPERIMENTAL_API'],
-        include_directories: includes,
-        dependencies: deps,
         install: false)
 
 executable('chkincs-all', sources,
         c_args: [cflags, '-DALLOW_EXPERIMENTAL_API', '-DALLOW_INTERNAL_API'],
-        include_directories: includes,
-        dependencies: deps,
+        install: false)
+
+executable('chkincs-drv', sources_drivers,
+        c_args: [cflags, cflags_drivers],
+        install: false)
+
+executable('chkincs-drv-exp', sources_drivers,
+        c_args: [cflags, cflags_drivers, '-DALLOW_EXPERIMENTAL_API'],
+        install: false)
+
+executable('chkincs-drv-all', sources_drivers,
+        c_args: [cflags, cflags_drivers, '-DALLOW_EXPERIMENTAL_API', '-DALLOW_INTERNAL_API'],
         install: false)
 
 # run tests for c++ builds also
@@ -60,19 +63,13 @@ cpp_sources += gen_cpp_files.process(dpdk_chkinc_headers)
 
 executable('chkincs-cpp', cpp_sources,
         cpp_args: ['-include', 'rte_config.h', cflags],
-        include_directories: includes,
-        dependencies: deps,
         install: false)
 
 executable('chkincs-cpp-exp', cpp_sources,
         cpp_args: ['-include', 'rte_config.h', cflags, '-DALLOW_EXPERIMENTAL_API'],
-        include_directories: includes,
-        dependencies: deps,
         install: false)
 
 executable('chkincs-cpp-all', cpp_sources,
         cpp_args: ['-include', 'rte_config.h', cflags, '-DALLOW_EXPERIMENTAL_API',
                    '-DALLOW_INTERNAL_API'],
-        include_directories: includes,
-        dependencies: deps,
         install: false)
diff --git a/buildtools/meson.build b/buildtools/meson.build
index 32cea7cff7..561236e0af 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -27,6 +27,7 @@ get_min_meson_version_cmd = py3 + files('get-min-meson-version.py')
 get_test_suites_cmd = py3 + files('get-test-suites.py')
 header_gen_cmd = py3 + files('gen-header.py')
 has_hugepages_cmd = py3 + files('has-hugepages.py')
+stage_headers_cmd = py3 + files('stage-headers.py')
 cmdline_gen_cmd = py3 + files('dpdk-cmdline-gen.py')
 check_dts_requirements = py3 + files('check-dts-requirements.py')
 
diff --git a/buildtools/stage-headers.py b/buildtools/stage-headers.py
new file mode 100644
index 0000000000..3057c6a26f
--- /dev/null
+++ b/buildtools/stage-headers.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2025 Red Hat, Inc.
+
+"""
+Headers staging script for DPDK build system.
+"""
+
+import sys
+import os
+import shutil
+from pathlib import Path
+
+def main():
+    if len(sys.argv) < 4:
+        print("Usage: stage-headers.py <staging_dir> <meson_stamp> [headers...]")
+        sys.exit(1)
+
+    staging_dir = Path(sys.argv[1])
+    meson_stamp = Path(sys.argv[2])
+    headers = sys.argv[3:]
+
+    staging_dir.mkdir(parents=True, exist_ok=True)
+
+    for header in headers:
+        file = Path(header)
+        shutil.copy2(file, staging_dir / file.name)
+
+    meson_stamp.touch()
+
+if __name__ == "__main__":
+    main()
diff --git a/drivers/meson.build b/drivers/meson.build
index f25f425565..e159562e6b 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -245,7 +245,29 @@ foreach subpath:subdirs
         if get_option('enable_driver_sdk')
             install_headers(driver_sdk_headers)
         endif
-        dpdk_chkinc_headers += driver_sdk_headers
+        dpdk_chkinc_headers += headers
+        dpdk_chkinc_driver_headers += driver_sdk_headers
+
+        if headers.length() != 0
+            staged_headers_deps += declare_dependency(sources:
+                    custom_target(lib_name + '_header_staging',
+                            output: lib_name + '_header_staging.stamp',
+                            command: [stage_headers_cmd, staging_dir, '@OUTPUT@', headers],
+                            install: false,
+                    )
+            )
+        endif
+
+        if driver_sdk_headers.length() != 0
+            staged_headers_deps += declare_dependency(sources:
+                    custom_target(lib_name + '_driver_header_staging',
+                            output: lib_name + '_driver_header_staging.stamp',
+                            command: [stage_headers_cmd, drivers_staging_dir, '@OUTPUT@',
+                                driver_sdk_headers],
+                            install: false,
+                    )
+            )
+        endif
 
         if headers.length() > 0
             dpdk_includes += include_directories(drv_path)
@@ -348,10 +370,10 @@ foreach subpath:subdirs
         # testpmd or other built-in apps can find it if necessary
         shared_dep = declare_dependency(link_with: shared_lib,
                 include_directories: includes,
-                dependencies: shared_deps)
+                dependencies: shared_deps + staged_headers_deps)
         static_dep = declare_dependency(
                 include_directories: includes,
-                dependencies: static_deps)
+                dependencies: static_deps + staged_headers_deps)
 
         dpdk_drivers += static_lib
 
diff --git a/lib/eal/include/meson.build b/lib/eal/include/meson.build
index d903577caa..d79dd0f2fc 100644
--- a/lib/eal/include/meson.build
+++ b/lib/eal/include/meson.build
@@ -79,3 +79,11 @@ generic_headers = files(
         'generic/rte_vect.h',
 )
 install_headers(generic_headers, subdir: 'generic')
+staged_headers_deps += declare_dependency(sources:
+        custom_target('eal_generic_header_staging',
+                output: 'eal_generic_header_staging.stamp',
+                command: [stage_headers_cmd, join_paths(staging_dir, 'generic'), '@OUTPUT@',
+                    generic_headers],
+                install: false,
+        )
+)
diff --git a/lib/eal/meson.build b/lib/eal/meson.build
index e1d6c4cf17..6f1f0e80cd 100644
--- a/lib/eal/meson.build
+++ b/lib/eal/meson.build
@@ -12,7 +12,17 @@ endif
 
 subdir(exec_env)
 
+arch_headers = []
+arch_indirect_headers = []
 subdir(arch_subdir)
+staged_headers_deps += declare_dependency(sources:
+        custom_target('eal_arch_header_staging',
+                output: 'eal_arch_header_staging.stamp',
+                command: [stage_headers_cmd, staging_dir, '@OUTPUT@',
+                    arch_headers + arch_indirect_headers],
+                install: false,
+        )
+)
 
 deps += ['log', 'kvargs']
 if not is_windows
diff --git a/lib/meson.build b/lib/meson.build
index a67efaf718..8bc3cc3fdb 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -129,6 +129,7 @@ foreach l:libraries
     headers = []
     indirect_headers = [] # public headers not directly included by apps
     driver_sdk_headers = [] # public headers included by drivers
+    staged_headers_deps = []
     includes = []
     cflags = default_cflags
     objs = [] # other object files to link against, used e.g. for
@@ -214,7 +215,29 @@ foreach l:libraries
         install_headers(driver_sdk_headers)
     endif
     dpdk_chkinc_headers += headers
-    dpdk_chkinc_headers += driver_sdk_headers
+    dpdk_chkinc_driver_headers += driver_sdk_headers
+
+    lib_headers = headers + indirect_headers
+    if lib_headers.length() != 0
+        staged_headers_deps += declare_dependency(sources:
+                custom_target(l + '_header_staging',
+                        output: l + '_header_staging.stamp',
+                        command: [stage_headers_cmd, staging_dir, '@OUTPUT@', lib_headers],
+                        install: false,
+                )
+        )
+    endif
+
+    if driver_sdk_headers.length() != 0
+        staged_headers_deps += declare_dependency(sources:
+                custom_target(l + '_driver_header_staging',
+                        output: l + '_driver_header_staging.stamp',
+                        command: [stage_headers_cmd, drivers_staging_dir, '@OUTPUT@',
+                            driver_sdk_headers],
+                        install: false,
+                )
+        )
+    endif
 
     libname = 'rte_' + name
     includes += include_directories(l)
@@ -223,9 +246,9 @@ foreach l:libraries
     # special case for header only libraries
     if sources.length() == 0
         shared_dep = declare_dependency(include_directories: includes,
-                dependencies: shared_deps)
+                dependencies: shared_deps + staged_headers_deps)
         static_dep = declare_dependency(include_directories: includes,
-                dependencies: static_deps)
+                dependencies: static_deps + staged_headers_deps)
         set_variable('shared_rte_' + name, shared_dep)
         set_variable('static_rte_' + name, static_dep)
         dpdk_shared_lib_deps += shared_dep
@@ -254,7 +277,7 @@ foreach l:libraries
         if sources_avx2.length() > 0
             avx2_lib = static_library(libname + '_avx2_lib',
                     sources_avx2,
-                    dependencies: static_deps,
+                    dependencies: static_deps + staged_headers_deps,
                     include_directories: includes,
                     c_args: [cflags, cc_avx2_flags])
             objs += avx2_lib.extract_objects(sources_avx2)
@@ -263,7 +286,7 @@ foreach l:libraries
             cflags += '-DCC_AVX512_SUPPORT'
             avx512_lib = static_library(libname + '_avx512_lib',
                     sources_avx512,
-                    dependencies: static_deps,
+                    dependencies: static_deps + staged_headers_deps,
                     include_directories: includes,
                     c_args: [cflags, cflags_avx512, cc_avx512_flags])
             objs += avx512_lib.extract_objects(sources_avx512)
@@ -275,12 +298,12 @@ foreach l:libraries
             sources,
             objects: objs,
             c_args: cflags,
-            dependencies: static_deps,
+            dependencies: static_deps + staged_headers_deps,
             include_directories: includes,
             install: true)
     static_dep = declare_dependency(
             include_directories: includes,
-            dependencies: static_deps)
+            dependencies: static_deps + staged_headers_deps)
 
     if is_ms_linker
         link_mode = 'mslinker'
@@ -331,7 +354,7 @@ foreach l:libraries
             sources,
             objects: objs,
             c_args: cflags,
-            dependencies: shared_deps,
+            dependencies: shared_deps + staged_headers_deps,
             include_directories: includes,
             link_args: lk_args,
             link_depends: lk_deps,
@@ -340,7 +363,7 @@ foreach l:libraries
             install: true)
     shared_dep = declare_dependency(link_with: shared_lib,
             include_directories: includes,
-            dependencies: shared_deps)
+            dependencies: shared_deps + staged_headers_deps)
 
     dpdk_libraries = [shared_lib] + dpdk_libraries
     dpdk_static_libraries = [static_lib] + dpdk_static_libraries
diff --git a/meson.build b/meson.build
index 2423884df7..bb21ce7dd4 100644
--- a/meson.build
+++ b/meson.build
@@ -38,6 +38,7 @@ dpdk_static_libraries = []
 dpdk_shared_lib_deps = []
 dpdk_static_lib_deps = []
 dpdk_chkinc_headers = []
+dpdk_chkinc_driver_headers = []
 dpdk_driver_classes = []
 dpdk_drivers = []
 dpdk_extra_ldflags = []
@@ -47,6 +48,8 @@ dpdk_apps_enabled = []
 dpdk_libs_disabled = []
 dpdk_libs_enabled = []
 dpdk_drvs_disabled = []
+staging_dir = []
+drivers_staging_dir = []
 testpmd_drivers_sources = []
 testpmd_drivers_deps = []
 abi_version_file = files('ABI_VERSION')
@@ -73,6 +76,7 @@ global_inc = [include_directories('.', 'config',
 )]
 
 # do configuration and get tool paths
+subdir('staging')
 subdir('buildtools')
 subdir('config')
 
diff --git a/staging/drivers/meson.build b/staging/drivers/meson.build
new file mode 100644
index 0000000000..e29c7c5739
--- /dev/null
+++ b/staging/drivers/meson.build
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2025 Red Hat, Inc.
+
+global_inc += [include_directories('.')]
+drivers_staging_dir = meson.current_build_dir()
diff --git a/staging/meson.build b/staging/meson.build
new file mode 100644
index 0000000000..be13049a7b
--- /dev/null
+++ b/staging/meson.build
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2025 Red Hat, Inc.
+
+global_inc += [include_directories('.')]
+staging_dir = meson.current_build_dir()
+
+subdir('drivers')
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v3 7/7] power: separate public and driver headers
  2025-09-24 17:25 ` [PATCH v3 0/7] " David Marchand
                     ` (5 preceding siblings ...)
  2025-09-24 17:25   ` [PATCH v3 6/7] buildtools/chkincs: use a staging directory for headers David Marchand
@ 2025-09-24 17:25   ` David Marchand
  6 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2025-09-24 17:25 UTC (permalink / raw)
  To: dev; +Cc: Anatoly Burakov, David Hunt, Sivaprasad Tummala

power_cpufreq.h, power_common.h and power_uncore_ops.h look like driver
only headers, but were included from public headers.
Move them to the driver_sdk_headers list.

There is one complication though for power_cpufreq.h as it was included
from a public header rte_power_cpufreq.h.
Move the rte_power_core_capabilities struct definition to the public
header, since a (stable) public symbol relies on it.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/power/meson.build         |  7 +++++--
 lib/power/power_cpufreq.h     | 14 +-------------
 lib/power/power_uncore_ops.h  |  1 +
 lib/power/rte_power_cpufreq.c |  2 +-
 lib/power/rte_power_cpufreq.h | 15 +++++++++++++--
 lib/power/rte_power_uncore.c  |  2 +-
 lib/power/rte_power_uncore.h  |  3 ++-
 7 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/lib/power/meson.build b/lib/power/meson.build
index 56b59071ea..d89fb55514 100644
--- a/lib/power/meson.build
+++ b/lib/power/meson.build
@@ -22,12 +22,15 @@ sources = files(
         'rte_power_uncore.c',
 )
 headers = files(
-        'power_cpufreq.h',
-        'power_uncore_ops.h',
         'rte_power_cpufreq.h',
         'rte_power_pmd_mgmt.h',
         'rte_power_qos.h',
         'rte_power_uncore.h',
 )
+driver_sdk_headers = files(
+        'power_common.h',
+        'power_cpufreq.h',
+        'power_uncore_ops.h',
+)
 
 deps += ['timer', 'ethdev']
diff --git a/lib/power/power_cpufreq.h b/lib/power/power_cpufreq.h
index 92f1ab8f37..fb0b7feb82 100644
--- a/lib/power/power_cpufreq.h
+++ b/lib/power/power_cpufreq.h
@@ -14,6 +14,7 @@
 #include <rte_common.h>
 #include <rte_log.h>
 #include <rte_compat.h>
+#include <rte_power_cpufreq.h>
 
 #define RTE_POWER_DRIVER_NAMESZ 24
 
@@ -131,19 +132,6 @@ typedef int (*rte_power_freq_change_t)(unsigned int lcore_id);
  *  - Negative on error.
  */
 
-/**
- * Power capabilities summary.
- */
-struct rte_power_core_capabilities {
-	union {
-		uint64_t capabilities;
-		struct {
-			uint64_t turbo:1;       /**< Turbo can be enabled. */
-			uint64_t priority:1;    /**< SST-BF high freq core */
-		};
-	};
-};
-
 typedef int (*rte_power_get_capabilities_t)(unsigned int lcore_id,
 			struct rte_power_core_capabilities *caps);
 
diff --git a/lib/power/power_uncore_ops.h b/lib/power/power_uncore_ops.h
index b92af28df9..783860ee5b 100644
--- a/lib/power/power_uncore_ops.h
+++ b/lib/power/power_uncore_ops.h
@@ -13,6 +13,7 @@
 
 #include <rte_compat.h>
 #include <rte_common.h>
+#include <rte_power_uncore.h>
 
 #define RTE_POWER_UNCORE_DRIVER_NAMESZ 24
 
diff --git a/lib/power/rte_power_cpufreq.c b/lib/power/rte_power_cpufreq.c
index d4db03a4e5..f63e976dc2 100644
--- a/lib/power/rte_power_cpufreq.c
+++ b/lib/power/rte_power_cpufreq.c
@@ -6,8 +6,8 @@
 #include <rte_spinlock.h>
 #include <rte_debug.h>
 
-#include "rte_power_cpufreq.h"
 #include "power_common.h"
+#include "power_cpufreq.h"
 
 static enum power_management_env global_default_env = PM_ENV_NOT_SET;
 static struct rte_power_cpufreq_ops *global_cpufreq_ops;
diff --git a/lib/power/rte_power_cpufreq.h b/lib/power/rte_power_cpufreq.h
index 82d274214b..1605ba866a 100644
--- a/lib/power/rte_power_cpufreq.h
+++ b/lib/power/rte_power_cpufreq.h
@@ -14,8 +14,6 @@
 #include <rte_common.h>
 #include <rte_log.h>
 
-#include "power_cpufreq.h"
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -248,6 +246,19 @@ int rte_power_freq_enable_turbo(unsigned int lcore_id);
  */
 int rte_power_freq_disable_turbo(unsigned int lcore_id);
 
+/**
+ * Power capabilities summary.
+ */
+struct rte_power_core_capabilities {
+	union {
+		uint64_t capabilities;
+		struct {
+			uint64_t turbo:1;       /**< Turbo can be enabled. */
+			uint64_t priority:1;    /**< SST-BF high freq core */
+		};
+	};
+};
+
 /**
  * Returns power capabilities for a specific lcore.
  * Function pointer definition. Review each environments
diff --git a/lib/power/rte_power_uncore.c b/lib/power/rte_power_uncore.c
index 30cd374127..25bdb113c5 100644
--- a/lib/power/rte_power_uncore.c
+++ b/lib/power/rte_power_uncore.c
@@ -7,8 +7,8 @@
 #include <rte_spinlock.h>
 #include <rte_debug.h>
 
-#include "rte_power_uncore.h"
 #include "power_common.h"
+#include "power_uncore_ops.h"
 
 static enum rte_uncore_power_mgmt_env global_uncore_env = RTE_UNCORE_PM_ENV_NOT_SET;
 static struct rte_power_uncore_ops *global_uncore_ops;
diff --git a/lib/power/rte_power_uncore.h b/lib/power/rte_power_uncore.h
index dfeade77e9..66aea1b37f 100644
--- a/lib/power/rte_power_uncore.h
+++ b/lib/power/rte_power_uncore.h
@@ -11,7 +11,8 @@
  * Uncore Frequency Management
  */
 
-#include "power_uncore_ops.h"
+#include <rte_compat.h>
+#include <rte_common.h>
 
 #ifdef __cplusplus
 extern "C" {
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v3 4/7] gpudev: fix driver header for Windows
  2025-09-24 17:25   ` [PATCH v3 4/7] gpudev: fix driver header for Windows David Marchand
@ 2025-09-25  7:53     ` Bruce Richardson
  2025-09-25  8:43       ` David Marchand
  0 siblings, 1 reply; 75+ messages in thread
From: Bruce Richardson @ 2025-09-25  7:53 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Elena Agostini, Thomas Monjalon

On Wed, Sep 24, 2025 at 07:25:32PM +0200, David Marchand wrote:
> Use rte_os.h and its RTE_TAILQ_HEAD definition compatible with BSD
> sys/queue.h
> 
> Fixes: 18cb07563165 ("gpudev: add event notification")
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  lib/gpudev/gpudev.c        | 1 +
>  lib/gpudev/gpudev_driver.h | 4 ++--
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/gpudev/gpudev.c b/lib/gpudev/gpudev.c
> index 0473d9ffb3..4a2335834c 100644
> --- a/lib/gpudev/gpudev.c
> +++ b/lib/gpudev/gpudev.c
> @@ -3,6 +3,7 @@
>   */
>  
>  #include <stdlib.h>
> +#include <sys/queue.h>
>  
>  #include <eal_export.h>
>  #include <rte_eal.h>

A bit confused. Why do we add sys/queue.h here but replace it below with
rte_os.h?

> diff --git a/lib/gpudev/gpudev_driver.h b/lib/gpudev/gpudev_driver.h
> index 37b6ae3149..b7621f6e5a 100644
> --- a/lib/gpudev/gpudev_driver.h
> +++ b/lib/gpudev/gpudev_driver.h
> @@ -12,11 +12,11 @@
>  #define RTE_GPUDEV_DRIVER_H
>  
>  #include <stdint.h>
> -#include <sys/queue.h>
>  
>  #include <dev_driver.h>
>  
>  #include <rte_compat.h>
> +#include <rte_os.h>
>  #include "rte_gpudev.h"
>  
>  #ifdef __cplusplus
> @@ -80,7 +80,7 @@ struct __rte_cache_aligned rte_gpu {
>  	/* Driver functions. */
>  	struct rte_gpu_ops ops;
>  	/* Event callback list. */
> -	TAILQ_HEAD(rte_gpu_callback_list, rte_gpu_callback) callbacks;
> +	RTE_TAILQ_HEAD(rte_gpu_callback_list, rte_gpu_callback) callbacks;
>  	/* Current state (used or not) in the running process. */
>  	enum rte_gpu_state process_state; /* Updated by this library. */
>  	/* Driver-specific private data for the running process. */
> -- 
> 2.51.0
> 

^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v3 6/7] buildtools/chkincs: use a staging directory for headers
  2025-09-24 17:25   ` [PATCH v3 6/7] buildtools/chkincs: use a staging directory for headers David Marchand
@ 2025-09-25  8:00     ` Bruce Richardson
  2025-09-25  8:42       ` David Marchand
  0 siblings, 1 reply; 75+ messages in thread
From: Bruce Richardson @ 2025-09-25  8:00 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Thomas Monjalon, Tyler Retzlaff

On Wed, Sep 24, 2025 at 07:25:34PM +0200, David Marchand wrote:
> A problem with the current headers check is that it relies on
> meson dependencies objects that come with their include_directories
> directives, and all of those point at the library / driver sources.
> 
> This means that we won't detect a public header including a private
> (as in, not exported) header, or a driver only header.
> 
> To address this issue, a staging directory is added and every header
> is copied to it.
> 
> Drivers and library headers are staged to two different directories
> and the check is updated accordingly.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>

In general looks ok to me.
One small comment though - can we not have "staging" as a top-level
directory, but instead hide it inside the buildtools directory, or even the
chkincs directory? I dislike having too many subdirectories directly off
the root of the project, especially ones purely for internal tooling.

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

> ---
>  MAINTAINERS                    |  3 +++
>  buildtools/chkincs/meson.build | 41 ++++++++++++++++------------------
>  buildtools/meson.build         |  1 +
>  buildtools/stage-headers.py    | 32 ++++++++++++++++++++++++++
>  drivers/meson.build            | 28 ++++++++++++++++++++---
>  lib/eal/include/meson.build    |  8 +++++++
>  lib/eal/meson.build            | 10 +++++++++
>  lib/meson.build                | 41 ++++++++++++++++++++++++++--------
>  meson.build                    |  4 ++++
>  staging/drivers/meson.build    |  5 +++++
>  staging/meson.build            |  7 ++++++
>  11 files changed, 146 insertions(+), 34 deletions(-)
>  create mode 100644 buildtools/stage-headers.py
>  create mode 100644 staging/drivers/meson.build
>  create mode 100644 staging/meson.build
> 

^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v3 6/7] buildtools/chkincs: use a staging directory for headers
  2025-09-25  8:00     ` Bruce Richardson
@ 2025-09-25  8:42       ` David Marchand
  2025-09-25  9:22         ` Bruce Richardson
  2025-09-25  9:31         ` Bruce Richardson
  0 siblings, 2 replies; 75+ messages in thread
From: David Marchand @ 2025-09-25  8:42 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, Thomas Monjalon, Tyler Retzlaff

Hello Bruce,

On Thu, 25 Sept 2025 at 10:00, Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Wed, Sep 24, 2025 at 07:25:34PM +0200, David Marchand wrote:
> > A problem with the current headers check is that it relies on
> > meson dependencies objects that come with their include_directories
> > directives, and all of those point at the library / driver sources.
> >
> > This means that we won't detect a public header including a private
> > (as in, not exported) header, or a driver only header.
> >
> > To address this issue, a staging directory is added and every header
> > is copied to it.
> >
> > Drivers and library headers are staged to two different directories
> > and the check is updated accordingly.
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
>
> In general looks ok to me.
> One small comment though - can we not have "staging" as a top-level
> directory, but instead hide it inside the buildtools directory, or even the
> chkincs directory? I dislike having too many subdirectories directly off
> the root of the project, especially ones purely for internal tooling.

Well, at first I was trying to change the whole build process iow rely
only on the staging directory and remove all the include_directories:
directives from the declare_dependency() objects.
Libraries and apps were ok, but there were a *lot* of complications
with drivers (what a *huge mess*, especially for NXP drivers with
"compat.h" includes, and Marvell drivers to a smaller extent).
I may retry in the future with some AI tool that will brute force this :-).

For now, I gave up but did not reconsider the location of the staging part.
Moving to buildtools is indeed saner as it is only for the check now,
and I can also make this staging stuff dependent on the check_includes
option now.

I have a strange build error with Windows + clang target that I'll
need to understand (maybe a problem in how we reference DPDK public
headers via "" instead of <>?).


-- 
David Marchand


^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v3 4/7] gpudev: fix driver header for Windows
  2025-09-25  7:53     ` Bruce Richardson
@ 2025-09-25  8:43       ` David Marchand
  0 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2025-09-25  8:43 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, Elena Agostini, Thomas Monjalon

Hello Bruce,

On Thu, 25 Sept 2025 at 09:53, Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Wed, Sep 24, 2025 at 07:25:32PM +0200, David Marchand wrote:
> > Use rte_os.h and its RTE_TAILQ_HEAD definition compatible with BSD
> > sys/queue.h
> >
> > Fixes: 18cb07563165 ("gpudev: add event notification")
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > ---
> >  lib/gpudev/gpudev.c        | 1 +
> >  lib/gpudev/gpudev_driver.h | 4 ++--
> >  2 files changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/lib/gpudev/gpudev.c b/lib/gpudev/gpudev.c
> > index 0473d9ffb3..4a2335834c 100644
> > --- a/lib/gpudev/gpudev.c
> > +++ b/lib/gpudev/gpudev.c
> > @@ -3,6 +3,7 @@
> >   */
> >
> >  #include <stdlib.h>
> > +#include <sys/queue.h>
> >
> >  #include <eal_export.h>
> >  #include <rte_eal.h>
>
> A bit confused. Why do we add sys/queue.h here but replace it below with
> rte_os.h?

I only fixed the minimum possible in the exported header.

To reuse rte_os.h here, I would have to change more code in the
library as this code uses the sys/queue.h API.
(EAL Windows provides one for internal consumption, if you did not
notice, see lib/eal/windows/include).


-- 
David Marchand


^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v3 6/7] buildtools/chkincs: use a staging directory for headers
  2025-09-25  8:42       ` David Marchand
@ 2025-09-25  9:22         ` Bruce Richardson
  2025-09-25 10:29           ` David Marchand
  2025-09-25  9:31         ` Bruce Richardson
  1 sibling, 1 reply; 75+ messages in thread
From: Bruce Richardson @ 2025-09-25  9:22 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Thomas Monjalon, Tyler Retzlaff

On Thu, Sep 25, 2025 at 10:42:47AM +0200, David Marchand wrote:
> Hello Bruce,
> 
> On Thu, 25 Sept 2025 at 10:00, Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > On Wed, Sep 24, 2025 at 07:25:34PM +0200, David Marchand wrote:
> > > A problem with the current headers check is that it relies on meson
> > > dependencies objects that come with their include_directories
> > > directives, and all of those point at the library / driver sources.
> > >
> > > This means that we won't detect a public header including a private
> > > (as in, not exported) header, or a driver only header.
> > >
> > > To address this issue, a staging directory is added and every header
> > > is copied to it.
> > >
> > > Drivers and library headers are staged to two different directories
> > > and the check is updated accordingly.
> > >
> > > Signed-off-by: David Marchand <david.marchand@redhat.com>
> >
> > In general looks ok to me.  One small comment though - can we not have
> > "staging" as a top-level directory, but instead hide it inside the
> > buildtools directory, or even the chkincs directory? I dislike having
> > too many subdirectories directly off the root of the project,
> > especially ones purely for internal tooling.
> 
> Well, at first I was trying to change the whole build process iow rely
> only on the staging directory and remove all the include_directories:
> directives from the declare_dependency() objects.  Libraries and apps
> were ok, but there were a *lot* of complications with drivers (what a
> *huge mess*, especially for NXP drivers with "compat.h" includes, and
> Marvell drivers to a smaller extent).  I may retry in the future with
> some AI tool that will brute force this :-).
> 
One note of caution here: if doing this, you may want to consider using
run_command rather than a custom_target to copy the headers in order to
avoid potentially slowing down the build.

We used to do this copying of header files in the old make build system,
and one downside of it is that it means that the build of ".c" files in one
directory cannot be started until the copying of headers from the dependent
components are completed. The decision to use the include paths in the
dependency objects rather than copying the headers to a central location
was a deliberate decision when moving build system because it means that
when you run "ninja", every single .c file can be compiled to a .o file
in parallel, because all dependent headers are available at their original
locations. For most components, it's only the final link stage that has any
dependencies, the compile commands are all independent.

On the other hand, using run_command is not necessarily a good solution
either, because it means that all changes to the headers require a re-run
of meson, which will also be slower because of all the copying. :-(

Therefore, I'd tend towards keeping things as they are here, in order to
minimise reconfiguration and build times.

/Bruce

^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v3 6/7] buildtools/chkincs: use a staging directory for headers
  2025-09-25  8:42       ` David Marchand
  2025-09-25  9:22         ` Bruce Richardson
@ 2025-09-25  9:31         ` Bruce Richardson
  2025-09-25 10:17           ` Morten Brørup
  2025-09-25 10:22           ` David Marchand
  1 sibling, 2 replies; 75+ messages in thread
From: Bruce Richardson @ 2025-09-25  9:31 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Thomas Monjalon, Tyler Retzlaff

On Thu, Sep 25, 2025 at 10:42:47AM +0200, David Marchand wrote:
> Hello Bruce,
> 
> On Thu, 25 Sept 2025 at 10:00, Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > On Wed, Sep 24, 2025 at 07:25:34PM +0200, David Marchand wrote:
> > > A problem with the current headers check is that it relies on
> > > meson dependencies objects that come with their include_directories
> > > directives, and all of those point at the library / driver sources.
> > >
> > > This means that we won't detect a public header including a private
> > > (as in, not exported) header, or a driver only header.
> > >
> > > To address this issue, a staging directory is added and every header
> > > is copied to it.
> > >
> > > Drivers and library headers are staged to two different directories
> > > and the check is updated accordingly.
> > >
> > > Signed-off-by: David Marchand <david.marchand@redhat.com>
> >
> > In general looks ok to me.
> > One small comment though - can we not have "staging" as a top-level
> > directory, but instead hide it inside the buildtools directory, or even the
> > chkincs directory? I dislike having too many subdirectories directly off
> > the root of the project, especially ones purely for internal tooling.
> 
> Well, at first I was trying to change the whole build process iow rely
> only on the staging directory and remove all the include_directories:
> directives from the declare_dependency() objects.
> Libraries and apps were ok, but there were a *lot* of complications
> with drivers (what a *huge mess*, especially for NXP drivers with
> "compat.h" includes, and Marvell drivers to a smaller extent).
> I may retry in the future with some AI tool that will brute force this :-).
> 
> For now, I gave up but did not reconsider the location of the staging part.
> Moving to buildtools is indeed saner as it is only for the check now,
> and I can also make this staging stuff dependent on the check_includes
> option now.
>

I wonder should we just consider making chkincs an install-time job rather
than a build-time one? We could look to build chkincs using a custom
install script (meson.add_install_script) after the header copies are
already done for us. That should cut down on the complexity within the
build system, but it does mean an additional install step to a temporary
directory to get it to run. However, for use in our CI I don't see why
having an install step with DEST_DIR set to /tmp shouldn't be feasible.

/Bruce

^ permalink raw reply	[flat|nested] 75+ messages in thread

* RE: [PATCH v3 6/7] buildtools/chkincs: use a staging directory for headers
  2025-09-25  9:31         ` Bruce Richardson
@ 2025-09-25 10:17           ` Morten Brørup
  2025-09-25 10:22             ` Bruce Richardson
  2025-09-25 10:22           ` David Marchand
  1 sibling, 1 reply; 75+ messages in thread
From: Morten Brørup @ 2025-09-25 10:17 UTC (permalink / raw)
  To: Bruce Richardson, David Marchand; +Cc: dev, Thomas Monjalon, Tyler Retzlaff

> From: Bruce Richardson [mailto:bruce.richardson@intel.com]
> Sent: Thursday, 25 September 2025 11.32
> 
> On Thu, Sep 25, 2025 at 10:42:47AM +0200, David Marchand wrote:
> > Hello Bruce,
> >
> > On Thu, 25 Sept 2025 at 10:00, Bruce Richardson
> > <bruce.richardson@intel.com> wrote:
> > >
> > > On Wed, Sep 24, 2025 at 07:25:34PM +0200, David Marchand wrote:
> > > > A problem with the current headers check is that it relies on
> > > > meson dependencies objects that come with their
> include_directories
> > > > directives, and all of those point at the library / driver
> sources.
> > > >
> > > > This means that we won't detect a public header including a
> private
> > > > (as in, not exported) header, or a driver only header.
> > > >
> > > > To address this issue, a staging directory is added and every
> header
> > > > is copied to it.
> > > >
> > > > Drivers and library headers are staged to two different
> directories
> > > > and the check is updated accordingly.
> > > >
> > > > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > >
> > > In general looks ok to me.
> > > One small comment though - can we not have "staging" as a top-level
> > > directory, but instead hide it inside the buildtools directory, or
> even the
> > > chkincs directory? I dislike having too many subdirectories
> directly off
> > > the root of the project, especially ones purely for internal
> tooling.
> >
> > Well, at first I was trying to change the whole build process iow
> rely
> > only on the staging directory and remove all the include_directories:
> > directives from the declare_dependency() objects.
> > Libraries and apps were ok, but there were a *lot* of complications
> > with drivers (what a *huge mess*, especially for NXP drivers with
> > "compat.h" includes, and Marvell drivers to a smaller extent).
> > I may retry in the future with some AI tool that will brute force
> this :-).
> >
> > For now, I gave up but did not reconsider the location of the staging
> part.
> > Moving to buildtools is indeed saner as it is only for the check now,
> > and I can also make this staging stuff dependent on the
> check_includes
> > option now.
> >
> 
> I wonder should we just consider making chkincs an install-time job
> rather
> than a build-time one? We could look to build chkincs using a custom
> install script (meson.add_install_script) after the header copies are
> already done for us. That should cut down on the complexity within the
> build system, but it does mean an additional install step to a
> temporary
> directory to get it to run. However, for use in our CI I don't see why
> having an install step with DEST_DIR set to /tmp shouldn't be feasible.

Such a temporary directory should be local to the developer's working directory.
(The CI might have different needs; that's not what I'm commenting.)

Furthermore, test building for upstreaming should remain simple. I use something like:
meson setup -Dplatform=generic -Dcheck_includes=true build
ninja -C build

Disclaimer: Haven't really followed this discussion, so maybe my comments above are irrelevant.


^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v3 6/7] buildtools/chkincs: use a staging directory for headers
  2025-09-25  9:31         ` Bruce Richardson
  2025-09-25 10:17           ` Morten Brørup
@ 2025-09-25 10:22           ` David Marchand
  2025-09-25 10:31             ` Bruce Richardson
  1 sibling, 1 reply; 75+ messages in thread
From: David Marchand @ 2025-09-25 10:22 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, Thomas Monjalon, Tyler Retzlaff

On Thu, 25 Sept 2025 at 11:32, Bruce Richardson
<bruce.richardson@intel.com> wrote:
> > > In general looks ok to me.
> > > One small comment though - can we not have "staging" as a top-level
> > > directory, but instead hide it inside the buildtools directory, or even the
> > > chkincs directory? I dislike having too many subdirectories directly off
> > > the root of the project, especially ones purely for internal tooling.
> >
> > Well, at first I was trying to change the whole build process iow rely
> > only on the staging directory and remove all the include_directories:
> > directives from the declare_dependency() objects.
> > Libraries and apps were ok, but there were a *lot* of complications
> > with drivers (what a *huge mess*, especially for NXP drivers with
> > "compat.h" includes, and Marvell drivers to a smaller extent).
> > I may retry in the future with some AI tool that will brute force this :-).
> >
> > For now, I gave up but did not reconsider the location of the staging part.
> > Moving to buildtools is indeed saner as it is only for the check now,
> > and I can also make this staging stuff dependent on the check_includes
> > option now.
> >
>
> I wonder should we just consider making chkincs an install-time job rather
> than a build-time one? We could look to build chkincs using a custom
> install script (meson.add_install_script) after the header copies are
> already done for us. That should cut down on the complexity within the

Not sure I follow, what would this install script look like?
Is it not similar to the makefile solution I proposed previously?


> build system, but it does mean an additional install step to a temporary
> directory to get it to run. However, for use in our CI I don't see why
> having an install step with DEST_DIR set to /tmp shouldn't be feasible.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v3 6/7] buildtools/chkincs: use a staging directory for headers
  2025-09-25 10:17           ` Morten Brørup
@ 2025-09-25 10:22             ` Bruce Richardson
  0 siblings, 0 replies; 75+ messages in thread
From: Bruce Richardson @ 2025-09-25 10:22 UTC (permalink / raw)
  To: Morten Brørup; +Cc: David Marchand, dev, Thomas Monjalon, Tyler Retzlaff

On Thu, Sep 25, 2025 at 12:17:27PM +0200, Morten Brørup wrote:
> > From: Bruce Richardson [mailto:bruce.richardson@intel.com]
> > Sent: Thursday, 25 September 2025 11.32
> > 
> > On Thu, Sep 25, 2025 at 10:42:47AM +0200, David Marchand wrote:
> > > Hello Bruce,
> > >
> > > On Thu, 25 Sept 2025 at 10:00, Bruce Richardson
> > > <bruce.richardson@intel.com> wrote:
> > > >
> > > > On Wed, Sep 24, 2025 at 07:25:34PM +0200, David Marchand wrote:
> > > > > A problem with the current headers check is that it relies on
> > > > > meson dependencies objects that come with their
> > include_directories
> > > > > directives, and all of those point at the library / driver
> > sources.
> > > > >
> > > > > This means that we won't detect a public header including a
> > private
> > > > > (as in, not exported) header, or a driver only header.
> > > > >
> > > > > To address this issue, a staging directory is added and every
> > header
> > > > > is copied to it.
> > > > >
> > > > > Drivers and library headers are staged to two different
> > directories
> > > > > and the check is updated accordingly.
> > > > >
> > > > > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > > >
> > > > In general looks ok to me.
> > > > One small comment though - can we not have "staging" as a top-level
> > > > directory, but instead hide it inside the buildtools directory, or
> > even the
> > > > chkincs directory? I dislike having too many subdirectories
> > directly off
> > > > the root of the project, especially ones purely for internal
> > tooling.
> > >
> > > Well, at first I was trying to change the whole build process iow
> > rely
> > > only on the staging directory and remove all the include_directories:
> > > directives from the declare_dependency() objects.
> > > Libraries and apps were ok, but there were a *lot* of complications
> > > with drivers (what a *huge mess*, especially for NXP drivers with
> > > "compat.h" includes, and Marvell drivers to a smaller extent).
> > > I may retry in the future with some AI tool that will brute force
> > this :-).
> > >
> > > For now, I gave up but did not reconsider the location of the staging
> > part.
> > > Moving to buildtools is indeed saner as it is only for the check now,
> > > and I can also make this staging stuff dependent on the
> > check_includes
> > > option now.
> > >
> > 
> > I wonder should we just consider making chkincs an install-time job
> > rather
> > than a build-time one? We could look to build chkincs using a custom
> > install script (meson.add_install_script) after the header copies are
> > already done for us. That should cut down on the complexity within the
> > build system, but it does mean an additional install step to a
> > temporary
> > directory to get it to run. However, for use in our CI I don't see why
> > having an install step with DEST_DIR set to /tmp shouldn't be feasible.
> 
> Such a temporary directory should be local to the developer's working directory.
> (The CI might have different needs; that's not what I'm commenting.)
> 
> Furthermore, test building for upstreaming should remain simple. I use something like:
> meson setup -Dplatform=generic -Dcheck_includes=true build
> ninja -C build
> 
Build testing for upstreaming should really be done using
test-meson-builds.sh to test a variety of scenarios and cross-compilation -
including 32-bit - if possible. That script also does a test install, so
running the check_includes from the install step would be automatically
covered there.

/Bruce

^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v3 6/7] buildtools/chkincs: use a staging directory for headers
  2025-09-25  9:22         ` Bruce Richardson
@ 2025-09-25 10:29           ` David Marchand
  2025-09-25 10:31             ` Bruce Richardson
  0 siblings, 1 reply; 75+ messages in thread
From: David Marchand @ 2025-09-25 10:29 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, Thomas Monjalon, Tyler Retzlaff

On Thu, 25 Sept 2025 at 11:22, Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Thu, Sep 25, 2025 at 10:42:47AM +0200, David Marchand wrote:
> > Hello Bruce,
> >
> > On Thu, 25 Sept 2025 at 10:00, Bruce Richardson
> > <bruce.richardson@intel.com> wrote:
> > >
> > > On Wed, Sep 24, 2025 at 07:25:34PM +0200, David Marchand wrote:
> > > > A problem with the current headers check is that it relies on meson
> > > > dependencies objects that come with their include_directories
> > > > directives, and all of those point at the library / driver sources.
> > > >
> > > > This means that we won't detect a public header including a private
> > > > (as in, not exported) header, or a driver only header.
> > > >
> > > > To address this issue, a staging directory is added and every header
> > > > is copied to it.
> > > >
> > > > Drivers and library headers are staged to two different directories
> > > > and the check is updated accordingly.
> > > >
> > > > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > >
> > > In general looks ok to me.  One small comment though - can we not have
> > > "staging" as a top-level directory, but instead hide it inside the
> > > buildtools directory, or even the chkincs directory? I dislike having
> > > too many subdirectories directly off the root of the project,
> > > especially ones purely for internal tooling.
> >
> > Well, at first I was trying to change the whole build process iow rely
> > only on the staging directory and remove all the include_directories:
> > directives from the declare_dependency() objects.  Libraries and apps
> > were ok, but there were a *lot* of complications with drivers (what a
> > *huge mess*, especially for NXP drivers with "compat.h" includes, and
> > Marvell drivers to a smaller extent).  I may retry in the future with
> > some AI tool that will brute force this :-).
> >
> One note of caution here: if doing this, you may want to consider using
> run_command rather than a custom_target to copy the headers in order to
> avoid potentially slowing down the build.
>
> We used to do this copying of header files in the old make build system,
> and one downside of it is that it means that the build of ".c" files in one
> directory cannot be started until the copying of headers from the dependent
> components are completed. The decision to use the include paths in the
> dependency objects rather than copying the headers to a central location
> was a deliberate decision when moving build system because it means that
> when you run "ninja", every single .c file can be compiled to a .o file
> in parallel, because all dependent headers are available at their original
> locations. For most components, it's only the final link stage that has any
> dependencies, the compile commands are all independent.
>
> On the other hand, using run_command is not necessarily a good solution
> either, because it means that all changes to the headers require a re-run
> of meson, which will also be slower because of all the copying. :-(
>
> Therefore, I'd tend towards keeping things as they are here, in order to
> minimise reconfiguration and build times.

I am sticking to the headers check update atm.
The slow down should only concern developers using check_includes,
once I properly gate those deps to the meson option.

Is it still a concern for you?

-- 
David Marchand


^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v3 6/7] buildtools/chkincs: use a staging directory for headers
  2025-09-25 10:29           ` David Marchand
@ 2025-09-25 10:31             ` Bruce Richardson
  0 siblings, 0 replies; 75+ messages in thread
From: Bruce Richardson @ 2025-09-25 10:31 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Thomas Monjalon, Tyler Retzlaff

On Thu, Sep 25, 2025 at 12:29:08PM +0200, David Marchand wrote:
> On Thu, 25 Sept 2025 at 11:22, Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > On Thu, Sep 25, 2025 at 10:42:47AM +0200, David Marchand wrote:
> > > Hello Bruce,
> > >
> > > On Thu, 25 Sept 2025 at 10:00, Bruce Richardson
> > > <bruce.richardson@intel.com> wrote:
> > > >
> > > > On Wed, Sep 24, 2025 at 07:25:34PM +0200, David Marchand wrote:
> > > > > A problem with the current headers check is that it relies on meson
> > > > > dependencies objects that come with their include_directories
> > > > > directives, and all of those point at the library / driver sources.
> > > > >
> > > > > This means that we won't detect a public header including a private
> > > > > (as in, not exported) header, or a driver only header.
> > > > >
> > > > > To address this issue, a staging directory is added and every header
> > > > > is copied to it.
> > > > >
> > > > > Drivers and library headers are staged to two different directories
> > > > > and the check is updated accordingly.
> > > > >
> > > > > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > > >
> > > > In general looks ok to me.  One small comment though - can we not have
> > > > "staging" as a top-level directory, but instead hide it inside the
> > > > buildtools directory, or even the chkincs directory? I dislike having
> > > > too many subdirectories directly off the root of the project,
> > > > especially ones purely for internal tooling.
> > >
> > > Well, at first I was trying to change the whole build process iow rely
> > > only on the staging directory and remove all the include_directories:
> > > directives from the declare_dependency() objects.  Libraries and apps
> > > were ok, but there were a *lot* of complications with drivers (what a
> > > *huge mess*, especially for NXP drivers with "compat.h" includes, and
> > > Marvell drivers to a smaller extent).  I may retry in the future with
> > > some AI tool that will brute force this :-).
> > >
> > One note of caution here: if doing this, you may want to consider using
> > run_command rather than a custom_target to copy the headers in order to
> > avoid potentially slowing down the build.
> >
> > We used to do this copying of header files in the old make build system,
> > and one downside of it is that it means that the build of ".c" files in one
> > directory cannot be started until the copying of headers from the dependent
> > components are completed. The decision to use the include paths in the
> > dependency objects rather than copying the headers to a central location
> > was a deliberate decision when moving build system because it means that
> > when you run "ninja", every single .c file can be compiled to a .o file
> > in parallel, because all dependent headers are available at their original
> > locations. For most components, it's only the final link stage that has any
> > dependencies, the compile commands are all independent.
> >
> > On the other hand, using run_command is not necessarily a good solution
> > either, because it means that all changes to the headers require a re-run
> > of meson, which will also be slower because of all the copying. :-(
> >
> > Therefore, I'd tend towards keeping things as they are here, in order to
> > minimise reconfiguration and build times.
> 
> I am sticking to the headers check update atm.
> The slow down should only concern developers using check_includes,
> once I properly gate those deps to the meson option.
> 
> Is it still a concern for you?
> 
No, no concerns about copying the headers over for check_includes checks,
that makes sense. I'm just flagging a potential issue if you want to switch
back to the old model of copying the headers as part of a normal build.

/Bruce

^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v3 6/7] buildtools/chkincs: use a staging directory for headers
  2025-09-25 10:22           ` David Marchand
@ 2025-09-25 10:31             ` Bruce Richardson
  0 siblings, 0 replies; 75+ messages in thread
From: Bruce Richardson @ 2025-09-25 10:31 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Thomas Monjalon, Tyler Retzlaff

On Thu, Sep 25, 2025 at 12:22:43PM +0200, David Marchand wrote:
> On Thu, 25 Sept 2025 at 11:32, Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> > > > In general looks ok to me.
> > > > One small comment though - can we not have "staging" as a top-level
> > > > directory, but instead hide it inside the buildtools directory, or even the
> > > > chkincs directory? I dislike having too many subdirectories directly off
> > > > the root of the project, especially ones purely for internal tooling.
> > >
> > > Well, at first I was trying to change the whole build process iow rely
> > > only on the staging directory and remove all the include_directories:
> > > directives from the declare_dependency() objects.
> > > Libraries and apps were ok, but there were a *lot* of complications
> > > with drivers (what a *huge mess*, especially for NXP drivers with
> > > "compat.h" includes, and Marvell drivers to a smaller extent).
> > > I may retry in the future with some AI tool that will brute force this :-).
> > >
> > > For now, I gave up but did not reconsider the location of the staging part.
> > > Moving to buildtools is indeed saner as it is only for the check now,
> > > and I can also make this staging stuff dependent on the check_includes
> > > option now.
> > >
> >
> > I wonder should we just consider making chkincs an install-time job rather
> > than a build-time one? We could look to build chkincs using a custom
> > install script (meson.add_install_script) after the header copies are
> > already done for us. That should cut down on the complexity within the
> 
> Not sure I follow, what would this install script look like?
> Is it not similar to the makefile solution I proposed previously?
> 
I don't remember that proposal, sorry, so it may well be something you
proposed previously!

/Bruce

^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v4 0/7] Add a stricter headers check
  2024-11-27 11:26 [RFC 0/6] Add a stricter headers check David Marchand
                   ` (7 preceding siblings ...)
  2025-09-24 17:25 ` [PATCH v3 0/7] " David Marchand
@ 2025-09-25 12:31 ` David Marchand
  2025-09-25 12:31   ` [PATCH v4 1/7] baseband/acc: fix exported header David Marchand
                     ` (6 more replies)
  2025-09-26 12:40 ` [PATCH v5 0/9] Add a stricter headers check David Marchand
  9 siblings, 7 replies; 75+ messages in thread
From: David Marchand @ 2025-09-25 12:31 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson

As explained in patch 6, the current headers check can not catch
issues when a public header includes an internal header.

Patch 1-5 fixes have not been marked as backport material as those bugs
seems minor/easy to fix externally (by either including missing headers,
or enabling enable_driver_sdk option).


-- 
David Marchand

Changes since v3:
- narrowed down the changes under a check on check_includes= option,
- moved the staging directories under buildtools/chkincs,

Changes since v2:
- major rework, dropping the makefile approach, and instead copying
  headers to a staging directory used by the check,
- rebased,
- dropped changes on raw cnxk drivers and disabled the associated
  build warning in the headers check,

David Marchand (7):
  baseband/acc: fix exported header
  drivers: drop export of driver headers
  eventdev: do not include driver header in DMA adapter
  gpudev: fix driver header for Windows
  drivers: fix some exported headers
  buildtools/chkincs: use a staging directory for headers
  power: separate public and driver headers

 MAINTAINERS                                   |  1 +
 buildtools/chkincs/meson.build                | 69 +++++++++++++------
 .../chkincs/staging/drivers/meson.build       |  4 ++
 buildtools/chkincs/staging/meson.build        |  5 ++
 buildtools/meson.build                        |  1 +
 buildtools/stage-headers.py                   | 32 +++++++++
 drivers/baseband/acc/meson.build              |  2 +-
 drivers/bus/vmbus/rte_vmbus_reg.h             |  6 ++
 drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h     |  2 +
 drivers/meson.build                           | 26 ++++++-
 drivers/net/dpaa/rte_pmd_dpaa.h               |  2 +
 drivers/net/intel/iavf/rte_pmd_iavf.h         |  6 ++
 drivers/net/mlx5/rte_pmd_mlx5.h               |  3 +
 drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h |  2 +
 drivers/raw/ntb/rte_pmd_ntb.h                 |  2 +
 lib/bbdev/meson.build                         | 14 ++--
 lib/eal/include/meson.build                   | 10 +++
 lib/eal/meson.build                           | 12 ++++
 lib/ethdev/meson.build                        |  6 +-
 lib/eventdev/rte_event_dma_adapter.h          |  2 +-
 lib/gpudev/gpudev.c                           |  1 +
 lib/gpudev/gpudev_driver.h                    |  4 +-
 lib/meson.build                               | 27 +++++++-
 lib/mldev/meson.build                         |  5 +-
 lib/power/meson.build                         |  7 +-
 lib/power/power_cpufreq.h                     | 14 +---
 lib/power/power_uncore_ops.h                  |  1 +
 lib/power/rte_power_cpufreq.c                 |  2 +-
 lib/power/rte_power_cpufreq.h                 | 15 +++-
 lib/power/rte_power_uncore.c                  |  2 +-
 lib/power/rte_power_uncore.h                  |  3 +-
 lib/rawdev/meson.build                        |  3 +-
 lib/regexdev/meson.build                      |  3 +-
 lib/security/meson.build                      |  3 +-
 meson.build                                   |  8 +++
 35 files changed, 242 insertions(+), 63 deletions(-)
 create mode 100644 buildtools/chkincs/staging/drivers/meson.build
 create mode 100644 buildtools/chkincs/staging/meson.build
 create mode 100644 buildtools/stage-headers.py

-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v4 1/7] baseband/acc: fix exported header
  2025-09-25 12:31 ` [PATCH v4 0/7] Add a stricter headers check David Marchand
@ 2025-09-25 12:31   ` David Marchand
  2025-09-25 12:31   ` [PATCH v4 2/7] drivers: drop export of driver headers David Marchand
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2025-09-25 12:31 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, Nicolas Chautru, Maxime Coquelin

rte_acc_cfg.h relies on rte_acc_common_cfg.h.

Fixes: 32e8b7ea35dd ("baseband/acc100: refactor to segregate common code")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/baseband/acc/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/baseband/acc/meson.build b/drivers/baseband/acc/meson.build
index 64fcf1537a..d9fb947eaa 100644
--- a/drivers/baseband/acc/meson.build
+++ b/drivers/baseband/acc/meson.build
@@ -26,4 +26,4 @@ deps += ['bus_pci']
 
 sources = files('acc_common.c', 'rte_acc100_pmd.c', 'rte_vrb_pmd.c')
 
-headers = files('rte_acc_cfg.h')
+headers = files('rte_acc_cfg.h', 'rte_acc_common_cfg.h')
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v4 2/7] drivers: drop export of driver headers
  2025-09-25 12:31 ` [PATCH v4 0/7] Add a stricter headers check David Marchand
  2025-09-25 12:31   ` [PATCH v4 1/7] baseband/acc: fix exported header David Marchand
@ 2025-09-25 12:31   ` David Marchand
  2025-09-25 12:34     ` [EXTERNAL] " Akhil Goyal
  2025-09-25 12:31   ` [PATCH v4 3/7] eventdev: do not include driver header in DMA adapter David Marchand
                     ` (4 subsequent siblings)
  6 siblings, 1 reply; 75+ messages in thread
From: David Marchand @ 2025-09-25 12:31 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, Andrew Rybchenko, Nicolas Chautru,
	Thomas Monjalon, Srikanth Yalavarthi, Sachin Saxena,
	Hemant Agrawal, Ori Kam, Akhil Goyal, Anoob Joseph

Many classes are exposing driver only headers as public headers.
Move them to the driver_sdk_headers list.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
Changes since v2:
- rebased,

---
 lib/bbdev/meson.build    | 14 +++++++++-----
 lib/ethdev/meson.build   |  6 +++---
 lib/mldev/meson.build    |  5 +----
 lib/rawdev/meson.build   |  3 ++-
 lib/regexdev/meson.build |  3 ++-
 lib/security/meson.build |  3 ++-
 6 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/lib/bbdev/meson.build b/lib/bbdev/meson.build
index 2e48d5f3da..002fc3f1ac 100644
--- a/lib/bbdev/meson.build
+++ b/lib/bbdev/meson.build
@@ -1,10 +1,14 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-sources = files('rte_bbdev.c',
-        'bbdev_trace_points.c')
-headers = files('rte_bbdev.h',
-        'rte_bbdev_pmd.h',
+sources = files(
+        'rte_bbdev.c',
+        'bbdev_trace_points.c',
+)
+headers = files(
+        'rte_bbdev.h',
         'rte_bbdev_op.h',
-        'rte_bbdev_trace_fp.h')
+        'rte_bbdev_trace_fp.h',
+)
+driver_sdk_headers = files('rte_bbdev_pmd.h')
 deps += ['mbuf']
diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build
index f1d2586591..8ba6c708a2 100644
--- a/lib/ethdev/meson.build
+++ b/lib/ethdev/meson.build
@@ -26,11 +26,8 @@ headers = files(
         'rte_ethdev_trace_fp.h',
         'rte_dev_info.h',
         'rte_flow.h',
-        'rte_flow_driver.h',
         'rte_mtr.h',
-        'rte_mtr_driver.h',
         'rte_tm.h',
-        'rte_tm_driver.h',
 )
 
 indirect_headers += files(
@@ -42,6 +39,9 @@ driver_sdk_headers += files(
         'ethdev_driver.h',
         'ethdev_pci.h',
         'ethdev_vdev.h',
+        'rte_flow_driver.h',
+        'rte_mtr_driver.h',
+        'rte_tm_driver.h',
 )
 
 if is_linux
diff --git a/lib/mldev/meson.build b/lib/mldev/meson.build
index 0079ccd205..39f1fba927 100644
--- a/lib/mldev/meson.build
+++ b/lib/mldev/meson.build
@@ -26,11 +26,8 @@ headers = files(
         'rte_mldev.h',
 )
 
-indirect_headers += files(
-        'rte_mldev_core.h',
-)
-
 driver_sdk_headers += files(
+        'rte_mldev_core.h',
         'rte_mldev_pmd.h',
         'mldev_utils.h',
 )
diff --git a/lib/rawdev/meson.build b/lib/rawdev/meson.build
index 7dfc3d5cf9..ccfd922fda 100644
--- a/lib/rawdev/meson.build
+++ b/lib/rawdev/meson.build
@@ -8,6 +8,7 @@ if is_windows
 endif
 
 sources = files('rte_rawdev.c')
-headers = files('rte_rawdev.h', 'rte_rawdev_pmd.h')
+headers = files('rte_rawdev.h')
+driver_sdk_headers = files('rte_rawdev_pmd.h')
 
 deps += ['telemetry']
diff --git a/lib/regexdev/meson.build b/lib/regexdev/meson.build
index 7e12d8cd6d..2684da3825 100644
--- a/lib/regexdev/meson.build
+++ b/lib/regexdev/meson.build
@@ -2,6 +2,7 @@
 # Copyright 2020 Mellanox Technologies, Ltd
 
 sources = files('rte_regexdev.c')
-headers = files('rte_regexdev.h', 'rte_regexdev_driver.h')
+headers = files('rte_regexdev.h')
 indirect_headers += files('rte_regexdev_core.h')
+driver_sdk_headers = files('rte_regexdev_driver.h')
 deps += ['mbuf']
diff --git a/lib/security/meson.build b/lib/security/meson.build
index 1034a7a299..d5431d472c 100644
--- a/lib/security/meson.build
+++ b/lib/security/meson.build
@@ -2,5 +2,6 @@
 # Copyright(c) 2017-2019 Intel Corporation
 
 sources = files('rte_security.c')
-headers = files('rte_security.h', 'rte_security_driver.h')
+headers = files('rte_security.h')
+driver_sdk_headers = files('rte_security_driver.h')
 deps += ['mempool', 'cryptodev', 'net']
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v4 3/7] eventdev: do not include driver header in DMA adapter
  2025-09-25 12:31 ` [PATCH v4 0/7] Add a stricter headers check David Marchand
  2025-09-25 12:31   ` [PATCH v4 1/7] baseband/acc: fix exported header David Marchand
  2025-09-25 12:31   ` [PATCH v4 2/7] drivers: drop export of driver headers David Marchand
@ 2025-09-25 12:31   ` David Marchand
  2025-09-25 12:31   ` [PATCH v4 4/7] gpudev: fix driver header for Windows David Marchand
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2025-09-25 12:31 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, Amit Prakash Shukla, Jerin Jacob

The dma adapter header does not require including rte_dmadev_pmd.h which
is a driver header.

Fixes: 66a30a29387a ("eventdev/dma: introduce DMA adapter")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Amit Prakash Shukla <amitprakashs@marvell.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/eventdev/rte_event_dma_adapter.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eventdev/rte_event_dma_adapter.h b/lib/eventdev/rte_event_dma_adapter.h
index 5c480b82ff..34142f26db 100644
--- a/lib/eventdev/rte_event_dma_adapter.h
+++ b/lib/eventdev/rte_event_dma_adapter.h
@@ -144,7 +144,7 @@
 #include <stdint.h>
 
 #include <rte_common.h>
-#include <rte_dmadev_pmd.h>
+#include <rte_dmadev.h>
 #include <rte_eventdev.h>
 
 #ifdef __cplusplus
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v4 4/7] gpudev: fix driver header for Windows
  2025-09-25 12:31 ` [PATCH v4 0/7] Add a stricter headers check David Marchand
                     ` (2 preceding siblings ...)
  2025-09-25 12:31   ` [PATCH v4 3/7] eventdev: do not include driver header in DMA adapter David Marchand
@ 2025-09-25 12:31   ` David Marchand
  2025-09-25 12:43     ` Bruce Richardson
  2025-09-25 12:31   ` [PATCH v4 5/7] drivers: fix some exported headers David Marchand
                     ` (2 subsequent siblings)
  6 siblings, 1 reply; 75+ messages in thread
From: David Marchand @ 2025-09-25 12:31 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, Elena Agostini, Thomas Monjalon

Use rte_os.h and its RTE_TAILQ_HEAD definition compatible with BSD
sys/queue.h

Fixes: 18cb07563165 ("gpudev: add event notification")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/gpudev/gpudev.c        | 1 +
 lib/gpudev/gpudev_driver.h | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/gpudev/gpudev.c b/lib/gpudev/gpudev.c
index 0473d9ffb3..4a2335834c 100644
--- a/lib/gpudev/gpudev.c
+++ b/lib/gpudev/gpudev.c
@@ -3,6 +3,7 @@
  */
 
 #include <stdlib.h>
+#include <sys/queue.h>
 
 #include <eal_export.h>
 #include <rte_eal.h>
diff --git a/lib/gpudev/gpudev_driver.h b/lib/gpudev/gpudev_driver.h
index 37b6ae3149..b7621f6e5a 100644
--- a/lib/gpudev/gpudev_driver.h
+++ b/lib/gpudev/gpudev_driver.h
@@ -12,11 +12,11 @@
 #define RTE_GPUDEV_DRIVER_H
 
 #include <stdint.h>
-#include <sys/queue.h>
 
 #include <dev_driver.h>
 
 #include <rte_compat.h>
+#include <rte_os.h>
 #include "rte_gpudev.h"
 
 #ifdef __cplusplus
@@ -80,7 +80,7 @@ struct __rte_cache_aligned rte_gpu {
 	/* Driver functions. */
 	struct rte_gpu_ops ops;
 	/* Event callback list. */
-	TAILQ_HEAD(rte_gpu_callback_list, rte_gpu_callback) callbacks;
+	RTE_TAILQ_HEAD(rte_gpu_callback_list, rte_gpu_callback) callbacks;
 	/* Current state (used or not) in the running process. */
 	enum rte_gpu_state process_state; /* Updated by this library. */
 	/* Driver-specific private data for the running process. */
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v4 5/7] drivers: fix some exported headers
  2025-09-25 12:31 ` [PATCH v4 0/7] Add a stricter headers check David Marchand
                     ` (3 preceding siblings ...)
  2025-09-25 12:31   ` [PATCH v4 4/7] gpudev: fix driver header for Windows David Marchand
@ 2025-09-25 12:31   ` David Marchand
  2025-09-25 12:44     ` Bruce Richardson
  2025-09-25 12:31   ` [PATCH v4 6/7] buildtools/chkincs: use a staging directory for headers David Marchand
  2025-09-25 12:31   ` [PATCH v4 7/7] power: separate public and driver headers David Marchand
  6 siblings, 1 reply; 75+ messages in thread
From: David Marchand @ 2025-09-25 12:31 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, Long Li, Wei Hu, Ankur Dwivedi, Anoob Joseph,
	Tejasree Kondoj, Hemant Agrawal, Sachin Saxena,
	Vladimir Medvedkin, Dariusz Sosnowski, Viacheslav Ovsiienko,
	Bing Zhao, Ori Kam, Suanming Mou, Matan Azrad, Gagandeep Singh,
	Jingjing Wu, Stephen Hemminger, Akhil Goyal, Haiyue Wang,
	Jeff Guo, Michael Baum, Nipun Gupta, Shreyansh Jain, Xiaoyun Li

Those headers could not be included individually as they were not
including their dependencies, were subject to some build warnings,
or were not compiling on Windows.

Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
Fixes: 5b2a1a02dcaf ("crypto/cnxk: fix experimental version for PMD API")
Fixes: e5abbeeeefa5 ("crypto/cnxk: add PMD API for getting CPTR")
Fixes: 3ca607402c4d ("crypto/cnxk: add PMD API to flush CTX")
Fixes: 8c3495f5d2dd ("net/dpaa: support loopback API")
Fixes: 12b435bf8f2f ("net/iavf: support flex desc metadata extraction")
Fixes: 23f627e0ed28 ("net/mlx5: add flow sync API")
Fixes: f5177bdc8b76 ("net/mlx5: add GENEVE TLV options parser API")
Fixes: 53c71586c789 ("raw/dpaa2_cmdif: support enqueue/dequeue operations")
Fixes: c39d1e082a4b ("raw/ntb: setup queues")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changes since v2:
- rebased,
- dropped changes on raw/cnxk drivers,

---
 drivers/bus/vmbus/rte_vmbus_reg.h             | 6 ++++++
 drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h     | 2 ++
 drivers/net/dpaa/rte_pmd_dpaa.h               | 2 ++
 drivers/net/intel/iavf/rte_pmd_iavf.h         | 6 ++++++
 drivers/net/mlx5/rte_pmd_mlx5.h               | 3 +++
 drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h | 2 ++
 drivers/raw/ntb/rte_pmd_ntb.h                 | 2 ++
 7 files changed, 23 insertions(+)

diff --git a/drivers/bus/vmbus/rte_vmbus_reg.h b/drivers/bus/vmbus/rte_vmbus_reg.h
index fb7e3043ec..6370a07f95 100644
--- a/drivers/bus/vmbus/rte_vmbus_reg.h
+++ b/drivers/bus/vmbus/rte_vmbus_reg.h
@@ -6,6 +6,12 @@
 #ifndef _VMBUS_REG_H_
 #define _VMBUS_REG_H_
 
+#include <stdint.h>
+
+#include <rte_common.h>
+#include <rte_stdatomic.h>
+#include <rte_uuid.h>
+
 /*
  * Hyper-V SynIC message format.
  */
diff --git a/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h b/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
index 46861ab2cf..70c019e94c 100644
--- a/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
+++ b/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
@@ -11,8 +11,10 @@
 #ifndef _PMD_CNXK_CRYPTO_H_
 #define _PMD_CNXK_CRYPTO_H_
 
+#include <stdbool.h>
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_crypto.h>
 #include <rte_security.h>
 
diff --git a/drivers/net/dpaa/rte_pmd_dpaa.h b/drivers/net/dpaa/rte_pmd_dpaa.h
index ec45633ba2..0a57e2097a 100644
--- a/drivers/net/dpaa/rte_pmd_dpaa.h
+++ b/drivers/net/dpaa/rte_pmd_dpaa.h
@@ -5,6 +5,8 @@
 #ifndef _PMD_DPAA_H_
 #define _PMD_DPAA_H_
 
+#include <stdint.h>
+
 /**
  * @file rte_pmd_dpaa.h
  *
diff --git a/drivers/net/intel/iavf/rte_pmd_iavf.h b/drivers/net/intel/iavf/rte_pmd_iavf.h
index 56d453fc4c..04b86a5dd7 100644
--- a/drivers/net/intel/iavf/rte_pmd_iavf.h
+++ b/drivers/net/intel/iavf/rte_pmd_iavf.h
@@ -15,6 +15,7 @@
  */
 
 #include <stdio.h>
+
 #include <rte_compat.h>
 #include <rte_mbuf.h>
 #include <rte_mbuf_dyn.h>
@@ -184,6 +185,7 @@ __rte_experimental
 static inline void
 rte_pmd_ifd_dump_proto_xtr_metadata(struct rte_mbuf *m)
 {
+#ifdef ALLOW_EXPERIMENTAL_API
 	union rte_pmd_ifd_proto_xtr_metadata data;
 
 	if (!rte_pmd_ifd_dynf_proto_xtr_metadata_avail())
@@ -243,6 +245,10 @@ rte_pmd_ifd_dump_proto_xtr_metadata(struct rte_mbuf *m)
 	else if (m->ol_flags & RTE_IAVF_PKT_RX_DYNF_PROTO_XTR_IP_OFFSET)
 		printf(" - Flexible descriptor's Extraction: ip_offset=%u",
 		       data.ip_ofs);
+#else
+	RTE_SET_USED(m);
+	RTE_VERIFY(false);
+#endif
 }
 
 #ifdef __cplusplus
diff --git a/drivers/net/mlx5/rte_pmd_mlx5.h b/drivers/net/mlx5/rte_pmd_mlx5.h
index fdd2f65888..f2c6aebe0b 100644
--- a/drivers/net/mlx5/rte_pmd_mlx5.h
+++ b/drivers/net/mlx5/rte_pmd_mlx5.h
@@ -5,6 +5,9 @@
 #ifndef RTE_PMD_PRIVATE_MLX5_H_
 #define RTE_PMD_PRIVATE_MLX5_H_
 
+#include <stdint.h>
+
+#include <rte_byteorder.h>
 #include <rte_compat.h>
 
 /**
diff --git a/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h b/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h
index 483b66eaae..7731fc6363 100644
--- a/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h
+++ b/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h
@@ -12,6 +12,8 @@
  *
  */
 
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/drivers/raw/ntb/rte_pmd_ntb.h b/drivers/raw/ntb/rte_pmd_ntb.h
index 6591ce7931..76da3be026 100644
--- a/drivers/raw/ntb/rte_pmd_ntb.h
+++ b/drivers/raw/ntb/rte_pmd_ntb.h
@@ -5,6 +5,8 @@
 #ifndef _RTE_PMD_NTB_H_
 #define _RTE_PMD_NTB_H_
 
+#include <stdint.h>
+
 /* App needs to set/get these attrs */
 #define NTB_QUEUE_SZ_NAME           "queue_size"
 #define NTB_QUEUE_NUM_NAME          "queue_num"
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v4 6/7] buildtools/chkincs: use a staging directory for headers
  2025-09-25 12:31 ` [PATCH v4 0/7] Add a stricter headers check David Marchand
                     ` (4 preceding siblings ...)
  2025-09-25 12:31   ` [PATCH v4 5/7] drivers: fix some exported headers David Marchand
@ 2025-09-25 12:31   ` David Marchand
  2025-09-25 14:46     ` Bruce Richardson
  2025-09-25 12:31   ` [PATCH v4 7/7] power: separate public and driver headers David Marchand
  6 siblings, 1 reply; 75+ messages in thread
From: David Marchand @ 2025-09-25 12:31 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, Thomas Monjalon, Tyler Retzlaff

A problem with the current headers check is that it relies on
meson dependencies objects that come with their include_directories
directives, and all of those point at the library / driver sources.

This means that we won't detect a public header including a private
(as in, not exported) header, or a driver only header.

To address this issue, a staging directory is added and every header
is copied to it.

Drivers and library headers are staged to two different directories
and the check is updated accordingly.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changes since v3:
- removed update of global_inc (which was unneeded, and probably was
  what triggered a Windows clang build issue reported by CI),
- moved all staging operations under a check on check_includes= option,
- moved staging directories under buildtools/chkincs/,
- renamed all variables to reflect those concern the headers check,
- made chkincs binaries depend on staging deps instead of having the
  libraries/drivers depend on them,
- added C++ check for driver headers (missed in v3),


---
 MAINTAINERS                                   |  1 +
 buildtools/chkincs/meson.build                | 69 +++++++++++++------
 .../chkincs/staging/drivers/meson.build       |  4 ++
 buildtools/chkincs/staging/meson.build        |  5 ++
 buildtools/meson.build                        |  1 +
 buildtools/stage-headers.py                   | 32 +++++++++
 drivers/meson.build                           | 26 ++++++-
 lib/eal/include/meson.build                   | 10 +++
 lib/eal/meson.build                           | 12 ++++
 lib/meson.build                               | 27 +++++++-
 meson.build                                   |  8 +++
 11 files changed, 171 insertions(+), 24 deletions(-)
 create mode 100644 buildtools/chkincs/staging/drivers/meson.build
 create mode 100644 buildtools/chkincs/staging/meson.build
 create mode 100644 buildtools/stage-headers.py

diff --git a/MAINTAINERS b/MAINTAINERS
index 1a2729be66..76672b67c9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -131,6 +131,7 @@ F: buildtools/get-numa-count.py
 F: buildtools/list-dir-globs.py
 F: buildtools/map-list-symbol.sh
 F: buildtools/pkg-config/
+F: buildtools/stage-headers.py
 F: buildtools/symlink-drivers-solibs.sh
 F: buildtools/symlink-drivers-solibs.py
 F: devtools/test-meson-builds.sh
diff --git a/buildtools/chkincs/meson.build b/buildtools/chkincs/meson.build
index 49dbc55254..376556f5f4 100644
--- a/buildtools/chkincs/meson.build
+++ b/buildtools/chkincs/meson.build
@@ -12,38 +12,47 @@ gen_c_files = generator(gen_c_file_for_header,
         arguments: ['@INPUT@', '@OUTPUT@'])
 
 cflags = machine_args
+cflags += '-Wno-missing-field-initializers'
 cflags += no_wvla_cflag
+cflags += '-I' + dpdk_source_root + '/config'
+cflags += '-I' + dpdk_build_root
+cflags += '-I' + dpdk_chkinc_staging_dir
 
 sources = files('main.c')
 sources += gen_c_files.process(dpdk_chkinc_headers)
 
-# some driver SDK headers depend on these two buses, which are mandatory in build
-# so we always include them in deps list
-deps = [get_variable('shared_rte_bus_vdev'), get_variable('shared_rte_bus_pci')]
-if dpdk_conf.has('RTE_BUS_VMBUS')
-    deps += get_variable('shared_rte_bus_vmbus')
-endif
-# add the rest of the libs to the dependencies
-foreach l:dpdk_libs_enabled
-    deps += get_variable('shared_rte_' + l)
-endforeach
+cflags_drivers = '-I' + dpdk_chkinc_drivers_staging_dir
+sources_drivers = files('main.c')
+sources_drivers += gen_c_files.process(dpdk_chkinc_drivers_headers)
 
 executable('chkincs', sources,
         c_args: cflags,
-        include_directories: includes,
-        dependencies: deps,
+        dependencies: dpdk_chkinc_staging_deps,
         install: false)
 
 executable('chkincs-exp', sources,
         c_args: [cflags, '-DALLOW_EXPERIMENTAL_API'],
-        include_directories: includes,
-        dependencies: deps,
+        dependencies: dpdk_chkinc_staging_deps,
         install: false)
 
 executable('chkincs-all', sources,
         c_args: [cflags, '-DALLOW_EXPERIMENTAL_API', '-DALLOW_INTERNAL_API'],
-        include_directories: includes,
-        dependencies: deps,
+        dependencies: dpdk_chkinc_staging_deps,
+        install: false)
+
+executable('chkincs-drv', sources_drivers,
+        c_args: [cflags, cflags_drivers],
+        dependencies: dpdk_chkinc_staging_deps + dpdk_chkinc_drivers_staging_deps,
+        install: false)
+
+executable('chkincs-drv-exp', sources_drivers,
+        c_args: [cflags, cflags_drivers, '-DALLOW_EXPERIMENTAL_API'],
+        dependencies: dpdk_chkinc_staging_deps + dpdk_chkinc_drivers_staging_deps,
+        install: false)
+
+executable('chkincs-drv-all', sources_drivers,
+        c_args: [cflags, cflags_drivers, '-DALLOW_EXPERIMENTAL_API', '-DALLOW_INTERNAL_API'],
+        dependencies: dpdk_chkinc_staging_deps + dpdk_chkinc_drivers_staging_deps,
         install: false)
 
 # run tests for c++ builds also
@@ -58,21 +67,37 @@ gen_cpp_files = generator(gen_c_file_for_header,
 cpp_sources = files('main.cpp')
 cpp_sources += gen_cpp_files.process(dpdk_chkinc_headers)
 
+cpp_sources_drivers = files('main.cpp')
+cpp_sources_drivers += gen_cpp_files.process(dpdk_chkinc_drivers_headers)
+
 executable('chkincs-cpp', cpp_sources,
         cpp_args: ['-include', 'rte_config.h', cflags],
-        include_directories: includes,
-        dependencies: deps,
+        dependencies: dpdk_chkinc_staging_deps,
         install: false)
 
 executable('chkincs-cpp-exp', cpp_sources,
         cpp_args: ['-include', 'rte_config.h', cflags, '-DALLOW_EXPERIMENTAL_API'],
-        include_directories: includes,
-        dependencies: deps,
+        dependencies: dpdk_chkinc_staging_deps,
         install: false)
 
 executable('chkincs-cpp-all', cpp_sources,
         cpp_args: ['-include', 'rte_config.h', cflags, '-DALLOW_EXPERIMENTAL_API',
                    '-DALLOW_INTERNAL_API'],
-        include_directories: includes,
-        dependencies: deps,
+        dependencies: dpdk_chkinc_staging_deps,
+        install: false)
+
+executable('chkincs-drv-cpp', cpp_sources_drivers,
+        cpp_args: ['-include', 'rte_config.h', cflags, cflags_drivers],
+        dependencies: dpdk_chkinc_staging_deps + dpdk_chkinc_drivers_staging_deps,
+        install: false)
+
+executable('chkincs-drv-cpp-exp', cpp_sources_drivers,
+        cpp_args: ['-include', 'rte_config.h', cflags, cflags_drivers, '-DALLOW_EXPERIMENTAL_API'],
+        dependencies: dpdk_chkinc_staging_deps + dpdk_chkinc_drivers_staging_deps,
+        install: false)
+
+executable('chkincs-drv-cpp-all', cpp_sources_drivers,
+        cpp_args: ['-include', 'rte_config.h', cflags, cflags_drivers, '-DALLOW_EXPERIMENTAL_API',
+                   '-DALLOW_INTERNAL_API'],
+        dependencies: dpdk_chkinc_staging_deps + dpdk_chkinc_drivers_staging_deps,
         install: false)
diff --git a/buildtools/chkincs/staging/drivers/meson.build b/buildtools/chkincs/staging/drivers/meson.build
new file mode 100644
index 0000000000..b19b1c0908
--- /dev/null
+++ b/buildtools/chkincs/staging/drivers/meson.build
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2025 Red Hat, Inc.
+
+dpdk_chkinc_drivers_staging_dir = meson.current_build_dir()
diff --git a/buildtools/chkincs/staging/meson.build b/buildtools/chkincs/staging/meson.build
new file mode 100644
index 0000000000..0b05656330
--- /dev/null
+++ b/buildtools/chkincs/staging/meson.build
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2025 Red Hat, Inc.
+
+dpdk_chkinc_staging_dir = meson.current_build_dir()
+subdir('drivers')
diff --git a/buildtools/meson.build b/buildtools/meson.build
index 32cea7cff7..561236e0af 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -27,6 +27,7 @@ get_min_meson_version_cmd = py3 + files('get-min-meson-version.py')
 get_test_suites_cmd = py3 + files('get-test-suites.py')
 header_gen_cmd = py3 + files('gen-header.py')
 has_hugepages_cmd = py3 + files('has-hugepages.py')
+stage_headers_cmd = py3 + files('stage-headers.py')
 cmdline_gen_cmd = py3 + files('dpdk-cmdline-gen.py')
 check_dts_requirements = py3 + files('check-dts-requirements.py')
 
diff --git a/buildtools/stage-headers.py b/buildtools/stage-headers.py
new file mode 100644
index 0000000000..3057c6a26f
--- /dev/null
+++ b/buildtools/stage-headers.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2025 Red Hat, Inc.
+
+"""
+Headers staging script for DPDK build system.
+"""
+
+import sys
+import os
+import shutil
+from pathlib import Path
+
+def main():
+    if len(sys.argv) < 4:
+        print("Usage: stage-headers.py <staging_dir> <meson_stamp> [headers...]")
+        sys.exit(1)
+
+    staging_dir = Path(sys.argv[1])
+    meson_stamp = Path(sys.argv[2])
+    headers = sys.argv[3:]
+
+    staging_dir.mkdir(parents=True, exist_ok=True)
+
+    for header in headers:
+        file = Path(header)
+        shutil.copy2(file, staging_dir / file.name)
+
+    meson_stamp.touch()
+
+if __name__ == "__main__":
+    main()
diff --git a/drivers/meson.build b/drivers/meson.build
index f25f425565..dae1e83ca4 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -245,7 +245,31 @@ foreach subpath:subdirs
         if get_option('enable_driver_sdk')
             install_headers(driver_sdk_headers)
         endif
-        dpdk_chkinc_headers += driver_sdk_headers
+        dpdk_chkinc_headers += headers
+        dpdk_chkinc_drivers_headers += driver_sdk_headers
+
+        if get_option('check_includes')
+            if headers.length() > 0
+                dpdk_chkinc_staging_deps += declare_dependency(sources:
+                        custom_target(lib_name + '_header_staging',
+                                output: lib_name + '_header_staging.stamp',
+                                command: [stage_headers_cmd, dpdk_chkinc_staging_dir, '@OUTPUT@',
+                                    headers],
+                                install: false,
+                        )
+                )
+            endif
+            if driver_sdk_headers.length() > 0
+                dpdk_chkinc_drivers_staging_deps += declare_dependency(sources:
+                        custom_target(lib_name + '_driver_header_staging',
+                                output: lib_name + '_driver_header_staging.stamp',
+                                command: [stage_headers_cmd, dpdk_chkinc_drivers_staging_dir,
+                                    '@OUTPUT@', driver_sdk_headers],
+                                install: false,
+                        )
+                )
+            endif
+        endif
 
         if headers.length() > 0
             dpdk_includes += include_directories(drv_path)
diff --git a/lib/eal/include/meson.build b/lib/eal/include/meson.build
index d903577caa..92aa1c885d 100644
--- a/lib/eal/include/meson.build
+++ b/lib/eal/include/meson.build
@@ -79,3 +79,13 @@ generic_headers = files(
         'generic/rte_vect.h',
 )
 install_headers(generic_headers, subdir: 'generic')
+if get_option('check_includes')
+    dpdk_chkinc_staging_deps += declare_dependency(sources:
+            custom_target('eal_generic_header_staging',
+                    output: 'eal_generic_header_staging.stamp',
+                    command: [stage_headers_cmd, join_paths(dpdk_chkinc_staging_dir, 'generic'),
+                        '@OUTPUT@', generic_headers],
+                    install: false,
+            )
+    )
+endif
diff --git a/lib/eal/meson.build b/lib/eal/meson.build
index e1d6c4cf17..4ffd048ab1 100644
--- a/lib/eal/meson.build
+++ b/lib/eal/meson.build
@@ -12,7 +12,19 @@ endif
 
 subdir(exec_env)
 
+arch_headers = []
+arch_indirect_headers = []
 subdir(arch_subdir)
+if get_option('check_includes')
+    dpdk_chkinc_staging_deps += declare_dependency(sources:
+            custom_target('eal_arch_header_staging',
+                    output: 'eal_arch_header_staging.stamp',
+                    command: [stage_headers_cmd, dpdk_chkinc_staging_dir, '@OUTPUT@',
+                        arch_headers + arch_indirect_headers],
+                    install: false,
+            )
+    )
+endif
 
 deps += ['log', 'kvargs']
 if not is_windows
diff --git a/lib/meson.build b/lib/meson.build
index a67efaf718..34f930f12e 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -214,7 +214,32 @@ foreach l:libraries
         install_headers(driver_sdk_headers)
     endif
     dpdk_chkinc_headers += headers
-    dpdk_chkinc_headers += driver_sdk_headers
+    dpdk_chkinc_drivers_headers += driver_sdk_headers
+
+    if get_option('check_includes')
+        lib_headers = headers + indirect_headers
+        if lib_headers.length() != 0
+            dpdk_chkinc_staging_deps += declare_dependency(sources:
+                    custom_target(l + '_header_staging',
+                            output: l + '_header_staging.stamp',
+                            command: [stage_headers_cmd, dpdk_chkinc_staging_dir, '@OUTPUT@',
+                                lib_headers],
+                            install: false,
+                    )
+            )
+        endif
+
+        if driver_sdk_headers.length() != 0
+            dpdk_chkinc_drivers_staging_deps += declare_dependency(sources:
+                    custom_target(l + '_driver_header_staging',
+                            output: l + '_driver_header_staging.stamp',
+                            command: [stage_headers_cmd, dpdk_chkinc_drivers_staging_dir,
+                                '@OUTPUT@', driver_sdk_headers],
+                            install: false,
+                    )
+            )
+        endif
+    endif
 
     libname = 'rte_' + name
     includes += include_directories(l)
diff --git a/meson.build b/meson.build
index 2423884df7..82498bcf54 100644
--- a/meson.build
+++ b/meson.build
@@ -38,6 +38,11 @@ dpdk_static_libraries = []
 dpdk_shared_lib_deps = []
 dpdk_static_lib_deps = []
 dpdk_chkinc_headers = []
+dpdk_chkinc_staging_dir = []
+dpdk_chkinc_staging_deps = []
+dpdk_chkinc_drivers_headers = []
+dpdk_chkinc_drivers_staging_dir = []
+dpdk_chkinc_drivers_staging_deps = []
 dpdk_driver_classes = []
 dpdk_drivers = []
 dpdk_extra_ldflags = []
@@ -74,6 +79,9 @@ global_inc = [include_directories('.', 'config',
 
 # do configuration and get tool paths
 subdir('buildtools')
+if get_option('check_includes')
+    subdir('buildtools/chkincs/staging')
+endif
 subdir('config')
 
 if is_linux
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v4 7/7] power: separate public and driver headers
  2025-09-25 12:31 ` [PATCH v4 0/7] Add a stricter headers check David Marchand
                     ` (5 preceding siblings ...)
  2025-09-25 12:31   ` [PATCH v4 6/7] buildtools/chkincs: use a staging directory for headers David Marchand
@ 2025-09-25 12:31   ` David Marchand
  6 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2025-09-25 12:31 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, Anatoly Burakov, David Hunt, Sivaprasad Tummala

power_cpufreq.h, power_common.h and power_uncore_ops.h look like driver
only headers, but were included from public headers.
Move them to the driver_sdk_headers list.

There is one complication though for power_cpufreq.h as it was included
from a public header rte_power_cpufreq.h.
Move the rte_power_core_capabilities struct definition to the public
header, since a (stable) public symbol relies on it.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/power/meson.build         |  7 +++++--
 lib/power/power_cpufreq.h     | 14 +-------------
 lib/power/power_uncore_ops.h  |  1 +
 lib/power/rte_power_cpufreq.c |  2 +-
 lib/power/rte_power_cpufreq.h | 15 +++++++++++++--
 lib/power/rte_power_uncore.c  |  2 +-
 lib/power/rte_power_uncore.h  |  3 ++-
 7 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/lib/power/meson.build b/lib/power/meson.build
index 56b59071ea..d89fb55514 100644
--- a/lib/power/meson.build
+++ b/lib/power/meson.build
@@ -22,12 +22,15 @@ sources = files(
         'rte_power_uncore.c',
 )
 headers = files(
-        'power_cpufreq.h',
-        'power_uncore_ops.h',
         'rte_power_cpufreq.h',
         'rte_power_pmd_mgmt.h',
         'rte_power_qos.h',
         'rte_power_uncore.h',
 )
+driver_sdk_headers = files(
+        'power_common.h',
+        'power_cpufreq.h',
+        'power_uncore_ops.h',
+)
 
 deps += ['timer', 'ethdev']
diff --git a/lib/power/power_cpufreq.h b/lib/power/power_cpufreq.h
index 92f1ab8f37..fb0b7feb82 100644
--- a/lib/power/power_cpufreq.h
+++ b/lib/power/power_cpufreq.h
@@ -14,6 +14,7 @@
 #include <rte_common.h>
 #include <rte_log.h>
 #include <rte_compat.h>
+#include <rte_power_cpufreq.h>
 
 #define RTE_POWER_DRIVER_NAMESZ 24
 
@@ -131,19 +132,6 @@ typedef int (*rte_power_freq_change_t)(unsigned int lcore_id);
  *  - Negative on error.
  */
 
-/**
- * Power capabilities summary.
- */
-struct rte_power_core_capabilities {
-	union {
-		uint64_t capabilities;
-		struct {
-			uint64_t turbo:1;       /**< Turbo can be enabled. */
-			uint64_t priority:1;    /**< SST-BF high freq core */
-		};
-	};
-};
-
 typedef int (*rte_power_get_capabilities_t)(unsigned int lcore_id,
 			struct rte_power_core_capabilities *caps);
 
diff --git a/lib/power/power_uncore_ops.h b/lib/power/power_uncore_ops.h
index b92af28df9..783860ee5b 100644
--- a/lib/power/power_uncore_ops.h
+++ b/lib/power/power_uncore_ops.h
@@ -13,6 +13,7 @@
 
 #include <rte_compat.h>
 #include <rte_common.h>
+#include <rte_power_uncore.h>
 
 #define RTE_POWER_UNCORE_DRIVER_NAMESZ 24
 
diff --git a/lib/power/rte_power_cpufreq.c b/lib/power/rte_power_cpufreq.c
index d4db03a4e5..f63e976dc2 100644
--- a/lib/power/rte_power_cpufreq.c
+++ b/lib/power/rte_power_cpufreq.c
@@ -6,8 +6,8 @@
 #include <rte_spinlock.h>
 #include <rte_debug.h>
 
-#include "rte_power_cpufreq.h"
 #include "power_common.h"
+#include "power_cpufreq.h"
 
 static enum power_management_env global_default_env = PM_ENV_NOT_SET;
 static struct rte_power_cpufreq_ops *global_cpufreq_ops;
diff --git a/lib/power/rte_power_cpufreq.h b/lib/power/rte_power_cpufreq.h
index 82d274214b..1605ba866a 100644
--- a/lib/power/rte_power_cpufreq.h
+++ b/lib/power/rte_power_cpufreq.h
@@ -14,8 +14,6 @@
 #include <rte_common.h>
 #include <rte_log.h>
 
-#include "power_cpufreq.h"
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -248,6 +246,19 @@ int rte_power_freq_enable_turbo(unsigned int lcore_id);
  */
 int rte_power_freq_disable_turbo(unsigned int lcore_id);
 
+/**
+ * Power capabilities summary.
+ */
+struct rte_power_core_capabilities {
+	union {
+		uint64_t capabilities;
+		struct {
+			uint64_t turbo:1;       /**< Turbo can be enabled. */
+			uint64_t priority:1;    /**< SST-BF high freq core */
+		};
+	};
+};
+
 /**
  * Returns power capabilities for a specific lcore.
  * Function pointer definition. Review each environments
diff --git a/lib/power/rte_power_uncore.c b/lib/power/rte_power_uncore.c
index 30cd374127..25bdb113c5 100644
--- a/lib/power/rte_power_uncore.c
+++ b/lib/power/rte_power_uncore.c
@@ -7,8 +7,8 @@
 #include <rte_spinlock.h>
 #include <rte_debug.h>
 
-#include "rte_power_uncore.h"
 #include "power_common.h"
+#include "power_uncore_ops.h"
 
 static enum rte_uncore_power_mgmt_env global_uncore_env = RTE_UNCORE_PM_ENV_NOT_SET;
 static struct rte_power_uncore_ops *global_uncore_ops;
diff --git a/lib/power/rte_power_uncore.h b/lib/power/rte_power_uncore.h
index dfeade77e9..66aea1b37f 100644
--- a/lib/power/rte_power_uncore.h
+++ b/lib/power/rte_power_uncore.h
@@ -11,7 +11,8 @@
  * Uncore Frequency Management
  */
 
-#include "power_uncore_ops.h"
+#include <rte_compat.h>
+#include <rte_common.h>
 
 #ifdef __cplusplus
 extern "C" {
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* RE: [EXTERNAL] [PATCH v4 2/7] drivers: drop export of driver headers
  2025-09-25 12:31   ` [PATCH v4 2/7] drivers: drop export of driver headers David Marchand
@ 2025-09-25 12:34     ` Akhil Goyal
  0 siblings, 0 replies; 75+ messages in thread
From: Akhil Goyal @ 2025-09-25 12:34 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: bruce.richardson, Andrew Rybchenko, Nicolas Chautru,
	Thomas Monjalon, Srikanth Yalavarthi, Sachin Saxena,
	Hemant Agrawal, Ori Kam, Anoob Joseph

> Many classes are exposing driver only headers as public headers.
> Move them to the driver_sdk_headers list.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> ---
> Changes since v2:
> - rebased,
> 
Acked-by: Akhil Goyal <gakhil@marvell.com>

^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v4 4/7] gpudev: fix driver header for Windows
  2025-09-25 12:31   ` [PATCH v4 4/7] gpudev: fix driver header for Windows David Marchand
@ 2025-09-25 12:43     ` Bruce Richardson
  0 siblings, 0 replies; 75+ messages in thread
From: Bruce Richardson @ 2025-09-25 12:43 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Elena Agostini, Thomas Monjalon

On Thu, Sep 25, 2025 at 02:31:46PM +0200, David Marchand wrote:
> Use rte_os.h and its RTE_TAILQ_HEAD definition compatible with BSD
> sys/queue.h
> 
> Fixes: 18cb07563165 ("gpudev: add event notification")
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  lib/gpudev/gpudev.c        | 1 +
>  lib/gpudev/gpudev_driver.h | 4 ++--
>  2 files changed, 3 insertions(+), 2 deletions(-)
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 

^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v4 5/7] drivers: fix some exported headers
  2025-09-25 12:31   ` [PATCH v4 5/7] drivers: fix some exported headers David Marchand
@ 2025-09-25 12:44     ` Bruce Richardson
  0 siblings, 0 replies; 75+ messages in thread
From: Bruce Richardson @ 2025-09-25 12:44 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, Long Li, Wei Hu, Ankur Dwivedi, Anoob Joseph,
	Tejasree Kondoj, Hemant Agrawal, Sachin Saxena,
	Vladimir Medvedkin, Dariusz Sosnowski, Viacheslav Ovsiienko,
	Bing Zhao, Ori Kam, Suanming Mou, Matan Azrad, Gagandeep Singh,
	Jingjing Wu, Stephen Hemminger, Akhil Goyal, Haiyue Wang,
	Jeff Guo, Michael Baum, Nipun Gupta, Shreyansh Jain, Xiaoyun Li

On Thu, Sep 25, 2025 at 02:31:47PM +0200, David Marchand wrote:
> Those headers could not be included individually as they were not
> including their dependencies, were subject to some build warnings,
> or were not compiling on Windows.
> 
> Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
> Fixes: 5b2a1a02dcaf ("crypto/cnxk: fix experimental version for PMD API")
> Fixes: e5abbeeeefa5 ("crypto/cnxk: add PMD API for getting CPTR")
> Fixes: 3ca607402c4d ("crypto/cnxk: add PMD API to flush CTX")
> Fixes: 8c3495f5d2dd ("net/dpaa: support loopback API")
> Fixes: 12b435bf8f2f ("net/iavf: support flex desc metadata extraction")
> Fixes: 23f627e0ed28 ("net/mlx5: add flow sync API")
> Fixes: f5177bdc8b76 ("net/mlx5: add GENEVE TLV options parser API")
> Fixes: 53c71586c789 ("raw/dpaa2_cmdif: support enqueue/dequeue operations")
> Fixes: c39d1e082a4b ("raw/ntb: setup queues")
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v4 6/7] buildtools/chkincs: use a staging directory for headers
  2025-09-25 12:31   ` [PATCH v4 6/7] buildtools/chkincs: use a staging directory for headers David Marchand
@ 2025-09-25 14:46     ` Bruce Richardson
  2025-09-26  8:14       ` David Marchand
  0 siblings, 1 reply; 75+ messages in thread
From: Bruce Richardson @ 2025-09-25 14:46 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Thomas Monjalon, Tyler Retzlaff

On Thu, Sep 25, 2025 at 02:31:48PM +0200, David Marchand wrote:
> A problem with the current headers check is that it relies on
> meson dependencies objects that come with their include_directories
> directives, and all of those point at the library / driver sources.
> 
> This means that we won't detect a public header including a private
> (as in, not exported) header, or a driver only header.
> 
> To address this issue, a staging directory is added and every header
> is copied to it.
> 
> Drivers and library headers are staged to two different directories
> and the check is updated accordingly.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> Changes since v3:
> - removed update of global_inc (which was unneeded, and probably was
>   what triggered a Windows clang build issue reported by CI),
> - moved all staging operations under a check on check_includes= option,
> - moved staging directories under buildtools/chkincs/,
> - renamed all variables to reflect those concern the headers check,
> - made chkincs binaries depend on staging deps instead of having the
>   libraries/drivers depend on them,
> - added C++ check for driver headers (missed in v3),
> 

Hi,

a few ideas and suggestions inline below. One I feel most strongly about is
removing the extra meson.build files and just assigning the paths at init
time to save the extra subdir calls. Otherwise, with or without any of the
other suggestions:

Acked-by: Bruce Richardson <bruce.richardson@intel.com>


> 
> ---
>  MAINTAINERS                                   |  1 +
>  buildtools/chkincs/meson.build                | 69 +++++++++++++------
>  .../chkincs/staging/drivers/meson.build       |  4 ++
>  buildtools/chkincs/staging/meson.build        |  5 ++
>  buildtools/meson.build                        |  1 +
>  buildtools/stage-headers.py                   | 32 +++++++++
>  drivers/meson.build                           | 26 ++++++-
>  lib/eal/include/meson.build                   | 10 +++
>  lib/eal/meson.build                           | 12 ++++
>  lib/meson.build                               | 27 +++++++-
>  meson.build                                   |  8 +++
>  11 files changed, 171 insertions(+), 24 deletions(-)
>  create mode 100644 buildtools/chkincs/staging/drivers/meson.build
>  create mode 100644 buildtools/chkincs/staging/meson.build
>  create mode 100644 buildtools/stage-headers.py
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 1a2729be66..76672b67c9 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -131,6 +131,7 @@ F: buildtools/get-numa-count.py
>  F: buildtools/list-dir-globs.py
>  F: buildtools/map-list-symbol.sh
>  F: buildtools/pkg-config/
> +F: buildtools/stage-headers.py
>  F: buildtools/symlink-drivers-solibs.sh
>  F: buildtools/symlink-drivers-solibs.py
>  F: devtools/test-meson-builds.sh
> diff --git a/buildtools/chkincs/meson.build b/buildtools/chkincs/meson.build
> index 49dbc55254..376556f5f4 100644
> --- a/buildtools/chkincs/meson.build
> +++ b/buildtools/chkincs/meson.build
> @@ -12,38 +12,47 @@ gen_c_files = generator(gen_c_file_for_header,
>          arguments: ['@INPUT@', '@OUTPUT@'])
>  
>  cflags = machine_args
> +cflags += '-Wno-missing-field-initializers'
>  cflags += no_wvla_cflag
> +cflags += '-I' + dpdk_source_root + '/config'
> +cflags += '-I' + dpdk_build_root
> +cflags += '-I' + dpdk_chkinc_staging_dir
>  

Two minor suggestions, 1) should we not use "include_directories()" here to
pass these properly? and 2) would using the existing "global_inc" value as
include path not work ok? Is the reason for not using the latter the fact
it includes too many source dirs?

>  sources = files('main.c')
>  sources += gen_c_files.process(dpdk_chkinc_headers)
>  
> -# some driver SDK headers depend on these two buses, which are mandatory in build
> -# so we always include them in deps list
> -deps = [get_variable('shared_rte_bus_vdev'), get_variable('shared_rte_bus_pci')]
> -if dpdk_conf.has('RTE_BUS_VMBUS')
> -    deps += get_variable('shared_rte_bus_vmbus')
> -endif
> -# add the rest of the libs to the dependencies
> -foreach l:dpdk_libs_enabled
> -    deps += get_variable('shared_rte_' + l)
> -endforeach
> +cflags_drivers = '-I' + dpdk_chkinc_drivers_staging_dir
> +sources_drivers = files('main.c')
> +sources_drivers += gen_c_files.process(dpdk_chkinc_drivers_headers)
>  
>  executable('chkincs', sources,
>          c_args: cflags,
> -        include_directories: includes,
> -        dependencies: deps,
> +        dependencies: dpdk_chkinc_staging_deps,
>          install: false)
>  
>  executable('chkincs-exp', sources,
>          c_args: [cflags, '-DALLOW_EXPERIMENTAL_API'],
> -        include_directories: includes,
> -        dependencies: deps,
> +        dependencies: dpdk_chkinc_staging_deps,
>          install: false)
>  
>  executable('chkincs-all', sources,
>          c_args: [cflags, '-DALLOW_EXPERIMENTAL_API', '-DALLOW_INTERNAL_API'],
> -        include_directories: includes,
> -        dependencies: deps,
> +        dependencies: dpdk_chkinc_staging_deps,
> +        install: false)
> +
> +executable('chkincs-drv', sources_drivers,
> +        c_args: [cflags, cflags_drivers],
> +        dependencies: dpdk_chkinc_staging_deps + dpdk_chkinc_drivers_staging_deps,
> +        install: false)
> +
> +executable('chkincs-drv-exp', sources_drivers,
> +        c_args: [cflags, cflags_drivers, '-DALLOW_EXPERIMENTAL_API'],
> +        dependencies: dpdk_chkinc_staging_deps + dpdk_chkinc_drivers_staging_deps,
> +        install: false)
> +
> +executable('chkincs-drv-all', sources_drivers,
> +        c_args: [cflags, cflags_drivers, '-DALLOW_EXPERIMENTAL_API', '-DALLOW_INTERNAL_API'],
> +        dependencies: dpdk_chkinc_staging_deps + dpdk_chkinc_drivers_staging_deps,
>          install: false)
>  
>  # run tests for c++ builds also
> @@ -58,21 +67,37 @@ gen_cpp_files = generator(gen_c_file_for_header,
>  cpp_sources = files('main.cpp')
>  cpp_sources += gen_cpp_files.process(dpdk_chkinc_headers)
>  
> +cpp_sources_drivers = files('main.cpp')
> +cpp_sources_drivers += gen_cpp_files.process(dpdk_chkinc_drivers_headers)
> +
>  executable('chkincs-cpp', cpp_sources,
>          cpp_args: ['-include', 'rte_config.h', cflags],
> -        include_directories: includes,
> -        dependencies: deps,
> +        dependencies: dpdk_chkinc_staging_deps,
>          install: false)
>  
>  executable('chkincs-cpp-exp', cpp_sources,
>          cpp_args: ['-include', 'rte_config.h', cflags, '-DALLOW_EXPERIMENTAL_API'],
> -        include_directories: includes,
> -        dependencies: deps,
> +        dependencies: dpdk_chkinc_staging_deps,
>          install: false)
>  
>  executable('chkincs-cpp-all', cpp_sources,
>          cpp_args: ['-include', 'rte_config.h', cflags, '-DALLOW_EXPERIMENTAL_API',
>                     '-DALLOW_INTERNAL_API'],
> -        include_directories: includes,
> -        dependencies: deps,
> +        dependencies: dpdk_chkinc_staging_deps,
> +        install: false)
> +
> +executable('chkincs-drv-cpp', cpp_sources_drivers,
> +        cpp_args: ['-include', 'rte_config.h', cflags, cflags_drivers],
> +        dependencies: dpdk_chkinc_staging_deps + dpdk_chkinc_drivers_staging_deps,
> +        install: false)
> +
> +executable('chkincs-drv-cpp-exp', cpp_sources_drivers,
> +        cpp_args: ['-include', 'rte_config.h', cflags, cflags_drivers, '-DALLOW_EXPERIMENTAL_API'],
> +        dependencies: dpdk_chkinc_staging_deps + dpdk_chkinc_drivers_staging_deps,
> +        install: false)
> +
> +executable('chkincs-drv-cpp-all', cpp_sources_drivers,
> +        cpp_args: ['-include', 'rte_config.h', cflags, cflags_drivers, '-DALLOW_EXPERIMENTAL_API',
> +                   '-DALLOW_INTERNAL_API'],
> +        dependencies: dpdk_chkinc_staging_deps + dpdk_chkinc_drivers_staging_deps,
>          install: false)
> diff --git a/buildtools/chkincs/staging/drivers/meson.build b/buildtools/chkincs/staging/drivers/meson.build
> new file mode 100644
> index 0000000000..b19b1c0908
> --- /dev/null
> +++ b/buildtools/chkincs/staging/drivers/meson.build
> @@ -0,0 +1,4 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright (c) 2025 Red Hat, Inc.
> +
> +dpdk_chkinc_drivers_staging_dir = meson.current_build_dir()

Minor nit, but I don't think we need to have this file and the
staging/meson.build file either. Since all they do is assign paths, I'd
suggest that we just assign the paths directly in the top-level meson.build
file where we define the staging dir variables. (Even if not, I'd suggest
assigning the vars to '' rather than [], since they are not array vars
anyway).

> diff --git a/buildtools/chkincs/staging/meson.build b/buildtools/chkincs/staging/meson.build
> new file mode 100644
> index 0000000000..0b05656330
> --- /dev/null
> +++ b/buildtools/chkincs/staging/meson.build
> @@ -0,0 +1,5 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright (c) 2025 Red Hat, Inc.
> +
> +dpdk_chkinc_staging_dir = meson.current_build_dir()
> +subdir('drivers')
> diff --git a/buildtools/meson.build b/buildtools/meson.build
> index 32cea7cff7..561236e0af 100644
> --- a/buildtools/meson.build
> +++ b/buildtools/meson.build
> @@ -27,6 +27,7 @@ get_min_meson_version_cmd = py3 + files('get-min-meson-version.py')
>  get_test_suites_cmd = py3 + files('get-test-suites.py')
>  header_gen_cmd = py3 + files('gen-header.py')
>  has_hugepages_cmd = py3 + files('has-hugepages.py')
> +stage_headers_cmd = py3 + files('stage-headers.py')
>  cmdline_gen_cmd = py3 + files('dpdk-cmdline-gen.py')
>  check_dts_requirements = py3 + files('check-dts-requirements.py')
>  
> diff --git a/buildtools/stage-headers.py b/buildtools/stage-headers.py
> new file mode 100644
> index 0000000000..3057c6a26f
> --- /dev/null
> +++ b/buildtools/stage-headers.py
> @@ -0,0 +1,32 @@
> +#!/usr/bin/env python3
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright (c) 2025 Red Hat, Inc.
> +
> +"""
> +Headers staging script for DPDK build system.
> +"""
> +
> +import sys
> +import os
> +import shutil
> +from pathlib import Path
> +
> +def main():
> +    if len(sys.argv) < 4:
> +        print("Usage: stage-headers.py <staging_dir> <meson_stamp> [headers...]")
> +        sys.exit(1)
> +
> +    staging_dir = Path(sys.argv[1])
> +    meson_stamp = Path(sys.argv[2])
> +    headers = sys.argv[3:]
> +
> +    staging_dir.mkdir(parents=True, exist_ok=True)
> +
> +    for header in headers:
> +        file = Path(header)
> +        shutil.copy2(file, staging_dir / file.name)
> +
> +    meson_stamp.touch()
> +
> +if __name__ == "__main__":
> +    main()
> diff --git a/drivers/meson.build b/drivers/meson.build
> index f25f425565..dae1e83ca4 100644
> --- a/drivers/meson.build
> +++ b/drivers/meson.build
> @@ -245,7 +245,31 @@ foreach subpath:subdirs
>          if get_option('enable_driver_sdk')
>              install_headers(driver_sdk_headers)
>          endif
> -        dpdk_chkinc_headers += driver_sdk_headers
> +        dpdk_chkinc_headers += headers
> +        dpdk_chkinc_drivers_headers += driver_sdk_headers
> +
> +        if get_option('check_includes')
> +            if headers.length() > 0
> +                dpdk_chkinc_staging_deps += declare_dependency(sources:
> +                        custom_target(lib_name + '_header_staging',
> +                                output: lib_name + '_header_staging.stamp',
> +                                command: [stage_headers_cmd, dpdk_chkinc_staging_dir, '@OUTPUT@',
> +                                    headers],
> +                                install: false,
> +                        )
> +                )

Rather than using an external script and custom target for this, would the
configure_file() meson function, with "copy" set to true also work for us?
https://mesonbuild.com/Reference-manual_functions.html#configure_file

> +            endif
> +            if driver_sdk_headers.length() > 0
> +                dpdk_chkinc_drivers_staging_deps += declare_dependency(sources:
> +                        custom_target(lib_name + '_driver_header_staging',
> +                                output: lib_name + '_driver_header_staging.stamp',
> +                                command: [stage_headers_cmd, dpdk_chkinc_drivers_staging_dir,
> +                                    '@OUTPUT@', driver_sdk_headers],
> +                                install: false,
> +                        )
> +                )
> +            endif
> +        endif
>  
>          if headers.length() > 0
>              dpdk_includes += include_directories(drv_path)
> diff --git a/lib/eal/include/meson.build b/lib/eal/include/meson.build
> index d903577caa..92aa1c885d 100644
> --- a/lib/eal/include/meson.build
> +++ b/lib/eal/include/meson.build
> @@ -79,3 +79,13 @@ generic_headers = files(
>          'generic/rte_vect.h',
>  )
>  install_headers(generic_headers, subdir: 'generic')
> +if get_option('check_includes')
> +    dpdk_chkinc_staging_deps += declare_dependency(sources:
> +            custom_target('eal_generic_header_staging',
> +                    output: 'eal_generic_header_staging.stamp',
> +                    command: [stage_headers_cmd, join_paths(dpdk_chkinc_staging_dir, 'generic'),
> +                        '@OUTPUT@', generic_headers],
> +                    install: false,
> +            )
> +    )
> +endif
> diff --git a/lib/eal/meson.build b/lib/eal/meson.build
> index e1d6c4cf17..4ffd048ab1 100644
> --- a/lib/eal/meson.build
> +++ b/lib/eal/meson.build
> @@ -12,7 +12,19 @@ endif
>  
>  subdir(exec_env)
>  
> +arch_headers = []
> +arch_indirect_headers = []
>  subdir(arch_subdir)
> +if get_option('check_includes')
> +    dpdk_chkinc_staging_deps += declare_dependency(sources:
> +            custom_target('eal_arch_header_staging',
> +                    output: 'eal_arch_header_staging.stamp',
> +                    command: [stage_headers_cmd, dpdk_chkinc_staging_dir, '@OUTPUT@',
> +                        arch_headers + arch_indirect_headers],
> +                    install: false,
> +            )
> +    )
> +endif
>  
>  deps += ['log', 'kvargs']
>  if not is_windows
> diff --git a/lib/meson.build b/lib/meson.build
> index a67efaf718..34f930f12e 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -214,7 +214,32 @@ foreach l:libraries
>          install_headers(driver_sdk_headers)
>      endif
>      dpdk_chkinc_headers += headers
> -    dpdk_chkinc_headers += driver_sdk_headers
> +    dpdk_chkinc_drivers_headers += driver_sdk_headers
> +
> +    if get_option('check_includes')
> +        lib_headers = headers + indirect_headers
> +        if lib_headers.length() != 0
> +            dpdk_chkinc_staging_deps += declare_dependency(sources:
> +                    custom_target(l + '_header_staging',
> +                            output: l + '_header_staging.stamp',
> +                            command: [stage_headers_cmd, dpdk_chkinc_staging_dir, '@OUTPUT@',
> +                                lib_headers],
> +                            install: false,
> +                    )
> +            )
> +        endif
> +
> +        if driver_sdk_headers.length() != 0
> +            dpdk_chkinc_drivers_staging_deps += declare_dependency(sources:
> +                    custom_target(l + '_driver_header_staging',
> +                            output: l + '_driver_header_staging.stamp',
> +                            command: [stage_headers_cmd, dpdk_chkinc_drivers_staging_dir,
> +                                '@OUTPUT@', driver_sdk_headers],
> +                            install: false,
> +                    )
> +            )
> +        endif
> +    endif
>  
>      libname = 'rte_' + name
>      includes += include_directories(l)
> diff --git a/meson.build b/meson.build
> index 2423884df7..82498bcf54 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -38,6 +38,11 @@ dpdk_static_libraries = []
>  dpdk_shared_lib_deps = []
>  dpdk_static_lib_deps = []
>  dpdk_chkinc_headers = []
> +dpdk_chkinc_staging_dir = []
> +dpdk_chkinc_staging_deps = []
> +dpdk_chkinc_drivers_headers = []
> +dpdk_chkinc_drivers_staging_dir = []
> +dpdk_chkinc_drivers_staging_deps = []

As called out above, the staging dirs are not array variables, so I would
initialize them to the empty string instead. However, we could also just
give them their final values immediately here e.g.

dpdk_chkincs_staging_dir = meson.current_build_path() / 'staging'
dpdk_chkincs_drivers_staging_dir = dpdk_chkincs_staging_dir / 'drivers'

>  dpdk_driver_classes = []
>  dpdk_drivers = []
>  dpdk_extra_ldflags = []
> @@ -74,6 +79,9 @@ global_inc = [include_directories('.', 'config',
>  
>  # do configuration and get tool paths
>  subdir('buildtools')
> +if get_option('check_includes')
> +    subdir('buildtools/chkincs/staging')
> +endif
>  subdir('config')
>  
>  if is_linux
> -- 
> 2.51.0
> 

^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v4 6/7] buildtools/chkincs: use a staging directory for headers
  2025-09-25 14:46     ` Bruce Richardson
@ 2025-09-26  8:14       ` David Marchand
  2025-09-26  9:06         ` Bruce Richardson
  0 siblings, 1 reply; 75+ messages in thread
From: David Marchand @ 2025-09-26  8:14 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, Thomas Monjalon, Tyler Retzlaff

On Thu, 25 Sept 2025 at 16:47, Bruce Richardson
<bruce.richardson@intel.com> wrote:
> > diff --git a/buildtools/chkincs/meson.build b/buildtools/chkincs/meson.build
> > index 49dbc55254..376556f5f4 100644
> > --- a/buildtools/chkincs/meson.build
> > +++ b/buildtools/chkincs/meson.build
> > @@ -12,38 +12,47 @@ gen_c_files = generator(gen_c_file_for_header,
> >          arguments: ['@INPUT@', '@OUTPUT@'])
> >
> >  cflags = machine_args
> > +cflags += '-Wno-missing-field-initializers'
> >  cflags += no_wvla_cflag
> > +cflags += '-I' + dpdk_source_root + '/config'
> > +cflags += '-I' + dpdk_build_root
> > +cflags += '-I' + dpdk_chkinc_staging_dir
> >
>
> Two minor suggestions, 1) should we not use "include_directories()" here to
> pass these properly? and 2) would using the existing "global_inc" value as
> include path not work ok? Is the reason for not using the latter the fact
> it includes too many source dirs?

1) include_directories() requires a source directory to exist, so I
would need to keep almost empty directories with minimal meson.build
in them.

2) Indeed, global_inc is not usable as is.

meson.build:global_inc = [include_directories('.', 'config',
meson.build-    'lib/eal/include',
meson.build-    'lib/eal/@0@/include'.format(host_machine.system()),
meson.build-    'lib/eal/@0@/include'.format(arch_subdir),
meson.build-)]

global_inc refers to the EAL sources, so anything in those directories
is reachable.
There are a number of non exported headers in there, like
lib/eal/include/rte_eal_paging.h or Windows specific/internal headers
in lib/eal/windows/include.

I can split it as two variables.

>
> >  sources = files('main.c')
> >  sources += gen_c_files.process(dpdk_chkinc_headers)
> >
> > -# some driver SDK headers depend on these two buses, which are mandatory in build
> > -# so we always include them in deps list
> > -deps = [get_variable('shared_rte_bus_vdev'), get_variable('shared_rte_bus_pci')]
> > -if dpdk_conf.has('RTE_BUS_VMBUS')
> > -    deps += get_variable('shared_rte_bus_vmbus')
> > -endif

[snip]

> > diff --git a/drivers/meson.build b/drivers/meson.build
> > index f25f425565..dae1e83ca4 100644
> > --- a/drivers/meson.build
> > +++ b/drivers/meson.build
> > @@ -245,7 +245,31 @@ foreach subpath:subdirs
> >          if get_option('enable_driver_sdk')
> >              install_headers(driver_sdk_headers)
> >          endif
> > -        dpdk_chkinc_headers += driver_sdk_headers
> > +        dpdk_chkinc_headers += headers
> > +        dpdk_chkinc_drivers_headers += driver_sdk_headers
> > +
> > +        if get_option('check_includes')
> > +            if headers.length() > 0
> > +                dpdk_chkinc_staging_deps += declare_dependency(sources:
> > +                        custom_target(lib_name + '_header_staging',
> > +                                output: lib_name + '_header_staging.stamp',
> > +                                command: [stage_headers_cmd, dpdk_chkinc_staging_dir, '@OUTPUT@',
> > +                                    headers],
> > +                                install: false,
> > +                        )
> > +                )
>
> Rather than using an external script and custom target for this, would the
> configure_file() meson function, with "copy" set to true also work for us?
> https://mesonbuild.com/Reference-manual_functions.html#configure_file

I don't like configure_file().
Touching any of those headers will trigger a meson reconfigure, right?
I think I am not the only one who dislike meson reconfigurations that
pollutes your terminal a lot when you do many compilations (Thomas?).

But let's say this is acceptable.

I had tried but configure_file() won't accept outputting to a specific
directory, or I am doing it wrong?
Trying again as an example in lib/meson.build:
        foreach header: headers + indirect_headers
            configure_file(input: header,
                output: 'staging/@BASENAME@.h',
                copy: true,
                install: false,
            )
        endforeach

Gives:
../lib/meson.build:221:12: ERROR: configure_file keyword argument
"output" Output 'staging/@BASENAME@.h' must not contain a path
segment.


Relooking *again* at all this (la nuit porte conseil), if we tracked
headers in global variables, for "normal" headers, arch headers,
generic headers and drivers headers, all of the changes could be
isolated in the buildtools/chkincs directory.
This would also make it possible to factorize install_headers() calls,
and avoid drivers doing it behind drivers/meson.build back (I spotted
one).

I just pushed an experiment:
- single headers install:
https://github.com/david-marchand/dpdk/commit/headers_rework~2
- chkincs rework (still not using configure_file):
https://github.com/david-marchand/dpdk/commit/headers_rework~1

WDYT?

>
> > +            endif
> > +            if driver_sdk_headers.length() > 0
> > +                dpdk_chkinc_drivers_staging_deps += declare_dependency(sources:
> > +                        custom_target(lib_name + '_driver_header_staging',
> > +                                output: lib_name + '_driver_header_staging.stamp',
> > +                                command: [stage_headers_cmd, dpdk_chkinc_drivers_staging_dir,
> > +                                    '@OUTPUT@', driver_sdk_headers],
> > +                                install: false,
> > +                        )
> > +                )
> > +            endif
> > +        endif
> >
> >          if headers.length() > 0
> >              dpdk_includes += include_directories(drv_path)



-- 
David Marchand


^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v4 6/7] buildtools/chkincs: use a staging directory for headers
  2025-09-26  8:14       ` David Marchand
@ 2025-09-26  9:06         ` Bruce Richardson
  2025-09-26  9:18           ` David Marchand
  0 siblings, 1 reply; 75+ messages in thread
From: Bruce Richardson @ 2025-09-26  9:06 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Thomas Monjalon, Tyler Retzlaff

On Fri, Sep 26, 2025 at 10:14:31AM +0200, David Marchand wrote:
> On Thu, 25 Sept 2025 at 16:47, Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> > > diff --git a/buildtools/chkincs/meson.build b/buildtools/chkincs/meson.build
> > > index 49dbc55254..376556f5f4 100644
> > > --- a/buildtools/chkincs/meson.build
> > > +++ b/buildtools/chkincs/meson.build
> > > @@ -12,38 +12,47 @@ gen_c_files = generator(gen_c_file_for_header,
> > >          arguments: ['@INPUT@', '@OUTPUT@'])
> > >
> > >  cflags = machine_args
> > > +cflags += '-Wno-missing-field-initializers'
> > >  cflags += no_wvla_cflag
> > > +cflags += '-I' + dpdk_source_root + '/config'
> > > +cflags += '-I' + dpdk_build_root
> > > +cflags += '-I' + dpdk_chkinc_staging_dir
> > >
> >
> > Two minor suggestions, 1) should we not use "include_directories()" here to
> > pass these properly? and 2) would using the existing "global_inc" value as
> > include path not work ok? Is the reason for not using the latter the fact
> > it includes too many source dirs?
> 
> 1) include_directories() requires a source directory to exist, so I
> would need to keep almost empty directories with minimal meson.build
> in them.
> 
Ack.

> 2) Indeed, global_inc is not usable as is.
> 
> meson.build:global_inc = [include_directories('.', 'config',
> meson.build-    'lib/eal/include',
> meson.build-    'lib/eal/@0@/include'.format(host_machine.system()),
> meson.build-    'lib/eal/@0@/include'.format(arch_subdir),
> meson.build-)]
> 
> global_inc refers to the EAL sources, so anything in those directories
> is reachable.
> There are a number of non exported headers in there, like
> lib/eal/include/rte_eal_paging.h or Windows specific/internal headers
> in lib/eal/windows/include.
> 
> I can split it as two variables.
>

Ok, thanks. Was just making suggestions to try and improve things.
 
> >
> > >  sources = files('main.c')
> > >  sources += gen_c_files.process(dpdk_chkinc_headers)
> > >
> > > -# some driver SDK headers depend on these two buses, which are mandatory in build
> > > -# so we always include them in deps list
> > > -deps = [get_variable('shared_rte_bus_vdev'), get_variable('shared_rte_bus_pci')]
> > > -if dpdk_conf.has('RTE_BUS_VMBUS')
> > > -    deps += get_variable('shared_rte_bus_vmbus')
> > > -endif
> 
> [snip]
> 
> > > diff --git a/drivers/meson.build b/drivers/meson.build
> > > index f25f425565..dae1e83ca4 100644
> > > --- a/drivers/meson.build
> > > +++ b/drivers/meson.build
> > > @@ -245,7 +245,31 @@ foreach subpath:subdirs
> > >          if get_option('enable_driver_sdk')
> > >              install_headers(driver_sdk_headers)
> > >          endif
> > > -        dpdk_chkinc_headers += driver_sdk_headers
> > > +        dpdk_chkinc_headers += headers
> > > +        dpdk_chkinc_drivers_headers += driver_sdk_headers
> > > +
> > > +        if get_option('check_includes')
> > > +            if headers.length() > 0
> > > +                dpdk_chkinc_staging_deps += declare_dependency(sources:
> > > +                        custom_target(lib_name + '_header_staging',
> > > +                                output: lib_name + '_header_staging.stamp',
> > > +                                command: [stage_headers_cmd, dpdk_chkinc_staging_dir, '@OUTPUT@',
> > > +                                    headers],
> > > +                                install: false,
> > > +                        )
> > > +                )
> >
> > Rather than using an external script and custom target for this, would the
> > configure_file() meson function, with "copy" set to true also work for us?
> > https://mesonbuild.com/Reference-manual_functions.html#configure_file
> 
> I don't like configure_file().
> Touching any of those headers will trigger a meson reconfigure, right?
> I think I am not the only one who dislike meson reconfigurations that
> pollutes your terminal a lot when you do many compilations (Thomas?).
> 
> But let's say this is acceptable.
> 
> I had tried but configure_file() won't accept outputting to a specific
> directory, or I am doing it wrong?
> Trying again as an example in lib/meson.build:
>         foreach header: headers + indirect_headers
>             configure_file(input: header,
>                 output: 'staging/@BASENAME@.h',
>                 copy: true,
>                 install: false,
>             )
>         endforeach
> 
> Gives:
> ../lib/meson.build:221:12: ERROR: configure_file keyword argument
> "output" Output 'staging/@BASENAME@.h' must not contain a path
> segment.
> 
> 
> Relooking *again* at all this (la nuit porte conseil), if we tracked
> headers in global variables, for "normal" headers, arch headers,
> generic headers and drivers headers, all of the changes could be
> isolated in the buildtools/chkincs directory.
> This would also make it possible to factorize install_headers() calls,
> and avoid drivers doing it behind drivers/meson.build back (I spotted
> one).
> 
> I just pushed an experiment:
> - single headers install:
> https://github.com/david-marchand/dpdk/commit/headers_rework~2
> - chkincs rework (still not using configure_file):
> https://github.com/david-marchand/dpdk/commit/headers_rework~1
> 
> WDYT?
> 

Those changes seem good to me.

One final idea/suggestion (apologies for the many suggestions here). Rather
than having a new script and dependency tracking for the header copies,
would it be easier to do the header copy as part of the existing C file
generation script? It's already writing a C file to an output directory,
would it make sense to have that script just copy the header file to the
same location too?

/Bruce


^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v4 6/7] buildtools/chkincs: use a staging directory for headers
  2025-09-26  9:06         ` Bruce Richardson
@ 2025-09-26  9:18           ` David Marchand
  0 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2025-09-26  9:18 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, Thomas Monjalon, Tyler Retzlaff

On Fri, 26 Sept 2025 at 11:06, Bruce Richardson
<bruce.richardson@intel.com> wrote:
> > I just pushed an experiment:
> > - single headers install:
> > https://github.com/david-marchand/dpdk/commit/headers_rework~2
> > - chkincs rework (still not using configure_file):
> > https://github.com/david-marchand/dpdk/commit/headers_rework~1
> >
> > WDYT?
> >
>
> Those changes seem good to me.
>
> One final idea/suggestion (apologies for the many suggestions here). Rather
> than having a new script and dependency tracking for the header copies,
> would it be easier to do the header copy as part of the existing C file
> generation script? It's already writing a C file to an output directory,
> would it make sense to have that script just copy the header file to the
> same location too?

We still need something to stage "indirect" headers that are not
preprocessed by this generation script.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v5 0/9] Add a stricter headers check
  2024-11-27 11:26 [RFC 0/6] Add a stricter headers check David Marchand
                   ` (8 preceding siblings ...)
  2025-09-25 12:31 ` [PATCH v4 0/7] Add a stricter headers check David Marchand
@ 2025-09-26 12:40 ` David Marchand
  2025-09-26 12:40   ` [PATCH v5 1/9] baseband/acc: fix exported header David Marchand
                     ` (8 more replies)
  9 siblings, 9 replies; 75+ messages in thread
From: David Marchand @ 2025-09-26 12:40 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson

As explained in patch 8, the current headers check can not catch
issues when a public header includes an internal header.

Patch 1-5 fixes have not been marked as backport material as those bugs
seems minor/easy to fix externally (by either including missing headers,
or enabling enable_driver_sdk option).


-- 
David Marchand

Changes since v4:
- reworked headers install,
- fixed issue in ARM memcpy header,
- further simplified the header check modifications,

Changes since v3:
- narrowed down the changes under a check on check_includes= option,
- moved the staging directories under buildtools/chkincs,

Changes since v2:
- major rework, dropping the makefile approach, and instead copying
  headers to a staging directory used by the check,
- rebased,
- dropped changes on raw cnxk drivers and disabled the associated
  build warning in the headers check,

David Marchand (9):
  baseband/acc: fix exported header
  drivers: drop export of driver headers
  eventdev: do not include driver header in DMA adapter
  gpudev: fix driver header for Windows
  drivers: fix some exported headers
  eal/arm: fix C++ build for 32-bit memcpy
  build: factorize headers installation
  buildtools/chkincs: use a staging directory for headers
  power: separate public and driver headers

 buildtools/chkincs/meson.build                | 70 +++++++++++++++----
 buildtools/chkincs/stage-headers.py           | 32 +++++++++
 .../chkincs/staging/drivers/meson.build       | 12 ++++
 buildtools/chkincs/staging/meson.build        | 30 ++++++++
 config/meson.build                            |  3 +-
 devtools/checkpatches.sh                      |  9 +++
 drivers/baseband/acc/meson.build              |  2 +-
 drivers/bus/vmbus/rte_vmbus_reg.h             |  6 ++
 drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h     |  2 +
 drivers/meson.build                           |  7 +-
 drivers/net/dpaa/rte_pmd_dpaa.h               |  2 +
 drivers/net/intel/iavf/rte_pmd_iavf.h         |  6 ++
 drivers/net/mlx5/rte_pmd_mlx5.h               |  3 +
 drivers/net/txgbe/meson.build                 |  2 +-
 drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h |  2 +
 drivers/raw/ntb/rte_pmd_ntb.h                 |  2 +
 lib/bbdev/meson.build                         | 14 ++--
 lib/eal/arm/include/meson.build               |  3 +-
 lib/eal/arm/include/rte_memcpy_32.h           |  6 +-
 lib/eal/include/meson.build                   |  3 +-
 lib/eal/loongarch/include/meson.build         |  3 +-
 lib/eal/ppc/include/meson.build               |  3 +-
 lib/eal/riscv/include/meson.build             |  3 +-
 lib/eal/x86/include/meson.build               |  6 +-
 lib/ethdev/meson.build                        |  6 +-
 lib/eventdev/rte_event_dma_adapter.h          |  2 +-
 lib/gpudev/gpudev.c                           |  1 +
 lib/gpudev/gpudev_driver.h                    |  4 +-
 lib/meson.build                               | 10 +--
 lib/mldev/meson.build                         |  5 +-
 lib/power/meson.build                         |  7 +-
 lib/power/power_cpufreq.h                     | 14 +---
 lib/power/power_uncore_ops.h                  |  1 +
 lib/power/rte_power_cpufreq.c                 |  2 +-
 lib/power/rte_power_cpufreq.h                 | 15 +++-
 lib/power/rte_power_uncore.c                  |  2 +-
 lib/power/rte_power_uncore.h                  |  3 +-
 lib/rawdev/meson.build                        |  3 +-
 lib/regexdev/meson.build                      |  3 +-
 lib/security/meson.build                      |  3 +-
 meson.build                                   | 21 ++++--
 41 files changed, 247 insertions(+), 86 deletions(-)
 create mode 100644 buildtools/chkincs/stage-headers.py
 create mode 100644 buildtools/chkincs/staging/drivers/meson.build
 create mode 100644 buildtools/chkincs/staging/meson.build

-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v5 1/9] baseband/acc: fix exported header
  2025-09-26 12:40 ` [PATCH v5 0/9] Add a stricter headers check David Marchand
@ 2025-09-26 12:40   ` David Marchand
  2025-09-26 12:40   ` [PATCH v5 2/9] drivers: drop export of driver headers David Marchand
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2025-09-26 12:40 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, Nicolas Chautru, Maxime Coquelin

rte_acc_cfg.h relies on rte_acc_common_cfg.h.

Fixes: 32e8b7ea35dd ("baseband/acc100: refactor to segregate common code")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/baseband/acc/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/baseband/acc/meson.build b/drivers/baseband/acc/meson.build
index 64fcf1537a..d9fb947eaa 100644
--- a/drivers/baseband/acc/meson.build
+++ b/drivers/baseband/acc/meson.build
@@ -26,4 +26,4 @@ deps += ['bus_pci']
 
 sources = files('acc_common.c', 'rte_acc100_pmd.c', 'rte_vrb_pmd.c')
 
-headers = files('rte_acc_cfg.h')
+headers = files('rte_acc_cfg.h', 'rte_acc_common_cfg.h')
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v5 2/9] drivers: drop export of driver headers
  2025-09-26 12:40 ` [PATCH v5 0/9] Add a stricter headers check David Marchand
  2025-09-26 12:40   ` [PATCH v5 1/9] baseband/acc: fix exported header David Marchand
@ 2025-09-26 12:40   ` David Marchand
  2025-09-26 12:40   ` [PATCH v5 3/9] eventdev: do not include driver header in DMA adapter David Marchand
                     ` (6 subsequent siblings)
  8 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2025-09-26 12:40 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, Andrew Rybchenko, Akhil Goyal, Nicolas Chautru,
	Thomas Monjalon, Srikanth Yalavarthi, Sachin Saxena,
	Hemant Agrawal, Ori Kam, Anoob Joseph

Many classes are exposing driver only headers as public headers.
Move them to the driver_sdk_headers list.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
Changes since v2:
- rebased,

---
 lib/bbdev/meson.build    | 14 +++++++++-----
 lib/ethdev/meson.build   |  6 +++---
 lib/mldev/meson.build    |  5 +----
 lib/rawdev/meson.build   |  3 ++-
 lib/regexdev/meson.build |  3 ++-
 lib/security/meson.build |  3 ++-
 6 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/lib/bbdev/meson.build b/lib/bbdev/meson.build
index 2e48d5f3da..002fc3f1ac 100644
--- a/lib/bbdev/meson.build
+++ b/lib/bbdev/meson.build
@@ -1,10 +1,14 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-sources = files('rte_bbdev.c',
-        'bbdev_trace_points.c')
-headers = files('rte_bbdev.h',
-        'rte_bbdev_pmd.h',
+sources = files(
+        'rte_bbdev.c',
+        'bbdev_trace_points.c',
+)
+headers = files(
+        'rte_bbdev.h',
         'rte_bbdev_op.h',
-        'rte_bbdev_trace_fp.h')
+        'rte_bbdev_trace_fp.h',
+)
+driver_sdk_headers = files('rte_bbdev_pmd.h')
 deps += ['mbuf']
diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build
index f1d2586591..8ba6c708a2 100644
--- a/lib/ethdev/meson.build
+++ b/lib/ethdev/meson.build
@@ -26,11 +26,8 @@ headers = files(
         'rte_ethdev_trace_fp.h',
         'rte_dev_info.h',
         'rte_flow.h',
-        'rte_flow_driver.h',
         'rte_mtr.h',
-        'rte_mtr_driver.h',
         'rte_tm.h',
-        'rte_tm_driver.h',
 )
 
 indirect_headers += files(
@@ -42,6 +39,9 @@ driver_sdk_headers += files(
         'ethdev_driver.h',
         'ethdev_pci.h',
         'ethdev_vdev.h',
+        'rte_flow_driver.h',
+        'rte_mtr_driver.h',
+        'rte_tm_driver.h',
 )
 
 if is_linux
diff --git a/lib/mldev/meson.build b/lib/mldev/meson.build
index 0079ccd205..39f1fba927 100644
--- a/lib/mldev/meson.build
+++ b/lib/mldev/meson.build
@@ -26,11 +26,8 @@ headers = files(
         'rte_mldev.h',
 )
 
-indirect_headers += files(
-        'rte_mldev_core.h',
-)
-
 driver_sdk_headers += files(
+        'rte_mldev_core.h',
         'rte_mldev_pmd.h',
         'mldev_utils.h',
 )
diff --git a/lib/rawdev/meson.build b/lib/rawdev/meson.build
index 7dfc3d5cf9..ccfd922fda 100644
--- a/lib/rawdev/meson.build
+++ b/lib/rawdev/meson.build
@@ -8,6 +8,7 @@ if is_windows
 endif
 
 sources = files('rte_rawdev.c')
-headers = files('rte_rawdev.h', 'rte_rawdev_pmd.h')
+headers = files('rte_rawdev.h')
+driver_sdk_headers = files('rte_rawdev_pmd.h')
 
 deps += ['telemetry']
diff --git a/lib/regexdev/meson.build b/lib/regexdev/meson.build
index 7e12d8cd6d..2684da3825 100644
--- a/lib/regexdev/meson.build
+++ b/lib/regexdev/meson.build
@@ -2,6 +2,7 @@
 # Copyright 2020 Mellanox Technologies, Ltd
 
 sources = files('rte_regexdev.c')
-headers = files('rte_regexdev.h', 'rte_regexdev_driver.h')
+headers = files('rte_regexdev.h')
 indirect_headers += files('rte_regexdev_core.h')
+driver_sdk_headers = files('rte_regexdev_driver.h')
 deps += ['mbuf']
diff --git a/lib/security/meson.build b/lib/security/meson.build
index 1034a7a299..d5431d472c 100644
--- a/lib/security/meson.build
+++ b/lib/security/meson.build
@@ -2,5 +2,6 @@
 # Copyright(c) 2017-2019 Intel Corporation
 
 sources = files('rte_security.c')
-headers = files('rte_security.h', 'rte_security_driver.h')
+headers = files('rte_security.h')
+driver_sdk_headers = files('rte_security_driver.h')
 deps += ['mempool', 'cryptodev', 'net']
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v5 3/9] eventdev: do not include driver header in DMA adapter
  2025-09-26 12:40 ` [PATCH v5 0/9] Add a stricter headers check David Marchand
  2025-09-26 12:40   ` [PATCH v5 1/9] baseband/acc: fix exported header David Marchand
  2025-09-26 12:40   ` [PATCH v5 2/9] drivers: drop export of driver headers David Marchand
@ 2025-09-26 12:40   ` David Marchand
  2025-09-26 12:40   ` [PATCH v5 4/9] gpudev: fix driver header for Windows David Marchand
                     ` (5 subsequent siblings)
  8 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2025-09-26 12:40 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, Amit Prakash Shukla, Jerin Jacob

The dma adapter header does not require including rte_dmadev_pmd.h which
is a driver header.

Fixes: 66a30a29387a ("eventdev/dma: introduce DMA adapter")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Amit Prakash Shukla <amitprakashs@marvell.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/eventdev/rte_event_dma_adapter.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eventdev/rte_event_dma_adapter.h b/lib/eventdev/rte_event_dma_adapter.h
index 5c480b82ff..34142f26db 100644
--- a/lib/eventdev/rte_event_dma_adapter.h
+++ b/lib/eventdev/rte_event_dma_adapter.h
@@ -144,7 +144,7 @@
 #include <stdint.h>
 
 #include <rte_common.h>
-#include <rte_dmadev_pmd.h>
+#include <rte_dmadev.h>
 #include <rte_eventdev.h>
 
 #ifdef __cplusplus
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v5 4/9] gpudev: fix driver header for Windows
  2025-09-26 12:40 ` [PATCH v5 0/9] Add a stricter headers check David Marchand
                     ` (2 preceding siblings ...)
  2025-09-26 12:40   ` [PATCH v5 3/9] eventdev: do not include driver header in DMA adapter David Marchand
@ 2025-09-26 12:40   ` David Marchand
  2025-09-26 12:40   ` [PATCH v5 5/9] drivers: fix some exported headers David Marchand
                     ` (4 subsequent siblings)
  8 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2025-09-26 12:40 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, Elena Agostini, Thomas Monjalon

Use rte_os.h and its RTE_TAILQ_HEAD definition compatible with BSD
sys/queue.h

Fixes: 18cb07563165 ("gpudev: add event notification")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/gpudev/gpudev.c        | 1 +
 lib/gpudev/gpudev_driver.h | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/gpudev/gpudev.c b/lib/gpudev/gpudev.c
index 0473d9ffb3..4a2335834c 100644
--- a/lib/gpudev/gpudev.c
+++ b/lib/gpudev/gpudev.c
@@ -3,6 +3,7 @@
  */
 
 #include <stdlib.h>
+#include <sys/queue.h>
 
 #include <eal_export.h>
 #include <rte_eal.h>
diff --git a/lib/gpudev/gpudev_driver.h b/lib/gpudev/gpudev_driver.h
index 37b6ae3149..b7621f6e5a 100644
--- a/lib/gpudev/gpudev_driver.h
+++ b/lib/gpudev/gpudev_driver.h
@@ -12,11 +12,11 @@
 #define RTE_GPUDEV_DRIVER_H
 
 #include <stdint.h>
-#include <sys/queue.h>
 
 #include <dev_driver.h>
 
 #include <rte_compat.h>
+#include <rte_os.h>
 #include "rte_gpudev.h"
 
 #ifdef __cplusplus
@@ -80,7 +80,7 @@ struct __rte_cache_aligned rte_gpu {
 	/* Driver functions. */
 	struct rte_gpu_ops ops;
 	/* Event callback list. */
-	TAILQ_HEAD(rte_gpu_callback_list, rte_gpu_callback) callbacks;
+	RTE_TAILQ_HEAD(rte_gpu_callback_list, rte_gpu_callback) callbacks;
 	/* Current state (used or not) in the running process. */
 	enum rte_gpu_state process_state; /* Updated by this library. */
 	/* Driver-specific private data for the running process. */
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v5 5/9] drivers: fix some exported headers
  2025-09-26 12:40 ` [PATCH v5 0/9] Add a stricter headers check David Marchand
                     ` (3 preceding siblings ...)
  2025-09-26 12:40   ` [PATCH v5 4/9] gpudev: fix driver header for Windows David Marchand
@ 2025-09-26 12:40   ` David Marchand
  2025-09-26 12:40   ` [PATCH v5 6/9] eal/arm: fix C++ build for 32-bit memcpy David Marchand
                     ` (3 subsequent siblings)
  8 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2025-09-26 12:40 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, Long Li, Wei Hu, Ankur Dwivedi, Anoob Joseph,
	Tejasree Kondoj, Hemant Agrawal, Sachin Saxena,
	Vladimir Medvedkin, Dariusz Sosnowski, Viacheslav Ovsiienko,
	Bing Zhao, Ori Kam, Suanming Mou, Matan Azrad, Gagandeep Singh,
	Jingjing Wu, Stephen Hemminger, Akhil Goyal, Jeff Guo,
	Haiyue Wang, Michael Baum, Shreyansh Jain, Nipun Gupta,
	Xiaoyun Li

Those headers could not be included individually as they were not
including their dependencies, were subject to some build warnings,
or were not compiling on Windows.

Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
Fixes: 5b2a1a02dcaf ("crypto/cnxk: fix experimental version for PMD API")
Fixes: e5abbeeeefa5 ("crypto/cnxk: add PMD API for getting CPTR")
Fixes: 3ca607402c4d ("crypto/cnxk: add PMD API to flush CTX")
Fixes: 8c3495f5d2dd ("net/dpaa: support loopback API")
Fixes: 12b435bf8f2f ("net/iavf: support flex desc metadata extraction")
Fixes: 23f627e0ed28 ("net/mlx5: add flow sync API")
Fixes: f5177bdc8b76 ("net/mlx5: add GENEVE TLV options parser API")
Fixes: 53c71586c789 ("raw/dpaa2_cmdif: support enqueue/dequeue operations")
Fixes: c39d1e082a4b ("raw/ntb: setup queues")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
Changes since v2:
- rebased,
- dropped changes on raw/cnxk drivers,

---
 drivers/bus/vmbus/rte_vmbus_reg.h             | 6 ++++++
 drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h     | 2 ++
 drivers/net/dpaa/rte_pmd_dpaa.h               | 2 ++
 drivers/net/intel/iavf/rte_pmd_iavf.h         | 6 ++++++
 drivers/net/mlx5/rte_pmd_mlx5.h               | 3 +++
 drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h | 2 ++
 drivers/raw/ntb/rte_pmd_ntb.h                 | 2 ++
 7 files changed, 23 insertions(+)

diff --git a/drivers/bus/vmbus/rte_vmbus_reg.h b/drivers/bus/vmbus/rte_vmbus_reg.h
index fb7e3043ec..6370a07f95 100644
--- a/drivers/bus/vmbus/rte_vmbus_reg.h
+++ b/drivers/bus/vmbus/rte_vmbus_reg.h
@@ -6,6 +6,12 @@
 #ifndef _VMBUS_REG_H_
 #define _VMBUS_REG_H_
 
+#include <stdint.h>
+
+#include <rte_common.h>
+#include <rte_stdatomic.h>
+#include <rte_uuid.h>
+
 /*
  * Hyper-V SynIC message format.
  */
diff --git a/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h b/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
index 46861ab2cf..70c019e94c 100644
--- a/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
+++ b/drivers/crypto/cnxk/rte_pmd_cnxk_crypto.h
@@ -11,8 +11,10 @@
 #ifndef _PMD_CNXK_CRYPTO_H_
 #define _PMD_CNXK_CRYPTO_H_
 
+#include <stdbool.h>
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_crypto.h>
 #include <rte_security.h>
 
diff --git a/drivers/net/dpaa/rte_pmd_dpaa.h b/drivers/net/dpaa/rte_pmd_dpaa.h
index ec45633ba2..0a57e2097a 100644
--- a/drivers/net/dpaa/rte_pmd_dpaa.h
+++ b/drivers/net/dpaa/rte_pmd_dpaa.h
@@ -5,6 +5,8 @@
 #ifndef _PMD_DPAA_H_
 #define _PMD_DPAA_H_
 
+#include <stdint.h>
+
 /**
  * @file rte_pmd_dpaa.h
  *
diff --git a/drivers/net/intel/iavf/rte_pmd_iavf.h b/drivers/net/intel/iavf/rte_pmd_iavf.h
index 56d453fc4c..04b86a5dd7 100644
--- a/drivers/net/intel/iavf/rte_pmd_iavf.h
+++ b/drivers/net/intel/iavf/rte_pmd_iavf.h
@@ -15,6 +15,7 @@
  */
 
 #include <stdio.h>
+
 #include <rte_compat.h>
 #include <rte_mbuf.h>
 #include <rte_mbuf_dyn.h>
@@ -184,6 +185,7 @@ __rte_experimental
 static inline void
 rte_pmd_ifd_dump_proto_xtr_metadata(struct rte_mbuf *m)
 {
+#ifdef ALLOW_EXPERIMENTAL_API
 	union rte_pmd_ifd_proto_xtr_metadata data;
 
 	if (!rte_pmd_ifd_dynf_proto_xtr_metadata_avail())
@@ -243,6 +245,10 @@ rte_pmd_ifd_dump_proto_xtr_metadata(struct rte_mbuf *m)
 	else if (m->ol_flags & RTE_IAVF_PKT_RX_DYNF_PROTO_XTR_IP_OFFSET)
 		printf(" - Flexible descriptor's Extraction: ip_offset=%u",
 		       data.ip_ofs);
+#else
+	RTE_SET_USED(m);
+	RTE_VERIFY(false);
+#endif
 }
 
 #ifdef __cplusplus
diff --git a/drivers/net/mlx5/rte_pmd_mlx5.h b/drivers/net/mlx5/rte_pmd_mlx5.h
index fdd2f65888..f2c6aebe0b 100644
--- a/drivers/net/mlx5/rte_pmd_mlx5.h
+++ b/drivers/net/mlx5/rte_pmd_mlx5.h
@@ -5,6 +5,9 @@
 #ifndef RTE_PMD_PRIVATE_MLX5_H_
 #define RTE_PMD_PRIVATE_MLX5_H_
 
+#include <stdint.h>
+
+#include <rte_byteorder.h>
 #include <rte_compat.h>
 
 /**
diff --git a/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h b/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h
index 483b66eaae..7731fc6363 100644
--- a/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h
+++ b/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h
@@ -12,6 +12,8 @@
  *
  */
 
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/drivers/raw/ntb/rte_pmd_ntb.h b/drivers/raw/ntb/rte_pmd_ntb.h
index 6591ce7931..76da3be026 100644
--- a/drivers/raw/ntb/rte_pmd_ntb.h
+++ b/drivers/raw/ntb/rte_pmd_ntb.h
@@ -5,6 +5,8 @@
 #ifndef _RTE_PMD_NTB_H_
 #define _RTE_PMD_NTB_H_
 
+#include <stdint.h>
+
 /* App needs to set/get these attrs */
 #define NTB_QUEUE_SZ_NAME           "queue_size"
 #define NTB_QUEUE_NUM_NAME          "queue_num"
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v5 6/9] eal/arm: fix C++ build for 32-bit memcpy
  2025-09-26 12:40 ` [PATCH v5 0/9] Add a stricter headers check David Marchand
                     ` (4 preceding siblings ...)
  2025-09-26 12:40   ` [PATCH v5 5/9] drivers: fix some exported headers David Marchand
@ 2025-09-26 12:40   ` David Marchand
  2025-09-26 13:01     ` Bruce Richardson
  2025-09-26 19:55     ` Morten Brørup
  2025-09-26 12:41   ` [PATCH v5 7/9] build: factorize headers installation David Marchand
                     ` (2 subsequent siblings)
  8 siblings, 2 replies; 75+ messages in thread
From: David Marchand @ 2025-09-26 12:40 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, stable, Wathsala Vithanage,
	Mattias Rönnblom, Morten Brørup

This was caught while checking ARM arch headers.

In file included from buildtools/chkincs/chkincs-cpp.p/rte_memcpy_32.cpp:1:
/home/runner/work/dpdk/dpdk/lib/eal/arm/include/rte_memcpy_32.h:302:1:
	error: expected declaration before ‘}’ token
  302 | }
      | ^

Fixes: 719834a6849e ("use C linkage where appropriate in headers")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/eal/arm/include/rte_memcpy_32.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/eal/arm/include/rte_memcpy_32.h b/lib/eal/arm/include/rte_memcpy_32.h
index 99fd5757ca..861be06f5e 100644
--- a/lib/eal/arm/include/rte_memcpy_32.h
+++ b/lib/eal/arm/include/rte_memcpy_32.h
@@ -19,10 +19,14 @@
 /* ARM NEON Intrinsics are used to copy data */
 #include <arm_neon.h>
 
+#endif /* RTE_ARCH_ARM_NEON_MEMCPY */
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+#ifdef RTE_ARCH_ARM_NEON_MEMCPY
+
 static inline void
 rte_mov16(uint8_t *dst, const uint8_t *src)
 {
@@ -252,7 +256,7 @@ rte_memcpy_func(void *dst, const void *src, size_t n)
 	return ret;
 }
 
-#else
+#else /* ! RTE_ARCH_ARM_NEON_MEMCPY */
 
 static inline void
 rte_mov16(uint8_t *dst, const uint8_t *src)
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v5 7/9] build: factorize headers installation
  2025-09-26 12:40 ` [PATCH v5 0/9] Add a stricter headers check David Marchand
                     ` (5 preceding siblings ...)
  2025-09-26 12:40   ` [PATCH v5 6/9] eal/arm: fix C++ build for 32-bit memcpy David Marchand
@ 2025-09-26 12:41   ` David Marchand
  2025-09-26 13:08     ` Bruce Richardson
  2025-09-26 12:41   ` [PATCH v5 8/9] buildtools/chkincs: use a staging directory for headers David Marchand
  2025-09-26 12:41   ` [PATCH v5 9/9] power: separate public and driver headers David Marchand
  8 siblings, 1 reply; 75+ messages in thread
From: David Marchand @ 2025-09-26 12:41 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, Thomas Monjalon, Jiawen Wu, Jian Wang,
	Zaiyu Wang, Wathsala Vithanage, Tyler Retzlaff, Min Zhou,
	David Christensen, Stanisław Kardach, Sun Yuechi,
	Konstantin Ananyev

Gather all headers in global variables, put headers installation
in a single location and make the headers check use them instead of
dpdk_chkinc_headers.

This rework reveals a number of issues:
- net/txgbe driver was directly installing its header, bypassing
  drivers/meson.build and skipping the headers check,
- arch headers were not checked except for x86,
- some driver headers were not checked,

For the last point, a build warning must be disabled (like it is
globally in DPDK) for headers from raw drivers.

Finally, checkpatches is updated to avoid reintroductions of
install_headers().

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 buildtools/chkincs/meson.build        |  7 +++++--
 config/meson.build                    |  3 +--
 devtools/checkpatches.sh              |  9 +++++++++
 drivers/meson.build                   |  7 ++-----
 drivers/net/txgbe/meson.build         |  2 +-
 lib/eal/arm/include/meson.build       |  3 +--
 lib/eal/include/meson.build           |  3 +--
 lib/eal/loongarch/include/meson.build |  3 +--
 lib/eal/ppc/include/meson.build       |  3 +--
 lib/eal/riscv/include/meson.build     |  3 +--
 lib/eal/x86/include/meson.build       |  6 ++----
 lib/meson.build                       | 10 +++-------
 meson.build                           | 15 ++++++++++++++-
 13 files changed, 42 insertions(+), 32 deletions(-)

diff --git a/buildtools/chkincs/meson.build b/buildtools/chkincs/meson.build
index 49dbc55254..ac7df41304 100644
--- a/buildtools/chkincs/meson.build
+++ b/buildtools/chkincs/meson.build
@@ -12,10 +12,13 @@ gen_c_files = generator(gen_c_file_for_header,
         arguments: ['@INPUT@', '@OUTPUT@'])
 
 cflags = machine_args
+if cc.has_argument('-Wno-missing-field-initializers')
+    cflags += '-Wno-missing-field-initializers'
+endif
 cflags += no_wvla_cflag
 
 sources = files('main.c')
-sources += gen_c_files.process(dpdk_chkinc_headers)
+sources += gen_c_files.process(dpdk_arch_headers + dpdk_headers + dpdk_drivers_headers)
 
 # some driver SDK headers depend on these two buses, which are mandatory in build
 # so we always include them in deps list
@@ -56,7 +59,7 @@ gen_cpp_files = generator(gen_c_file_for_header,
         arguments: ['@INPUT@', '@OUTPUT@'])
 
 cpp_sources = files('main.cpp')
-cpp_sources += gen_cpp_files.process(dpdk_chkinc_headers)
+cpp_sources += gen_cpp_files.process(dpdk_arch_headers + dpdk_headers + dpdk_drivers_headers)
 
 executable('chkincs-cpp', cpp_sources,
         cpp_args: ['-include', 'rte_config.h', cflags],
diff --git a/config/meson.build b/config/meson.build
index 55497f0bf5..f737b67c36 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -456,8 +456,7 @@ endif
 # set the install path for the drivers
 dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
 
-install_headers(['rte_config.h'],
-        subdir: get_option('include_subdir_arch'))
+dpdk_arch_headers += files('rte_config.h')
 
 # enable VFIO only if it is linux OS
 dpdk_conf.set('RTE_EAL_VFIO', is_linux)
diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 35037aa8f1..d4b86922c9 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -87,6 +87,15 @@ check_forbidden_additions() { # <patch>
 		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
 		"$1" || res=1
 
+	# don't call directly install_headers()
+	awk -v FOLDERS="lib drivers" \
+		-v SKIP_FILES='meson.build' \
+		-v EXPRESSIONS="\\\<install_headers\\\>" \
+		-v RET_ON_FAIL=1 \
+		-v MESSAGE='Using install_headers()' \
+		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
+		"$1" || res=1
+
 	# refrain from using compiler attribute without defining a common macro
 	awk -v FOLDERS="lib drivers app examples" \
 		-v SKIP_FILES='lib/eal/include/rte_common.h' \
diff --git a/drivers/meson.build b/drivers/meson.build
index f25f425565..424acb03a7 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -241,11 +241,8 @@ foreach subpath:subdirs
 
         dpdk_extra_ldflags += pkgconfig_extra_libs
 
-        install_headers(headers)
-        if get_option('enable_driver_sdk')
-            install_headers(driver_sdk_headers)
-        endif
-        dpdk_chkinc_headers += driver_sdk_headers
+        dpdk_headers += headers
+        dpdk_drivers_headers += driver_sdk_headers
 
         if headers.length() > 0
             dpdk_includes += include_directories(drv_path)
diff --git a/drivers/net/txgbe/meson.build b/drivers/net/txgbe/meson.build
index 4dbbf597bb..5cdec017ed 100644
--- a/drivers/net/txgbe/meson.build
+++ b/drivers/net/txgbe/meson.build
@@ -31,4 +31,4 @@ elif arch_subdir == 'arm'
     sources += files('txgbe_rxtx_vec_neon.c')
 endif
 
-install_headers('rte_pmd_txgbe.h')
+headers = files('rte_pmd_txgbe.h')
diff --git a/lib/eal/arm/include/meson.build b/lib/eal/arm/include/meson.build
index 657bf58569..822ddac520 100644
--- a/lib/eal/arm/include/meson.build
+++ b/lib/eal/arm/include/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation.
 
-arch_headers = files(
+dpdk_arch_headers += files(
         'rte_atomic_32.h',
         'rte_atomic_64.h',
         'rte_atomic.h',
@@ -28,4 +28,3 @@ arch_headers = files(
         'rte_spinlock.h',
         'rte_vect.h',
 )
-install_headers(arch_headers, subdir: get_option('include_subdir_arch'))
diff --git a/lib/eal/include/meson.build b/lib/eal/include/meson.build
index d903577caa..aef5824e5f 100644
--- a/lib/eal/include/meson.build
+++ b/lib/eal/include/meson.build
@@ -64,7 +64,7 @@ driver_sdk_headers = files(
 )
 
 # special case install the generic headers, since they go in a subdir
-generic_headers = files(
+dpdk_generic_headers += files(
         'generic/rte_atomic.h',
         'generic/rte_byteorder.h',
         'generic/rte_cpuflags.h',
@@ -78,4 +78,3 @@ generic_headers = files(
         'generic/rte_spinlock.h',
         'generic/rte_vect.h',
 )
-install_headers(generic_headers, subdir: 'generic')
diff --git a/lib/eal/loongarch/include/meson.build b/lib/eal/loongarch/include/meson.build
index 6e8d12601a..574aa6dac2 100644
--- a/lib/eal/loongarch/include/meson.build
+++ b/lib/eal/loongarch/include/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2022 Loongson Technology Corporation Limited
 
-arch_headers = files(
+dpdk_arch_headers += files(
         'rte_atomic.h',
         'rte_byteorder.h',
         'rte_cpuflags.h',
@@ -15,4 +15,3 @@ arch_headers = files(
         'rte_spinlock.h',
         'rte_vect.h',
 )
-install_headers(arch_headers, subdir: get_option('include_subdir_arch'))
diff --git a/lib/eal/ppc/include/meson.build b/lib/eal/ppc/include/meson.build
index fa64330f01..87887187b8 100644
--- a/lib/eal/ppc/include/meson.build
+++ b/lib/eal/ppc/include/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
 
-arch_headers = files(
+dpdk_arch_headers += files(
         'rte_altivec.h',
         'rte_atomic.h',
         'rte_byteorder.h',
@@ -16,4 +16,3 @@ arch_headers = files(
         'rte_spinlock.h',
         'rte_vect.h',
 )
-install_headers(arch_headers, subdir: get_option('include_subdir_arch'))
diff --git a/lib/eal/riscv/include/meson.build b/lib/eal/riscv/include/meson.build
index 481c7d50a4..a7a387fb8a 100644
--- a/lib/eal/riscv/include/meson.build
+++ b/lib/eal/riscv/include/meson.build
@@ -3,7 +3,7 @@
 # Copyright(c) 2022 SiFive
 # Copyright(c) 2022 Semihalf
 
-arch_headers = files(
+dpdk_arch_headers += files(
         'rte_atomic.h',
         'rte_byteorder.h',
         'rte_cpuflags.h',
@@ -17,4 +17,3 @@ arch_headers = files(
         'rte_spinlock.h',
         'rte_vect.h',
 )
-install_headers(arch_headers, subdir: get_option('include_subdir_arch'))
diff --git a/lib/eal/x86/include/meson.build b/lib/eal/x86/include/meson.build
index 52d2f8e969..71f149e821 100644
--- a/lib/eal/x86/include/meson.build
+++ b/lib/eal/x86/include/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-arch_headers = files(
+dpdk_arch_headers += files(
         'rte_atomic.h',
         'rte_byteorder.h',
         'rte_cpuflags.h',
@@ -16,11 +16,9 @@ arch_headers = files(
         'rte_spinlock.h',
         'rte_vect.h',
 )
-arch_indirect_headers = files(
+dpdk_arch_indirect_headers += files(
         'rte_atomic_32.h',
         'rte_atomic_64.h',
         'rte_byteorder_32.h',
         'rte_byteorder_64.h',
 )
-install_headers(arch_headers + arch_indirect_headers, subdir: get_option('include_subdir_arch'))
-dpdk_chkinc_headers += arch_headers
diff --git a/lib/meson.build b/lib/meson.build
index a67efaf718..d79740a4c3 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -208,13 +208,9 @@ foreach l:libraries
 
     dpdk_libs_enabled += name
     dpdk_conf.set('RTE_LIB_' + name.to_upper(), 1)
-    install_headers(headers)
-    install_headers(indirect_headers)
-    if get_option('enable_driver_sdk')
-        install_headers(driver_sdk_headers)
-    endif
-    dpdk_chkinc_headers += headers
-    dpdk_chkinc_headers += driver_sdk_headers
+    dpdk_headers += headers
+    dpdk_indirect_headers += indirect_headers
+    dpdk_drivers_headers += driver_sdk_headers
 
     libname = 'rte_' + name
     includes += include_directories(l)
diff --git a/meson.build b/meson.build
index 2423884df7..9f0b06179b 100644
--- a/meson.build
+++ b/meson.build
@@ -37,7 +37,12 @@ dpdk_libraries = []
 dpdk_static_libraries = []
 dpdk_shared_lib_deps = []
 dpdk_static_lib_deps = []
-dpdk_chkinc_headers = []
+dpdk_arch_headers = []
+dpdk_arch_indirect_headers = []
+dpdk_generic_headers = []
+dpdk_headers = []
+dpdk_indirect_headers = []
+dpdk_drivers_headers = []
 dpdk_driver_classes = []
 dpdk_drivers = []
 dpdk_extra_ldflags = []
@@ -106,6 +111,14 @@ if get_option('check_includes')
     subdir('buildtools/chkincs')
 endif
 
+install_headers(dpdk_arch_headers + dpdk_arch_indirect_headers,
+        subdir: get_option('include_subdir_arch'))
+install_headers(dpdk_headers + dpdk_indirect_headers)
+install_headers(dpdk_generic_headers, subdir: 'generic')
+if get_option('enable_driver_sdk')
+    install_headers(dpdk_drivers_headers)
+endif
+
 # write the build config
 build_cfg = 'rte_build_config.h'
 configure_file(output: build_cfg,
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v5 8/9] buildtools/chkincs: use a staging directory for headers
  2025-09-26 12:40 ` [PATCH v5 0/9] Add a stricter headers check David Marchand
                     ` (6 preceding siblings ...)
  2025-09-26 12:41   ` [PATCH v5 7/9] build: factorize headers installation David Marchand
@ 2025-09-26 12:41   ` David Marchand
  2025-09-26 12:41   ` [PATCH v5 9/9] power: separate public and driver headers David Marchand
  8 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2025-09-26 12:41 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson

A problem with the current headers check is that it relies on
meson dependencies objects that come with their include_directories
directives, and all of those point at the library / driver sources.

This means that we won't detect a public header including a private
(as in, not exported) header, or a driver only header.

To address this issue, a staging directory is added and every header
is copied to it.

Drivers and library headers are staged to two different directories
and the check is updated accordingly.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changes since v4:
- split global_inc (isolating config include path from EAL headers),
- moved all changes under buildtools/chkincs,

Changes since v3:
- removed update of global_inc (which was unneeded, and probably was
  what triggered a Windows clang build issue reported by CI),
- moved all staging operations under a check on check_includes= option,
- moved staging directories under buildtools/chkincs/,
- renamed all variables to reflect those concern the headers check,
- made chkincs binaries depend on staging deps instead of having the
  libraries/drivers depend on them,
- added C++ check for driver headers (missed in v3),

---

 buildtools/chkincs/meson.build                | 67 +++++++++++++++----
 buildtools/chkincs/stage-headers.py           | 32 +++++++++
 .../chkincs/staging/drivers/meson.build       | 12 ++++
 buildtools/chkincs/staging/meson.build        | 30 +++++++++
 meson.build                                   |  6 +-
 5 files changed, 131 insertions(+), 16 deletions(-)
 create mode 100644 buildtools/chkincs/stage-headers.py
 create mode 100644 buildtools/chkincs/staging/drivers/meson.build
 create mode 100644 buildtools/chkincs/staging/meson.build

diff --git a/buildtools/chkincs/meson.build b/buildtools/chkincs/meson.build
index ac7df41304..50cb542f23 100644
--- a/buildtools/chkincs/meson.build
+++ b/buildtools/chkincs/meson.build
@@ -6,6 +6,15 @@ if not get_option('check_includes')
     subdir_done()
 endif
 
+stage_headers_cmd = py3 + files('stage-headers.py')
+
+includes = [config_inc]
+deps = []
+includes_drivers = []
+deps_drivers = []
+
+subdir('staging')
+
 gen_c_file_for_header = find_program('gen_c_file_for_header.py')
 gen_c_files = generator(gen_c_file_for_header,
         output: '@BASENAME@.c',
@@ -18,18 +27,7 @@ endif
 cflags += no_wvla_cflag
 
 sources = files('main.c')
-sources += gen_c_files.process(dpdk_arch_headers + dpdk_headers + dpdk_drivers_headers)
-
-# some driver SDK headers depend on these two buses, which are mandatory in build
-# so we always include them in deps list
-deps = [get_variable('shared_rte_bus_vdev'), get_variable('shared_rte_bus_pci')]
-if dpdk_conf.has('RTE_BUS_VMBUS')
-    deps += get_variable('shared_rte_bus_vmbus')
-endif
-# add the rest of the libs to the dependencies
-foreach l:dpdk_libs_enabled
-    deps += get_variable('shared_rte_' + l)
-endforeach
+sources += gen_c_files.process(dpdk_arch_headers + dpdk_headers)
 
 executable('chkincs', sources,
         c_args: cflags,
@@ -49,6 +47,27 @@ executable('chkincs-all', sources,
         dependencies: deps,
         install: false)
 
+sources_drivers = files('main.c')
+sources_drivers += gen_c_files.process(dpdk_drivers_headers)
+
+executable('chkincs-drv', sources_drivers,
+        c_args: cflags,
+        include_directories: includes + includes_drivers,
+        dependencies: deps + deps_drivers,
+        install: false)
+
+executable('chkincs-drv-exp', sources_drivers,
+        c_args: [cflags, '-DALLOW_EXPERIMENTAL_API'],
+        include_directories: includes + includes_drivers,
+        dependencies: deps + deps_drivers,
+        install: false)
+
+executable('chkincs-drv-all', sources_drivers,
+        c_args: [cflags, '-DALLOW_EXPERIMENTAL_API', '-DALLOW_INTERNAL_API'],
+        include_directories: includes + includes_drivers,
+        dependencies: deps + deps_drivers,
+        install: false)
+
 # run tests for c++ builds also
 if not add_languages('cpp', required: false)
     subdir_done()
@@ -59,7 +78,7 @@ gen_cpp_files = generator(gen_c_file_for_header,
         arguments: ['@INPUT@', '@OUTPUT@'])
 
 cpp_sources = files('main.cpp')
-cpp_sources += gen_cpp_files.process(dpdk_arch_headers + dpdk_headers + dpdk_drivers_headers)
+cpp_sources += gen_cpp_files.process(dpdk_arch_headers + dpdk_headers)
 
 executable('chkincs-cpp', cpp_sources,
         cpp_args: ['-include', 'rte_config.h', cflags],
@@ -79,3 +98,25 @@ executable('chkincs-cpp-all', cpp_sources,
         include_directories: includes,
         dependencies: deps,
         install: false)
+
+cpp_sources_drivers = files('main.cpp')
+cpp_sources_drivers += gen_cpp_files.process(dpdk_drivers_headers)
+
+executable('chkincs-drv-cpp', cpp_sources_drivers,
+        cpp_args: ['-include', 'rte_config.h', cflags],
+        include_directories: includes + includes_drivers,
+        dependencies: deps + deps_drivers,
+        install: false)
+
+executable('chkincs-drv-cpp-exp', cpp_sources_drivers,
+        cpp_args: ['-include', 'rte_config.h', cflags, '-DALLOW_EXPERIMENTAL_API'],
+        include_directories: includes + includes_drivers,
+        dependencies: deps + deps_drivers,
+        install: false)
+
+executable('chkincs-drv-cpp-all', cpp_sources_drivers,
+        cpp_args: ['-include', 'rte_config.h', cflags, '-DALLOW_EXPERIMENTAL_API',
+                   '-DALLOW_INTERNAL_API'],
+        include_directories: includes + includes_drivers,
+        dependencies: deps + deps_drivers,
+        install: false)
diff --git a/buildtools/chkincs/stage-headers.py b/buildtools/chkincs/stage-headers.py
new file mode 100644
index 0000000000..3057c6a26f
--- /dev/null
+++ b/buildtools/chkincs/stage-headers.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2025 Red Hat, Inc.
+
+"""
+Headers staging script for DPDK build system.
+"""
+
+import sys
+import os
+import shutil
+from pathlib import Path
+
+def main():
+    if len(sys.argv) < 4:
+        print("Usage: stage-headers.py <staging_dir> <meson_stamp> [headers...]")
+        sys.exit(1)
+
+    staging_dir = Path(sys.argv[1])
+    meson_stamp = Path(sys.argv[2])
+    headers = sys.argv[3:]
+
+    staging_dir.mkdir(parents=True, exist_ok=True)
+
+    for header in headers:
+        file = Path(header)
+        shutil.copy2(file, staging_dir / file.name)
+
+    meson_stamp.touch()
+
+if __name__ == "__main__":
+    main()
diff --git a/buildtools/chkincs/staging/drivers/meson.build b/buildtools/chkincs/staging/drivers/meson.build
new file mode 100644
index 0000000000..c89fe8529a
--- /dev/null
+++ b/buildtools/chkincs/staging/drivers/meson.build
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2025 Red Hat, Inc.
+
+includes += include_directories('.')
+deps += declare_dependency(sources:
+    custom_target('drivers_headers_staging',
+            output: 'drivers_headers_staging.stamp',
+            command: [stage_headers_cmd, meson.current_build_dir(), '@OUTPUT@',
+                dpdk_drivers_headers],
+            install: false,
+    )
+)
diff --git a/buildtools/chkincs/staging/meson.build b/buildtools/chkincs/staging/meson.build
new file mode 100644
index 0000000000..c66cce4831
--- /dev/null
+++ b/buildtools/chkincs/staging/meson.build
@@ -0,0 +1,30 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2025 Red Hat, Inc.
+
+subdir('drivers')
+
+includes += include_directories('.')
+deps += declare_dependency(sources:
+    custom_target('arch_headers_staging',
+            output: 'arch_headers_staging.stamp',
+            command: [stage_headers_cmd, meson.current_build_dir(), '@OUTPUT@',
+                dpdk_arch_headers + dpdk_arch_indirect_headers],
+            install: false,
+    )
+)
+deps += declare_dependency(sources:
+    custom_target('headers_staging',
+            output: 'headers_staging.stamp',
+            command: [stage_headers_cmd, meson.current_build_dir(), '@OUTPUT@',
+                dpdk_headers + dpdk_indirect_headers],
+            install: false,
+    )
+)
+deps += declare_dependency(sources:
+    custom_target('generic_headers_staging',
+            output: 'generic_headers_staging.stamp',
+            command: [stage_headers_cmd, join_paths(meson.current_build_dir(), 'generic'),
+                '@OUTPUT@', dpdk_generic_headers],
+            install: false,
+    )
+)
diff --git a/meson.build b/meson.build
index 9f0b06179b..7f90d3bdc3 100644
--- a/meson.build
+++ b/meson.build
@@ -69,9 +69,9 @@ elif host_machine.cpu_family().startswith('riscv')
 endif
 
 # configure the build, and make sure configs here and in config folder are
-# able to be included in any file. We also store a global array of include dirs
-# for passing to pmdinfogen scripts
-global_inc = [include_directories('.', 'config',
+# able to be included in any file
+config_inc = [include_directories('.', 'config')]
+global_inc = [config_inc, include_directories(
     'lib/eal/include',
     'lib/eal/@0@/include'.format(host_machine.system()),
     'lib/eal/@0@/include'.format(arch_subdir),
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* [PATCH v5 9/9] power: separate public and driver headers
  2025-09-26 12:40 ` [PATCH v5 0/9] Add a stricter headers check David Marchand
                     ` (7 preceding siblings ...)
  2025-09-26 12:41   ` [PATCH v5 8/9] buildtools/chkincs: use a staging directory for headers David Marchand
@ 2025-09-26 12:41   ` David Marchand
  8 siblings, 0 replies; 75+ messages in thread
From: David Marchand @ 2025-09-26 12:41 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, Anatoly Burakov, David Hunt, Sivaprasad Tummala

power_cpufreq.h, power_common.h and power_uncore_ops.h look like driver
only headers, but were included from public headers.
Move them to the driver_sdk_headers list.

There is one complication though for power_cpufreq.h as it was included
from a public header rte_power_cpufreq.h.
Move the rte_power_core_capabilities struct definition to the public
header, since a (stable) public symbol relies on it.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/power/meson.build         |  7 +++++--
 lib/power/power_cpufreq.h     | 14 +-------------
 lib/power/power_uncore_ops.h  |  1 +
 lib/power/rte_power_cpufreq.c |  2 +-
 lib/power/rte_power_cpufreq.h | 15 +++++++++++++--
 lib/power/rte_power_uncore.c  |  2 +-
 lib/power/rte_power_uncore.h  |  3 ++-
 7 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/lib/power/meson.build b/lib/power/meson.build
index 56b59071ea..d89fb55514 100644
--- a/lib/power/meson.build
+++ b/lib/power/meson.build
@@ -22,12 +22,15 @@ sources = files(
         'rte_power_uncore.c',
 )
 headers = files(
-        'power_cpufreq.h',
-        'power_uncore_ops.h',
         'rte_power_cpufreq.h',
         'rte_power_pmd_mgmt.h',
         'rte_power_qos.h',
         'rte_power_uncore.h',
 )
+driver_sdk_headers = files(
+        'power_common.h',
+        'power_cpufreq.h',
+        'power_uncore_ops.h',
+)
 
 deps += ['timer', 'ethdev']
diff --git a/lib/power/power_cpufreq.h b/lib/power/power_cpufreq.h
index 92f1ab8f37..fb0b7feb82 100644
--- a/lib/power/power_cpufreq.h
+++ b/lib/power/power_cpufreq.h
@@ -14,6 +14,7 @@
 #include <rte_common.h>
 #include <rte_log.h>
 #include <rte_compat.h>
+#include <rte_power_cpufreq.h>
 
 #define RTE_POWER_DRIVER_NAMESZ 24
 
@@ -131,19 +132,6 @@ typedef int (*rte_power_freq_change_t)(unsigned int lcore_id);
  *  - Negative on error.
  */
 
-/**
- * Power capabilities summary.
- */
-struct rte_power_core_capabilities {
-	union {
-		uint64_t capabilities;
-		struct {
-			uint64_t turbo:1;       /**< Turbo can be enabled. */
-			uint64_t priority:1;    /**< SST-BF high freq core */
-		};
-	};
-};
-
 typedef int (*rte_power_get_capabilities_t)(unsigned int lcore_id,
 			struct rte_power_core_capabilities *caps);
 
diff --git a/lib/power/power_uncore_ops.h b/lib/power/power_uncore_ops.h
index b92af28df9..783860ee5b 100644
--- a/lib/power/power_uncore_ops.h
+++ b/lib/power/power_uncore_ops.h
@@ -13,6 +13,7 @@
 
 #include <rte_compat.h>
 #include <rte_common.h>
+#include <rte_power_uncore.h>
 
 #define RTE_POWER_UNCORE_DRIVER_NAMESZ 24
 
diff --git a/lib/power/rte_power_cpufreq.c b/lib/power/rte_power_cpufreq.c
index d4db03a4e5..f63e976dc2 100644
--- a/lib/power/rte_power_cpufreq.c
+++ b/lib/power/rte_power_cpufreq.c
@@ -6,8 +6,8 @@
 #include <rte_spinlock.h>
 #include <rte_debug.h>
 
-#include "rte_power_cpufreq.h"
 #include "power_common.h"
+#include "power_cpufreq.h"
 
 static enum power_management_env global_default_env = PM_ENV_NOT_SET;
 static struct rte_power_cpufreq_ops *global_cpufreq_ops;
diff --git a/lib/power/rte_power_cpufreq.h b/lib/power/rte_power_cpufreq.h
index 82d274214b..1605ba866a 100644
--- a/lib/power/rte_power_cpufreq.h
+++ b/lib/power/rte_power_cpufreq.h
@@ -14,8 +14,6 @@
 #include <rte_common.h>
 #include <rte_log.h>
 
-#include "power_cpufreq.h"
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -248,6 +246,19 @@ int rte_power_freq_enable_turbo(unsigned int lcore_id);
  */
 int rte_power_freq_disable_turbo(unsigned int lcore_id);
 
+/**
+ * Power capabilities summary.
+ */
+struct rte_power_core_capabilities {
+	union {
+		uint64_t capabilities;
+		struct {
+			uint64_t turbo:1;       /**< Turbo can be enabled. */
+			uint64_t priority:1;    /**< SST-BF high freq core */
+		};
+	};
+};
+
 /**
  * Returns power capabilities for a specific lcore.
  * Function pointer definition. Review each environments
diff --git a/lib/power/rte_power_uncore.c b/lib/power/rte_power_uncore.c
index 30cd374127..25bdb113c5 100644
--- a/lib/power/rte_power_uncore.c
+++ b/lib/power/rte_power_uncore.c
@@ -7,8 +7,8 @@
 #include <rte_spinlock.h>
 #include <rte_debug.h>
 
-#include "rte_power_uncore.h"
 #include "power_common.h"
+#include "power_uncore_ops.h"
 
 static enum rte_uncore_power_mgmt_env global_uncore_env = RTE_UNCORE_PM_ENV_NOT_SET;
 static struct rte_power_uncore_ops *global_uncore_ops;
diff --git a/lib/power/rte_power_uncore.h b/lib/power/rte_power_uncore.h
index dfeade77e9..66aea1b37f 100644
--- a/lib/power/rte_power_uncore.h
+++ b/lib/power/rte_power_uncore.h
@@ -11,7 +11,8 @@
  * Uncore Frequency Management
  */
 
-#include "power_uncore_ops.h"
+#include <rte_compat.h>
+#include <rte_common.h>
 
 #ifdef __cplusplus
 extern "C" {
-- 
2.51.0


^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v5 6/9] eal/arm: fix C++ build for 32-bit memcpy
  2025-09-26 12:40   ` [PATCH v5 6/9] eal/arm: fix C++ build for 32-bit memcpy David Marchand
@ 2025-09-26 13:01     ` Bruce Richardson
  2025-09-26 19:55     ` Morten Brørup
  1 sibling, 0 replies; 75+ messages in thread
From: Bruce Richardson @ 2025-09-26 13:01 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, stable, Wathsala Vithanage, Mattias Rönnblom,
	Morten Brørup

On Fri, Sep 26, 2025 at 02:40:59PM +0200, David Marchand wrote:
> This was caught while checking ARM arch headers.
> 
> In file included from buildtools/chkincs/chkincs-cpp.p/rte_memcpy_32.cpp:1:
> /home/runner/work/dpdk/dpdk/lib/eal/arm/include/rte_memcpy_32.h:302:1:
> 	error: expected declaration before ‘}’ token
>   302 | }
>       | ^
> 
> Fixes: 719834a6849e ("use C linkage where appropriate in headers")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  lib/eal/arm/include/rte_memcpy_32.h | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

> diff --git a/lib/eal/arm/include/rte_memcpy_32.h b/lib/eal/arm/include/rte_memcpy_32.h
> index 99fd5757ca..861be06f5e 100644
> --- a/lib/eal/arm/include/rte_memcpy_32.h
> +++ b/lib/eal/arm/include/rte_memcpy_32.h
> @@ -19,10 +19,14 @@
>  /* ARM NEON Intrinsics are used to copy data */
>  #include <arm_neon.h>
>  
> +#endif /* RTE_ARCH_ARM_NEON_MEMCPY */
> +
>  #ifdef __cplusplus
>  extern "C" {
>  #endif
>  
> +#ifdef RTE_ARCH_ARM_NEON_MEMCPY
> +
>  static inline void
>  rte_mov16(uint8_t *dst, const uint8_t *src)
>  {
> @@ -252,7 +256,7 @@ rte_memcpy_func(void *dst, const void *src, size_t n)
>  	return ret;
>  }
>  
> -#else
> +#else /* ! RTE_ARCH_ARM_NEON_MEMCPY */
>  
>  static inline void
>  rte_mov16(uint8_t *dst, const uint8_t *src)
> -- 
> 2.51.0
> 

^ permalink raw reply	[flat|nested] 75+ messages in thread

* Re: [PATCH v5 7/9] build: factorize headers installation
  2025-09-26 12:41   ` [PATCH v5 7/9] build: factorize headers installation David Marchand
@ 2025-09-26 13:08     ` Bruce Richardson
  0 siblings, 0 replies; 75+ messages in thread
From: Bruce Richardson @ 2025-09-26 13:08 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, Thomas Monjalon, Jiawen Wu, Jian Wang, Zaiyu Wang,
	Wathsala Vithanage, Tyler Retzlaff, Min Zhou, David Christensen,
	Stanisław Kardach, Sun Yuechi, Konstantin Ananyev

On Fri, Sep 26, 2025 at 02:41:00PM +0200, David Marchand wrote:
> Gather all headers in global variables, put headers installation
> in a single location and make the headers check use them instead of
> dpdk_chkinc_headers.
> 
> This rework reveals a number of issues:
> - net/txgbe driver was directly installing its header, bypassing
>   drivers/meson.build and skipping the headers check,
> - arch headers were not checked except for x86,
> - some driver headers were not checked,
> 
> For the last point, a build warning must be disabled (like it is
> globally in DPDK) for headers from raw drivers.
> 
> Finally, checkpatches is updated to avoid reintroductions of
> install_headers().
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
Good cleanup, thanks.

Acked-by: Bruce Richardson <bruce.richardson@intel.com>


^ permalink raw reply	[flat|nested] 75+ messages in thread

* RE: [PATCH v5 6/9] eal/arm: fix C++ build for 32-bit memcpy
  2025-09-26 12:40   ` [PATCH v5 6/9] eal/arm: fix C++ build for 32-bit memcpy David Marchand
  2025-09-26 13:01     ` Bruce Richardson
@ 2025-09-26 19:55     ` Morten Brørup
  1 sibling, 0 replies; 75+ messages in thread
From: Morten Brørup @ 2025-09-26 19:55 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: bruce.richardson, stable, Wathsala Vithanage, Mattias Rönnblom

> From: David Marchand [mailto:david.marchand@redhat.com]
> Sent: Friday, 26 September 2025 14.41
> 
> This was caught while checking ARM arch headers.
> 
> In file included from buildtools/chkincs/chkincs-
> cpp.p/rte_memcpy_32.cpp:1:
> /home/runner/work/dpdk/dpdk/lib/eal/arm/include/rte_memcpy_32.h:302:1:
> 	error: expected declaration before ‘}’ token
>   302 | }
>       | ^
> 
> Fixes: 719834a6849e ("use C linkage where appropriate in headers")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---

Acked-by: Morten Brørup <mb@smartsharesystems.com>


^ permalink raw reply	[flat|nested] 75+ messages in thread

end of thread, other threads:[~2025-09-26 19:55 UTC | newest]

Thread overview: 75+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-27 11:26 [RFC 0/6] Add a stricter headers check David Marchand
2024-11-27 11:26 ` [RFC 1/6] baseband/acc: fix exported header David Marchand
2024-11-27 11:26 ` [RFC 2/6] drivers: drop export of driver headers David Marchand
2024-11-27 11:26 ` [RFC 3/6] eventdev: do not include driver header in DMA adapter David Marchand
2024-11-27 13:49   ` [EXTERNAL] " Amit Prakash Shukla
2024-11-27 11:26 ` [RFC 4/6] drivers: fix exported headers David Marchand
2024-11-27 11:26 ` [RFC 5/6] build: install indirect headers to a dedicated directory David Marchand
2024-11-27 11:42   ` Bruce Richardson
2024-12-10 13:36     ` David Marchand
2024-11-27 11:26 ` [RFC 6/6] buildtools: externally check exported headers David Marchand
2024-12-13 10:50 ` [PATCH v2 0/6] Add a stricter headers check David Marchand
2024-12-13 10:50   ` [PATCH v2 1/6] baseband/acc: fix exported header David Marchand
2024-12-13 11:01     ` Bruce Richardson
2024-12-13 10:50   ` [PATCH v2 2/6] drivers: drop export of driver headers David Marchand
2024-12-13 11:03     ` Bruce Richardson
2024-12-16  9:13       ` Andrew Rybchenko
2024-12-13 10:50   ` [PATCH v2 3/6] eventdev: do not include driver header in DMA adapter David Marchand
2024-12-13 11:04     ` Bruce Richardson
2024-12-13 10:50   ` [PATCH v2 4/6] drivers: fix exported headers David Marchand
2024-12-13 11:14     ` Bruce Richardson
2024-12-13 13:46       ` David Marchand
2024-12-16  8:15         ` David Marchand
2024-12-13 17:10     ` Stephen Hemminger
2024-12-13 10:50   ` [PATCH v2 5/6] build: install indirect headers to a dedicated directory David Marchand
2024-12-13 10:50   ` [PATCH v2 6/6] buildtools: externally check exported headers David Marchand
2024-12-13 11:27   ` [PATCH v2 0/6] Add a stricter headers check Bruce Richardson
2024-12-13 13:38     ` David Marchand
2025-09-24 17:25 ` [PATCH v3 0/7] " David Marchand
2025-09-24 17:25   ` [PATCH v3 1/7] baseband/acc: fix exported header David Marchand
2025-09-24 17:25   ` [PATCH v3 2/7] drivers: drop export of driver headers David Marchand
2025-09-24 17:25   ` [PATCH v3 3/7] eventdev: do not include driver header in DMA adapter David Marchand
2025-09-24 17:25   ` [PATCH v3 4/7] gpudev: fix driver header for Windows David Marchand
2025-09-25  7:53     ` Bruce Richardson
2025-09-25  8:43       ` David Marchand
2025-09-24 17:25   ` [PATCH v3 5/7] drivers: fix some exported headers David Marchand
2025-09-24 17:25   ` [PATCH v3 6/7] buildtools/chkincs: use a staging directory for headers David Marchand
2025-09-25  8:00     ` Bruce Richardson
2025-09-25  8:42       ` David Marchand
2025-09-25  9:22         ` Bruce Richardson
2025-09-25 10:29           ` David Marchand
2025-09-25 10:31             ` Bruce Richardson
2025-09-25  9:31         ` Bruce Richardson
2025-09-25 10:17           ` Morten Brørup
2025-09-25 10:22             ` Bruce Richardson
2025-09-25 10:22           ` David Marchand
2025-09-25 10:31             ` Bruce Richardson
2025-09-24 17:25   ` [PATCH v3 7/7] power: separate public and driver headers David Marchand
2025-09-25 12:31 ` [PATCH v4 0/7] Add a stricter headers check David Marchand
2025-09-25 12:31   ` [PATCH v4 1/7] baseband/acc: fix exported header David Marchand
2025-09-25 12:31   ` [PATCH v4 2/7] drivers: drop export of driver headers David Marchand
2025-09-25 12:34     ` [EXTERNAL] " Akhil Goyal
2025-09-25 12:31   ` [PATCH v4 3/7] eventdev: do not include driver header in DMA adapter David Marchand
2025-09-25 12:31   ` [PATCH v4 4/7] gpudev: fix driver header for Windows David Marchand
2025-09-25 12:43     ` Bruce Richardson
2025-09-25 12:31   ` [PATCH v4 5/7] drivers: fix some exported headers David Marchand
2025-09-25 12:44     ` Bruce Richardson
2025-09-25 12:31   ` [PATCH v4 6/7] buildtools/chkincs: use a staging directory for headers David Marchand
2025-09-25 14:46     ` Bruce Richardson
2025-09-26  8:14       ` David Marchand
2025-09-26  9:06         ` Bruce Richardson
2025-09-26  9:18           ` David Marchand
2025-09-25 12:31   ` [PATCH v4 7/7] power: separate public and driver headers David Marchand
2025-09-26 12:40 ` [PATCH v5 0/9] Add a stricter headers check David Marchand
2025-09-26 12:40   ` [PATCH v5 1/9] baseband/acc: fix exported header David Marchand
2025-09-26 12:40   ` [PATCH v5 2/9] drivers: drop export of driver headers David Marchand
2025-09-26 12:40   ` [PATCH v5 3/9] eventdev: do not include driver header in DMA adapter David Marchand
2025-09-26 12:40   ` [PATCH v5 4/9] gpudev: fix driver header for Windows David Marchand
2025-09-26 12:40   ` [PATCH v5 5/9] drivers: fix some exported headers David Marchand
2025-09-26 12:40   ` [PATCH v5 6/9] eal/arm: fix C++ build for 32-bit memcpy David Marchand
2025-09-26 13:01     ` Bruce Richardson
2025-09-26 19:55     ` Morten Brørup
2025-09-26 12:41   ` [PATCH v5 7/9] build: factorize headers installation David Marchand
2025-09-26 13:08     ` Bruce Richardson
2025-09-26 12:41   ` [PATCH v5 8/9] buildtools/chkincs: use a staging directory for headers David Marchand
2025-09-26 12:41   ` [PATCH v5 9/9] power: separate public and driver headers David Marchand

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).