DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] cleanup compat header inclusions
@ 2022-11-02 15:08 David Marchand
  2022-11-02 16:08 ` Bruce Richardson
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: David Marchand @ 2022-11-02 15:08 UTC (permalink / raw)
  To: dev; +Cc: thomas, gakhil, ferruh.yigit, andrew.rybchenko, jerinj

With symbols going though experimental/stable stages, we accumulated
a lot of discrepancies about inclusion of the rte_compat.h header.

Some headers are including it where unneeded, while others rely on
implicit inclusion.

Fix unneeded inclusions:
$ git grep -l include..rte_compat.h |
  xargs grep -LE '__rte_(internal|experimental)' |
  xargs sed -i -e '/#include..rte_compat.h/d'

Fix missing inclusion, by inserting rte_compat.h before the first
inclusion of a DPDK header:
$ git grep -lE '__rte_(internal|experimental)' |
  xargs grep -L include..rte_compat.h |
  xargs sed -i -e \
    '0,/#include..\(rte_\|.*pmd.h.$\)/{
      s/\(#include..\(rte_\|.*pmd.h.$\)\)/#include <rte_compat.h>\n\1/
    }'

Fix missing inclusion, by inserting rte_compat.h after the last
inclusion of a non DPDK header:
$ for file in $(git grep -lE '__rte_(internal|experimental)' |
  xargs grep -L include..rte_compat.h); do
    tac $file > $file.$$
    sed -i -e \
      '0,/#include../{
        s/\(#include..*$\)/#include <rte_compat.h>\n\n\1/
      }' $file.$$
    tac $file.$$ > $file
    rm $file.$$
  done

Fix missing inclusion, by inserting rte_compat.h after the header guard:
$ git grep -lE '__rte_(internal|experimental)' |
  xargs grep -L include..rte_compat.h |
  xargs sed -i -e \
    '0,/#define/{
      s/\(#define .*$\)/\1\n\n#include <rte_compat.h>/
    }'

And finally, exclude rte_compat.h itself.
$ git checkout lib/eal/include/rte_compat.h

At the end of all this, we have a clean tree:
$ git grep -lE '__rte_(internal|experimental)' |
  xargs grep -L include..rte_compat.h
buildtools/check-symbols.sh
devtools/checkpatches.sh
doc/guides/contributing/abi_policy.rst
doc/guides/rel_notes/release_20_11.rst
lib/eal/include/rte_compat.h

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/baseband/acc/rte_acc_cfg.h                     | 1 +
 drivers/baseband/acc/rte_acc_common_cfg.h              | 1 +
 drivers/baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h | 2 ++
 drivers/baseband/fpga_lte_fec/fpga_lte_fec.h           | 2 ++
 drivers/bus/dpaa/include/fsl_bman.h                    | 2 ++
 drivers/bus/dpaa/include/fsl_qman.h                    | 1 +
 drivers/bus/dpaa/include/fsl_usd.h                     | 2 ++
 drivers/bus/dpaa/include/netcfg.h                      | 2 ++
 drivers/bus/dpaa/include/process.h                     | 1 +
 drivers/bus/fslmc/mc/fsl_dpci.h                        | 2 ++
 drivers/bus/fslmc/mc/fsl_dpcon.h                       | 2 ++
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.h               | 2 ++
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h                | 1 +
 drivers/bus/pci/rte_bus_pci.h                          | 1 +
 drivers/bus/vmbus/rte_bus_vmbus.h                      | 1 -
 drivers/common/cnxk/roc_platform.h                     | 1 +
 drivers/common/cpt/cpt_pmd_ops_helper.h                | 2 ++
 drivers/common/dpaax/dpaax_iova_table.h                | 1 +
 drivers/common/iavf/iavf_prototype.h                   | 2 ++
 drivers/common/idpf/base/idpf_controlq_api.h           | 2 ++
 drivers/common/mlx5/linux/mlx5_common_os.h             | 1 +
 drivers/common/mlx5/linux/mlx5_nl.h                    | 1 +
 drivers/common/mlx5/mlx5_common.h                      | 1 +
 drivers/common/mlx5/mlx5_common_devx.h                 | 2 ++
 drivers/common/mlx5/mlx5_common_mp.h                   | 1 +
 drivers/common/mlx5/mlx5_common_mr.h                   | 1 +
 drivers/common/mlx5/mlx5_common_utils.h                | 1 +
 drivers/common/mlx5/mlx5_malloc.h                      | 2 ++
 drivers/common/mlx5/windows/mlx5_common_os.h           | 1 +
 drivers/common/octeontx/octeontx_mbox.h                | 1 +
 drivers/common/sfc_efx/efsys.h                         | 1 +
 drivers/common/sfc_efx/sfc_efx.h                       | 2 ++
 drivers/common/sfc_efx/sfc_efx_mcdi.h                  | 1 +
 drivers/crypto/cnxk/cn10k_cryptodev_ops.h              | 1 +
 drivers/crypto/cnxk/cn9k_cryptodev_ops.h               | 1 +
 drivers/crypto/dpaa2_sec/dpaa2_sec_event.h             | 2 ++
 drivers/crypto/dpaa_sec/dpaa_sec_event.h               | 2 ++
 drivers/crypto/octeontx/otx_cryptodev_ops.h            | 1 +
 drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h                 | 2 ++
 drivers/event/dlb2/rte_pmd_dlb2.h                      | 2 ++
 drivers/mempool/dpaa2/dpaa2_hw_mempool.h               | 2 ++
 drivers/mempool/dpaa2/rte_dpaa2_mempool.h              | 1 +
 drivers/net/bonding/rte_eth_bond_8023ad.c              | 1 -
 drivers/net/cnxk/cnxk_ethdev.h                         | 1 +
 drivers/net/dpaa/dpaa_ethdev.h                         | 1 +
 drivers/net/dpaa2/dpaa2_ethdev.h                       | 1 +
 drivers/net/dpaa2/rte_pmd_dpaa2.h                      | 1 +
 drivers/net/iavf/rte_pmd_iavf.h                        | 1 +
 drivers/net/ice/ice_ethdev.h                           | 1 +
 drivers/net/mlx5/rte_pmd_mlx5.h                        | 2 ++
 drivers/net/txgbe/rte_pmd_txgbe.h                      | 1 -
 lib/bbdev/rte_bbdev.h                                  | 1 +
 lib/bbdev/rte_bbdev_op.h                               | 1 +
 lib/bpf/rte_bpf.h                                      | 1 +
 lib/compressdev/rte_comp.h                             | 1 +
 lib/compressdev/rte_compressdev.h                      | 1 +
 lib/compressdev/rte_compressdev_pmd.h                  | 1 +
 lib/cryptodev/cryptodev_pmd.h                          | 1 +
 lib/cryptodev/rte_crypto_sym.h                         | 1 +
 lib/cryptodev/rte_cryptodev.h                          | 1 +
 lib/dmadev/rte_dmadev_pmd.h                            | 1 +
 lib/eal/arm/include/rte_io_64.h                        | 1 +
 lib/eal/arm/include/rte_prefetch_32.h                  | 1 +
 lib/eal/arm/include/rte_prefetch_64.h                  | 1 +
 lib/eal/freebsd/eal.c                                  | 1 -
 lib/eal/freebsd/eal_dev.c                              | 1 -
 lib/eal/include/generic/rte_atomic.h                   | 1 +
 lib/eal/include/generic/rte_cycles.h                   | 1 -
 lib/eal/include/generic/rte_pause.h                    | 1 -
 lib/eal/include/rte_bitmap.h                           | 1 +
 lib/eal/include/rte_class.h                            | 1 +
 lib/eal/include/rte_eal_memconfig.h                    | 1 -
 lib/eal/include/rte_epoll.h                            | 1 -
 lib/eal/include/rte_fbarray.h                          | 1 -
 lib/eal/include/rte_lcore.h                            | 1 +
 lib/eal/include/rte_log.h                              | 1 -
 lib/eal/include/rte_malloc.h                           | 1 -
 lib/eal/include/rte_memory.h                           | 1 -
 lib/eal/include/rte_memzone.h                          | 1 -
 lib/eal/include/rte_pflock.h                           | 1 +
 lib/eal/include/rte_service.h                          | 1 +
 lib/eal/include/rte_service_component.h                | 1 -
 lib/eal/loongarch/include/rte_prefetch.h               | 1 +
 lib/eal/ppc/include/rte_atomic.h                       | 1 -
 lib/eal/ppc/include/rte_prefetch.h                     | 1 +
 lib/eal/riscv/include/rte_prefetch.h                   | 1 +
 lib/eal/x86/include/rte_io.h                           | 1 +
 lib/eal/x86/include/rte_prefetch.h                     | 1 +
 lib/ethdev/ethdev_driver.h                             | 1 +
 lib/ethdev/rte_flow.h                                  | 1 +
 lib/ethdev/rte_tm.h                                    | 1 +
 lib/eventdev/eventdev_pmd_pci.h                        | 1 +
 lib/eventdev/eventdev_pmd_vdev.h                       | 1 +
 lib/eventdev/rte_event_eth_rx_adapter.h                | 1 +
 lib/eventdev/rte_event_eth_tx_adapter.h                | 1 +
 lib/eventdev/rte_eventdev.h                            | 1 +
 lib/gpudev/gpudev_driver.h                             | 1 +
 lib/graph/rte_graph_worker.h                           | 1 +
 lib/hash/rte_hash.h                                    | 1 -
 lib/hash/rte_thash.h                                   | 1 +
 lib/hash/rte_thash_gfni.h                              | 1 +
 lib/hash/rte_thash_x86_gfni.h                          | 1 +
 lib/ip_frag/rte_ip_frag.h                              | 1 +
 lib/ipsec/rte_ipsec.h                                  | 1 +
 lib/ipsec/rte_ipsec_sad.h                              | 1 -
 lib/kni/rte_kni.h                                      | 1 +
 lib/lpm/rte_lpm.h                                      | 1 +
 lib/lpm/rte_lpm_sve.h                                  | 1 +
 lib/mbuf/rte_mbuf_core.h                               | 1 -
 lib/member/rte_member.h                                | 1 +
 lib/mempool/rte_mempool.h                              | 1 +
 lib/meter/rte_meter.h                                  | 1 -
 lib/metrics/rte_metrics.h                              | 1 -
 lib/metrics/rte_metrics_telemetry.h                    | 1 +
 lib/net/rte_ip.h                                       | 1 +
 lib/node/rte_node_eth_api.h                            | 1 +
 lib/pdump/rte_pdump.h                                  | 1 +
 lib/power/rte_power.h                                  | 1 +
 lib/power/rte_power_empty_poll.h                       | 1 +
 lib/power/rte_power_intel_uncore.h                     | 1 +
 lib/power/rte_power_pmd_mgmt.h                         | 1 +
 lib/rcu/rte_rcu_qsbr.h                                 | 1 +
 lib/regexdev/rte_regexdev.h                            | 1 +
 lib/regexdev/rte_regexdev_driver.h                     | 1 +
 lib/reorder/rte_reorder.h                              | 1 +
 lib/sched/rte_pie.h                                    | 1 +
 lib/security/rte_security_driver.h                     | 1 +
 lib/telemetry/rte_telemetry.h                          | 1 -
 lib/timer/rte_timer.h                                  | 1 +
 lib/vhost/rte_vhost.h                                  | 1 +
 130 files changed, 128 insertions(+), 22 deletions(-)

diff --git a/drivers/baseband/acc/rte_acc_cfg.h b/drivers/baseband/acc/rte_acc_cfg.h
index 21bcf88dad..9526b7ab8e 100644
--- a/drivers/baseband/acc/rte_acc_cfg.h
+++ b/drivers/baseband/acc/rte_acc_cfg.h
@@ -18,6 +18,7 @@
 
 #include <stdint.h>
 #include <stdbool.h>
+#include <rte_compat.h>
 #include "rte_acc_common_cfg.h"
 
 #ifdef __cplusplus
diff --git a/drivers/baseband/acc/rte_acc_common_cfg.h b/drivers/baseband/acc/rte_acc_common_cfg.h
index cce75d5878..c6545d49db 100644
--- a/drivers/baseband/acc/rte_acc_common_cfg.h
+++ b/drivers/baseband/acc/rte_acc_common_cfg.h
@@ -19,6 +19,7 @@
 #include <stdint.h>
 #include <stdbool.h>
 
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/drivers/baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h b/drivers/baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h
index 93a87c8e82..f042d5dea5 100644
--- a/drivers/baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h
+++ b/drivers/baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h
@@ -8,6 +8,8 @@
 #include <stdint.h>
 #include <stdbool.h>
 
+#include <rte_compat.h>
+
 /**
  * @file rte_pmd_fpga_5gnr_fec.h
  *
diff --git a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.h b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.h
index b35c7a484e..9a01a58a49 100644
--- a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.h
+++ b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.h
@@ -8,6 +8,8 @@
 #include <stdint.h>
 #include <stdbool.h>
 
+#include <rte_compat.h>
+
 /**
  * @file fpga_lte_fec.h
  *
diff --git a/drivers/bus/dpaa/include/fsl_bman.h b/drivers/bus/dpaa/include/fsl_bman.h
index 82da2fcfe0..6719a4e3c9 100644
--- a/drivers/bus/dpaa/include/fsl_bman.h
+++ b/drivers/bus/dpaa/include/fsl_bman.h
@@ -7,6 +7,8 @@
 #ifndef __FSL_BMAN_H
 #define __FSL_BMAN_H
 
+#include <rte_compat.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h
index 9b63e559bc..5953309b7a 100644
--- a/drivers/bus/dpaa/include/fsl_qman.h
+++ b/drivers/bus/dpaa/include/fsl_qman.h
@@ -13,6 +13,7 @@ extern "C" {
 #endif
 
 #include <dpaa_rbtree.h>
+#include <rte_compat.h>
 #include <rte_eventdev.h>
 
 /* FQ lookups (turn this on for 64bit user-space) */
diff --git a/drivers/bus/dpaa/include/fsl_usd.h b/drivers/bus/dpaa/include/fsl_usd.h
index 97279421ad..5bf13c0b46 100644
--- a/drivers/bus/dpaa/include/fsl_usd.h
+++ b/drivers/bus/dpaa/include/fsl_usd.h
@@ -13,6 +13,8 @@
 #include <dpaa_list.h>
 #include <fsl_qman.h>
 
+#include <rte_compat.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/drivers/bus/dpaa/include/netcfg.h b/drivers/bus/dpaa/include/netcfg.h
index 43c7e1cfe1..5bdcc9186a 100644
--- a/drivers/bus/dpaa/include/netcfg.h
+++ b/drivers/bus/dpaa/include/netcfg.h
@@ -10,6 +10,8 @@
 
 #include <fman.h>
 
+#include <rte_compat.h>
+
 /* Configuration information related to a specific ethernet port */
 struct fm_eth_port_cfg {
 	/**< A list of PCD FQ ranges, obtained from FMC configuration */
diff --git a/drivers/bus/dpaa/include/process.h b/drivers/bus/dpaa/include/process.h
index 48d6b5693f..610664672c 100644
--- a/drivers/bus/dpaa/include/process.h
+++ b/drivers/bus/dpaa/include/process.h
@@ -10,6 +10,7 @@
 #define	__PROCESS_H
 
 #include <compat.h>
+#include <rte_compat.h>
 #include <rte_ethdev.h>
 
 /* The process device underlies process-wide user/kernel interactions, such as
diff --git a/drivers/bus/fslmc/mc/fsl_dpci.h b/drivers/bus/fslmc/mc/fsl_dpci.h
index 81fd3438aa..397b4bc2be 100644
--- a/drivers/bus/fslmc/mc/fsl_dpci.h
+++ b/drivers/bus/fslmc/mc/fsl_dpci.h
@@ -9,6 +9,8 @@
 
 #include <fsl_dpopr.h>
 
+#include <rte_compat.h>
+
 /* Data Path Communication Interface API
  * Contains initialization APIs and runtime control APIs for DPCI
  */
diff --git a/drivers/bus/fslmc/mc/fsl_dpcon.h b/drivers/bus/fslmc/mc/fsl_dpcon.h
index 7caa6c68a1..db72477c8a 100644
--- a/drivers/bus/fslmc/mc/fsl_dpcon.h
+++ b/drivers/bus/fslmc/mc/fsl_dpcon.h
@@ -7,6 +7,8 @@
 #ifndef __FSL_DPCON_H
 #define __FSL_DPCON_H
 
+#include <rte_compat.h>
+
 /* Data Path Concentrator API
  * Contains initialization APIs and runtime control APIs for DPCON
  */
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h
index b8eb8ee0ab..7407f8d38d 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h
@@ -11,6 +11,8 @@
 #include <mc/fsl_dpio.h>
 #include <mc/fsl_mc_sys.h>
 
+#include <rte_compat.h>
+
 struct dpaa2_io_portal_t {
 	struct dpaa2_dpio_dev *dpio_dev;
 	struct dpaa2_dpio_dev *ethrx_dpio_dev;
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index 024fbf9935..bd949ade3a 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -8,6 +8,7 @@
 #ifndef _DPAA2_HW_PVT_H_
 #define _DPAA2_HW_PVT_H_
 
+#include <rte_compat.h>
 #include <rte_eventdev.h>
 #include <dpaax_iova_table.h>
 
diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h
index 60e50ca875..b193114fe5 100644
--- a/drivers/bus/pci/rte_bus_pci.h
+++ b/drivers/bus/pci/rte_bus_pci.h
@@ -22,6 +22,7 @@ extern "C" {
 #include <stdint.h>
 #include <inttypes.h>
 
+#include <rte_compat.h>
 #include <rte_debug.h>
 #include <rte_interrupts.h>
 #include <rte_pci.h>
diff --git a/drivers/bus/vmbus/rte_bus_vmbus.h b/drivers/bus/vmbus/rte_bus_vmbus.h
index 03894a5d46..9467bd8f3d 100644
--- a/drivers/bus/vmbus/rte_bus_vmbus.h
+++ b/drivers/bus/vmbus/rte_bus_vmbus.h
@@ -23,7 +23,6 @@ extern "C" {
 #include <stdint.h>
 #include <inttypes.h>
 
-#include <rte_compat.h>
 #include <rte_uuid.h>
 #include <rte_debug.h>
 #include <rte_interrupts.h>
diff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc_platform.h
index 5efe44674a..1a48ff3db4 100644
--- a/drivers/common/cnxk/roc_platform.h
+++ b/drivers/common/cnxk/roc_platform.h
@@ -5,6 +5,7 @@
 #ifndef _ROC_PLATFORM_H_
 #define _ROC_PLATFORM_H_
 
+#include <rte_compat.h>
 #include <rte_alarm.h>
 #include <rte_bitmap.h>
 #include <bus_pci_driver.h>
diff --git a/drivers/common/cpt/cpt_pmd_ops_helper.h b/drivers/common/cpt/cpt_pmd_ops_helper.h
index 413ca50edd..0ba872e74e 100644
--- a/drivers/common/cpt/cpt_pmd_ops_helper.h
+++ b/drivers/common/cpt/cpt_pmd_ops_helper.h
@@ -5,6 +5,8 @@
 #ifndef _CPT_PMD_OPS_HELPER_H_
 #define _CPT_PMD_OPS_HELPER_H_
 
+#include <rte_compat.h>
+
 /*
  * This file defines the agreement between the common layer and the individual
  * crypto drivers for OCTEON TX series. Control path in otx* directory can
diff --git a/drivers/common/dpaax/dpaax_iova_table.h b/drivers/common/dpaax/dpaax_iova_table.h
index 9a18eafca0..1f915eb270 100644
--- a/drivers/common/dpaax/dpaax_iova_table.h
+++ b/drivers/common/dpaax/dpaax_iova_table.h
@@ -19,6 +19,7 @@
 #include <errno.h>
 #include <arpa/inet.h>
 
+#include <rte_compat.h>
 #include <rte_eal.h>
 #include <rte_branch_prediction.h>
 #include <rte_memory.h>
diff --git a/drivers/common/iavf/iavf_prototype.h b/drivers/common/iavf/iavf_prototype.h
index 1c125d1d94..b5124de5bf 100644
--- a/drivers/common/iavf/iavf_prototype.h
+++ b/drivers/common/iavf/iavf_prototype.h
@@ -9,6 +9,8 @@
 #include "iavf_alloc.h"
 #include "virtchnl.h"
 
+#include <rte_compat.h>
+
 /* Prototypes for shared code functions that are not in
  * the standard function pointer structures.  These are
  * mostly because they are needed even before the init
diff --git a/drivers/common/idpf/base/idpf_controlq_api.h b/drivers/common/idpf/base/idpf_controlq_api.h
index 2d79c7f4dd..68ac0cfe70 100644
--- a/drivers/common/idpf/base/idpf_controlq_api.h
+++ b/drivers/common/idpf/base/idpf_controlq_api.h
@@ -9,6 +9,8 @@
 #include "idpf_mem.h"
 #else /* !__KERNEL__ */
 #include "idpf_osdep.h"
+
+#include <rte_compat.h>
 #endif /* !__KERNEL__ */
 
 struct idpf_hw;
diff --git a/drivers/common/mlx5/linux/mlx5_common_os.h b/drivers/common/mlx5/linux/mlx5_common_os.h
index 81702b8768..e8aa1d46ec 100644
--- a/drivers/common/mlx5/linux/mlx5_common_os.h
+++ b/drivers/common/mlx5/linux/mlx5_common_os.h
@@ -8,6 +8,7 @@
 #include <stdio.h>
 #include <malloc.h>
 
+#include <rte_compat.h>
 #include <rte_pci.h>
 #include <bus_pci_driver.h>
 #include <rte_debug.h>
diff --git a/drivers/common/mlx5/linux/mlx5_nl.h b/drivers/common/mlx5/linux/mlx5_nl.h
index 0b7552338a..db01d7323e 100644
--- a/drivers/common/mlx5/linux/mlx5_nl.h
+++ b/drivers/common/mlx5/linux/mlx5_nl.h
@@ -7,6 +7,7 @@
 
 #include <linux/netlink.h>
 
+#include <rte_compat.h>
 #include <rte_ether.h>
 
 #include "mlx5_common.h"
diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h
index 629a639a81..d6e91b5296 100644
--- a/drivers/common/mlx5/mlx5_common.h
+++ b/drivers/common/mlx5/mlx5_common.h
@@ -7,6 +7,7 @@
 
 #include <stdio.h>
 
+#include <rte_compat.h>
 #include <rte_pci.h>
 #include <bus_pci_driver.h>
 #include <rte_debug.h>
diff --git a/drivers/common/mlx5/mlx5_common_devx.h b/drivers/common/mlx5/mlx5_common_devx.h
index 12b0cb121f..743f06042c 100644
--- a/drivers/common/mlx5/mlx5_common_devx.h
+++ b/drivers/common/mlx5/mlx5_common_devx.h
@@ -7,6 +7,8 @@
 
 #include "mlx5_devx_cmds.h"
 
+#include <rte_compat.h>
+
 /* The standard page size */
 #define MLX5_LOG_PAGE_SIZE 12
 
diff --git a/drivers/common/mlx5/mlx5_common_mp.h b/drivers/common/mlx5/mlx5_common_mp.h
index 4599ba8f92..34e4fae28a 100644
--- a/drivers/common/mlx5/mlx5_common_mp.h
+++ b/drivers/common/mlx5/mlx5_common_mp.h
@@ -7,6 +7,7 @@
 #define RTE_PMD_MLX5_COMMON_MP_H_
 
 #include <mlx5_glue.h>
+#include <rte_compat.h>
 #include <rte_eal.h>
 #include <rte_string_fns.h>
 
diff --git a/drivers/common/mlx5/mlx5_common_mr.h b/drivers/common/mlx5/mlx5_common_mr.h
index f774ccbf33..e03cd9f707 100644
--- a/drivers/common/mlx5/mlx5_common_mr.h
+++ b/drivers/common/mlx5/mlx5_common_mr.h
@@ -11,6 +11,7 @@
 #include <sys/queue.h>
 
 
+#include <rte_compat.h>
 #include <rte_rwlock.h>
 #include <rte_bitmap.h>
 #include <rte_mbuf.h>
diff --git a/drivers/common/mlx5/mlx5_common_utils.h b/drivers/common/mlx5/mlx5_common_utils.h
index 98e487e7ef..ae15119a33 100644
--- a/drivers/common/mlx5/mlx5_common_utils.h
+++ b/drivers/common/mlx5/mlx5_common_utils.h
@@ -5,6 +5,7 @@
 #ifndef RTE_PMD_MLX5_COMMON_UTILS_H_
 #define RTE_PMD_MLX5_COMMON_UTILS_H_
 
+#include <rte_compat.h>
 #include <rte_rwlock.h>
 
 #include "mlx5_common.h"
diff --git a/drivers/common/mlx5/mlx5_malloc.h b/drivers/common/mlx5/mlx5_malloc.h
index 92149f7b92..9086a4f3f2 100644
--- a/drivers/common/mlx5/mlx5_malloc.h
+++ b/drivers/common/mlx5/mlx5_malloc.h
@@ -5,6 +5,8 @@
 #ifndef MLX5_MALLOC_H_
 #define MLX5_MALLOC_H_
 
+#include <rte_compat.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/drivers/common/mlx5/windows/mlx5_common_os.h b/drivers/common/mlx5/windows/mlx5_common_os.h
index e9e9108127..acee0c987f 100644
--- a/drivers/common/mlx5/windows/mlx5_common_os.h
+++ b/drivers/common/mlx5/windows/mlx5_common_os.h
@@ -8,6 +8,7 @@
 #include <stdio.h>
 #include <sys/types.h>
 
+#include <rte_compat.h>
 #include <rte_errno.h>
 #include <rte_interrupts.h>
 
diff --git a/drivers/common/octeontx/octeontx_mbox.h b/drivers/common/octeontx/octeontx_mbox.h
index 706b198f6e..ab4c010558 100644
--- a/drivers/common/octeontx/octeontx_mbox.h
+++ b/drivers/common/octeontx/octeontx_mbox.h
@@ -5,6 +5,7 @@
 #ifndef __OCTEONTX_MBOX_H__
 #define __OCTEONTX_MBOX_H__
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_spinlock.h>
 
diff --git a/drivers/common/sfc_efx/efsys.h b/drivers/common/sfc_efx/efsys.h
index 224254bee7..41fa3da762 100644
--- a/drivers/common/sfc_efx/efsys.h
+++ b/drivers/common/sfc_efx/efsys.h
@@ -12,6 +12,7 @@
 
 #include <stdbool.h>
 
+#include <rte_compat.h>
 #include <rte_spinlock.h>
 #include <rte_byteorder.h>
 #include <rte_debug.h>
diff --git a/drivers/common/sfc_efx/sfc_efx.h b/drivers/common/sfc_efx/sfc_efx.h
index d3ea586cb8..6b60ac6f67 100644
--- a/drivers/common/sfc_efx/sfc_efx.h
+++ b/drivers/common/sfc_efx/sfc_efx.h
@@ -15,6 +15,8 @@
 #include "efx.h"
 #include "efsys.h"
 
+#include <rte_compat.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/drivers/common/sfc_efx/sfc_efx_mcdi.h b/drivers/common/sfc_efx/sfc_efx_mcdi.h
index 85f9c5f204..2ad4c36c8d 100644
--- a/drivers/common/sfc_efx/sfc_efx_mcdi.h
+++ b/drivers/common/sfc_efx/sfc_efx_mcdi.h
@@ -12,6 +12,7 @@
 
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_spinlock.h>
 
 #include "efsys.h"
diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_ops.h b/drivers/crypto/cnxk/cn10k_cryptodev_ops.h
index 3d7c6d195a..43a1314138 100644
--- a/drivers/crypto/cnxk/cn10k_cryptodev_ops.h
+++ b/drivers/crypto/cnxk/cn10k_cryptodev_ops.h
@@ -5,6 +5,7 @@
 #ifndef _CN10K_CRYPTODEV_OPS_H_
 #define _CN10K_CRYPTODEV_OPS_H_
 
+#include <rte_compat.h>
 #include <cryptodev_pmd.h>
 #include <rte_cryptodev.h>
 #include <rte_eventdev.h>
diff --git a/drivers/crypto/cnxk/cn9k_cryptodev_ops.h b/drivers/crypto/cnxk/cn9k_cryptodev_ops.h
index 9f6dc24603..c6ec96153e 100644
--- a/drivers/crypto/cnxk/cn9k_cryptodev_ops.h
+++ b/drivers/crypto/cnxk/cn9k_cryptodev_ops.h
@@ -5,6 +5,7 @@
 #ifndef _CN9K_CRYPTODEV_OPS_H_
 #define _CN9K_CRYPTODEV_OPS_H_
 
+#include <rte_compat.h>
 #include <cryptodev_pmd.h>
 
 extern struct rte_cryptodev_ops cn9k_cpt_ops;
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_event.h b/drivers/crypto/dpaa2_sec/dpaa2_sec_event.h
index 675cbbb81d..bd37365eac 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_event.h
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_event.h
@@ -6,6 +6,8 @@
 #ifndef _DPAA2_SEC_EVENT_H_
 #define _DPAA2_SEC_EVENT_H_
 
+#include <rte_compat.h>
+
 __rte_internal
 int dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev,
 		int qp_id,
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec_event.h b/drivers/crypto/dpaa_sec/dpaa_sec_event.h
index 0b09fa8f75..d1cc08002e 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec_event.h
+++ b/drivers/crypto/dpaa_sec/dpaa_sec_event.h
@@ -6,6 +6,8 @@
 #ifndef _DPAA_SEC_EVENT_H_
 #define _DPAA_SEC_EVENT_H_
 
+#include <rte_compat.h>
+
 __rte_internal
 int dpaa_sec_eventq_attach(const struct rte_cryptodev *dev,
 		int qp_id,
diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.h b/drivers/crypto/octeontx/otx_cryptodev_ops.h
index 83b82ea059..e68f0b38df 100644
--- a/drivers/crypto/octeontx/otx_cryptodev_ops.h
+++ b/drivers/crypto/octeontx/otx_cryptodev_ops.h
@@ -5,6 +5,7 @@
 #ifndef _OTX_CRYPTODEV_OPS_H_
 #define _OTX_CRYPTODEV_OPS_H_
 
+#include <rte_compat.h>
 #include <cryptodev_pmd.h>
 
 #define OTX_CPT_MIN_HEADROOM_REQ	(24)
diff --git a/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h b/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h
index 7744dacb2c..dc8acb4aec 100644
--- a/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h
+++ b/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h
@@ -5,6 +5,8 @@
 #ifndef _RTE_PMD_DPAA2_QDMA_H_
 #define _RTE_PMD_DPAA2_QDMA_H_
 
+#include <rte_compat.h>
+
 /** States if the source addresses is physical. */
 #define RTE_DPAA2_QDMA_JOB_SRC_PHY		(1ULL << 30)
 
diff --git a/drivers/event/dlb2/rte_pmd_dlb2.h b/drivers/event/dlb2/rte_pmd_dlb2.h
index 1dbd885a16..334c6c356d 100644
--- a/drivers/event/dlb2/rte_pmd_dlb2.h
+++ b/drivers/event/dlb2/rte_pmd_dlb2.h
@@ -17,6 +17,8 @@ extern "C" {
 
 #include <stdint.h>
 
+#include <rte_compat.h>
+
 /**
  * @warning
  * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.h b/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
index 7c493b28e7..9e21823fb6 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
@@ -8,6 +8,8 @@
 #ifndef _DPAA2_HW_DPBP_H_
 #define _DPAA2_HW_DPBP_H_
 
+#include <rte_compat.h>
+
 #define DPAA2_MAX_BUF_POOLS	8
 
 struct buf_pool_cfg {
diff --git a/drivers/mempool/dpaa2/rte_dpaa2_mempool.h b/drivers/mempool/dpaa2/rte_dpaa2_mempool.h
index 28dea74326..7fe3d93f61 100644
--- a/drivers/mempool/dpaa2/rte_dpaa2_mempool.h
+++ b/drivers/mempool/dpaa2/rte_dpaa2_mempool.h
@@ -16,6 +16,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_mempool.h>
 
 /**
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 29a71ae0bf..4a266bb2ca 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -10,7 +10,6 @@
 #include <rte_malloc.h>
 #include <rte_errno.h>
 #include <rte_cycles.h>
-#include <rte_compat.h>
 
 #include "eth_bond_private.h"
 
diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
index f54a767dbe..651ef45ea8 100644
--- a/drivers/net/cnxk/cnxk_ethdev.h
+++ b/drivers/net/cnxk/cnxk_ethdev.h
@@ -9,6 +9,7 @@
 
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
+#include <rte_compat.h>
 #include <rte_kvargs.h>
 #include <rte_mbuf.h>
 #include <rte_mbuf_pool_ops.h>
diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index 502c1c88b8..5b6802ece8 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -10,6 +10,7 @@
 /* System headers */
 #include <stdbool.h>
 #include <ethdev_driver.h>
+#include <rte_compat.h>
 #include <rte_event_eth_rx_adapter.h>
 
 #include <fsl_usd.h>
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h
index c88c8146dc..9feb631d5f 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.h
+++ b/drivers/net/dpaa2/dpaa2_ethdev.h
@@ -8,6 +8,7 @@
 #ifndef _DPAA2_ETHDEV_H
 #define _DPAA2_ETHDEV_H
 
+#include <rte_compat.h>
 #include <rte_event_eth_rx_adapter.h>
 #include <rte_pmd_dpaa2.h>
 
diff --git a/drivers/net/dpaa2/rte_pmd_dpaa2.h b/drivers/net/dpaa2/rte_pmd_dpaa2.h
index 8ea42ee130..a1152eb717 100644
--- a/drivers/net/dpaa2/rte_pmd_dpaa2.h
+++ b/drivers/net/dpaa2/rte_pmd_dpaa2.h
@@ -11,6 +11,7 @@
  * NXP dpaa2 PMD specific functions.
  */
 
+#include <rte_compat.h>
 #include <rte_flow.h>
 
 /**
diff --git a/drivers/net/iavf/rte_pmd_iavf.h b/drivers/net/iavf/rte_pmd_iavf.h
index 7426eb9be3..56d453fc4c 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>
 
diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h
index 487a331117..c8311be179 100644
--- a/drivers/net/ice/ice_ethdev.h
+++ b/drivers/net/ice/ice_ethdev.h
@@ -5,6 +5,7 @@
 #ifndef _ICE_ETHDEV_H_
 #define _ICE_ETHDEV_H_
 
+#include <rte_compat.h>
 #include <rte_kvargs.h>
 #include <rte_time.h>
 
diff --git a/drivers/net/mlx5/rte_pmd_mlx5.h b/drivers/net/mlx5/rte_pmd_mlx5.h
index d4caea5b20..b71a291256 100644
--- a/drivers/net/mlx5/rte_pmd_mlx5.h
+++ b/drivers/net/mlx5/rte_pmd_mlx5.h
@@ -5,6 +5,8 @@
 #ifndef RTE_PMD_PRIVATE_MLX5_H_
 #define RTE_PMD_PRIVATE_MLX5_H_
 
+#include <rte_compat.h>
+
 /**
  * @file
  * MLX5 public header.
diff --git a/drivers/net/txgbe/rte_pmd_txgbe.h b/drivers/net/txgbe/rte_pmd_txgbe.h
index d222fc3537..bb723c5e3a 100644
--- a/drivers/net/txgbe/rte_pmd_txgbe.h
+++ b/drivers/net/txgbe/rte_pmd_txgbe.h
@@ -12,7 +12,6 @@
 #ifndef _PMD_TXGBE_H_
 #define _PMD_TXGBE_H_
 
-#include <rte_compat.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
 
diff --git a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h
index 1eb5fa532b..52f6ed9b01 100644
--- a/lib/bbdev/rte_bbdev.h
+++ b/lib/bbdev/rte_bbdev.h
@@ -27,6 +27,7 @@ extern "C" {
 #include <stdint.h>
 #include <stdbool.h>
 
+#include <rte_compat.h>
 #include <rte_cpuflags.h>
 
 #include "rte_bbdev_op.h"
diff --git a/lib/bbdev/rte_bbdev_op.h b/lib/bbdev/rte_bbdev_op.h
index 2b6ffb80fe..96a390cd9b 100644
--- a/lib/bbdev/rte_bbdev_op.h
+++ b/lib/bbdev/rte_bbdev_op.h
@@ -17,6 +17,7 @@ extern "C" {
 
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_mbuf.h>
 #include <rte_memory.h>
diff --git a/lib/bpf/rte_bpf.h b/lib/bpf/rte_bpf.h
index 7e7d03b9c7..4d71120dbd 100644
--- a/lib/bpf/rte_bpf.h
+++ b/lib/bpf/rte_bpf.h
@@ -16,6 +16,7 @@
  * (https://www.kernel.org/doc/Documentation/networking/filter.txt).
  */
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_mbuf.h>
 #include <bpf_def.h>
diff --git a/lib/compressdev/rte_comp.h b/lib/compressdev/rte_comp.h
index 99a48711e4..a8f398b57b 100644
--- a/lib/compressdev/rte_comp.h
+++ b/lib/compressdev/rte_comp.h
@@ -16,6 +16,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_mbuf.h>
 
 /**
diff --git a/lib/compressdev/rte_compressdev.h b/lib/compressdev/rte_compressdev.h
index aa865c4c03..42bda9fc79 100644
--- a/lib/compressdev/rte_compressdev.h
+++ b/lib/compressdev/rte_compressdev.h
@@ -22,6 +22,7 @@ extern "C" {
 #endif
 
 
+#include <rte_compat.h>
 #include "rte_comp.h"
 
 /**
diff --git a/lib/compressdev/rte_compressdev_pmd.h b/lib/compressdev/rte_compressdev_pmd.h
index 72e52f876f..ea012908b7 100644
--- a/lib/compressdev/rte_compressdev_pmd.h
+++ b/lib/compressdev/rte_compressdev_pmd.h
@@ -21,6 +21,7 @@ extern "C" {
 
 #include <dev_driver.h>
 
+#include <rte_compat.h>
 #include "rte_compressdev.h"
 #include "rte_compressdev_internal.h"
 
diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
index f27b3249ea..0020102eb7 100644
--- a/lib/cryptodev/cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -20,6 +20,7 @@ extern "C" {
 #include <string.h>
 
 #include <dev_driver.h>
+#include <rte_compat.h>
 #include <rte_malloc.h>
 #include <rte_log.h>
 #include <rte_common.h>
diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h
index bd59fe4d26..33b4966e16 100644
--- a/lib/cryptodev/rte_crypto_sym.h
+++ b/lib/cryptodev/rte_crypto_sym.h
@@ -20,6 +20,7 @@ extern "C" {
 
 #include <string.h>
 
+#include <rte_compat.h>
 #include <rte_mbuf.h>
 #include <rte_memory.h>
 #include <rte_mempool.h>
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index ece7157970..86d792e2e7 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -18,6 +18,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include "rte_kvargs.h"
 #include "rte_crypto.h"
 #include <rte_common.h>
diff --git a/lib/dmadev/rte_dmadev_pmd.h b/lib/dmadev/rte_dmadev_pmd.h
index acd7f71cd1..c61cedfb23 100644
--- a/lib/dmadev/rte_dmadev_pmd.h
+++ b/lib/dmadev/rte_dmadev_pmd.h
@@ -16,6 +16,7 @@
 
 #include <dev_driver.h>
 
+#include <rte_compat.h>
 #include "rte_dmadev.h"
 
 #ifdef __cplusplus
diff --git a/lib/eal/arm/include/rte_io_64.h b/lib/eal/arm/include/rte_io_64.h
index f9a1f10ce7..96da7789ce 100644
--- a/lib/eal/arm/include/rte_io_64.h
+++ b/lib/eal/arm/include/rte_io_64.h
@@ -14,6 +14,7 @@ extern "C" {
 #define RTE_OVERRIDE_IO_H
 
 #include "generic/rte_io.h"
+#include <rte_compat.h>
 #include "rte_atomic_64.h"
 
 static __rte_always_inline uint8_t
diff --git a/lib/eal/arm/include/rte_prefetch_32.h b/lib/eal/arm/include/rte_prefetch_32.h
index 303caaa780..0e9a140c8a 100644
--- a/lib/eal/arm/include/rte_prefetch_32.h
+++ b/lib/eal/arm/include/rte_prefetch_32.h
@@ -9,6 +9,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include "generic/rte_prefetch.h"
 
diff --git a/lib/eal/arm/include/rte_prefetch_64.h b/lib/eal/arm/include/rte_prefetch_64.h
index e28b66fee0..22cba48e29 100644
--- a/lib/eal/arm/include/rte_prefetch_64.h
+++ b/lib/eal/arm/include/rte_prefetch_64.h
@@ -9,6 +9,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include "generic/rte_prefetch.h"
 
diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index 1b58cd3da6..607684c1a3 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -21,7 +21,6 @@
 #include <sys/queue.h>
 #include <sys/stat.h>
 
-#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_memory.h>
diff --git a/lib/eal/freebsd/eal_dev.c b/lib/eal/freebsd/eal_dev.c
index 8e06e70890..c3dfe9108f 100644
--- a/lib/eal/freebsd/eal_dev.c
+++ b/lib/eal/freebsd/eal_dev.c
@@ -3,7 +3,6 @@
  */
 
 #include <rte_log.h>
-#include <rte_compat.h>
 #include <rte_dev.h>
 
 int
diff --git a/lib/eal/include/generic/rte_atomic.h b/lib/eal/include/generic/rte_atomic.h
index 276272f40b..f5c49a9870 100644
--- a/lib/eal/include/generic/rte_atomic.h
+++ b/lib/eal/include/generic/rte_atomic.h
@@ -13,6 +13,7 @@
  */
 
 #include <stdint.h>
+#include <rte_compat.h>
 #include <rte_common.h>
 
 #ifdef __DOXYGEN__
diff --git a/lib/eal/include/generic/rte_cycles.h b/lib/eal/include/generic/rte_cycles.h
index f4fdca4165..69f3cee8d1 100644
--- a/lib/eal/include/generic/rte_cycles.h
+++ b/lib/eal/include/generic/rte_cycles.h
@@ -13,7 +13,6 @@
  */
 
 #include <stdint.h>
-#include <rte_compat.h>
 #include <rte_debug.h>
 #include <rte_atomic.h>
 
diff --git a/lib/eal/include/generic/rte_pause.h b/lib/eal/include/generic/rte_pause.h
index 032f9ac05a..2173a544d5 100644
--- a/lib/eal/include/generic/rte_pause.h
+++ b/lib/eal/include/generic/rte_pause.h
@@ -17,7 +17,6 @@
 #include <assert.h>
 #include <rte_common.h>
 #include <rte_atomic.h>
-#include <rte_compat.h>
 
 /**
  * Pause CPU execution for a short while
diff --git a/lib/eal/include/rte_bitmap.h b/lib/eal/include/rte_bitmap.h
index c589d5cde0..27ee3d18a4 100644
--- a/lib/eal/include/rte_bitmap.h
+++ b/lib/eal/include/rte_bitmap.h
@@ -36,6 +36,7 @@ extern "C" {
  ***/
 
 #include <string.h>
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_config.h>
 #include <rte_debug.h>
diff --git a/lib/eal/include/rte_class.h b/lib/eal/include/rte_class.h
index d560339652..47b1764e7b 100644
--- a/lib/eal/include/rte_class.h
+++ b/lib/eal/include/rte_class.h
@@ -22,6 +22,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_dev.h>
 
 /** Double linked list of classes */
diff --git a/lib/eal/include/rte_eal_memconfig.h b/lib/eal/include/rte_eal_memconfig.h
index 44f5324906..e175564647 100644
--- a/lib/eal/include/rte_eal_memconfig.h
+++ b/lib/eal/include/rte_eal_memconfig.h
@@ -7,7 +7,6 @@
 
 #include <stdbool.h>
 
-#include <rte_compat.h>
 
 /**
  * @file
diff --git a/lib/eal/include/rte_epoll.h b/lib/eal/include/rte_epoll.h
index 8c73031910..01525f523b 100644
--- a/lib/eal/include/rte_epoll.h
+++ b/lib/eal/include/rte_epoll.h
@@ -13,7 +13,6 @@
 
 #include <stdint.h>
 
-#include <rte_compat.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/lib/eal/include/rte_fbarray.h b/lib/eal/include/rte_fbarray.h
index c64868711e..e33076778f 100644
--- a/lib/eal/include/rte_fbarray.h
+++ b/lib/eal/include/rte_fbarray.h
@@ -36,7 +36,6 @@ extern "C" {
 
 #include <stdio.h>
 
-#include <rte_compat.h>
 #include <rte_rwlock.h>
 
 #define RTE_FBARRAY_NAME_LEN 64
diff --git a/lib/eal/include/rte_lcore.h b/lib/eal/include/rte_lcore.h
index 4d3978512c..6938c3fd7b 100644
--- a/lib/eal/include/rte_lcore.h
+++ b/lib/eal/include/rte_lcore.h
@@ -13,6 +13,7 @@
  */
 #include <stdio.h>
 
+#include <rte_compat.h>
 #include <rte_config.h>
 #include <rte_per_lcore.h>
 #include <rte_eal.h>
diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h
index bba5da3d85..6d2b0856a5 100644
--- a/lib/eal/include/rte_log.h
+++ b/lib/eal/include/rte_log.h
@@ -24,7 +24,6 @@ extern "C" {
 
 #include <rte_common.h>
 #include <rte_config.h>
-#include <rte_compat.h>
 
 /* SDK log type */
 #define RTE_LOGTYPE_EAL        0 /**< Log related to eal. */
diff --git a/lib/eal/include/rte_malloc.h b/lib/eal/include/rte_malloc.h
index 748dfa8697..54a8ac211e 100644
--- a/lib/eal/include/rte_malloc.h
+++ b/lib/eal/include/rte_malloc.h
@@ -13,7 +13,6 @@
 
 #include <stdio.h>
 #include <stddef.h>
-#include <rte_compat.h>
 #include <rte_memory.h>
 
 #ifdef __cplusplus
diff --git a/lib/eal/include/rte_memory.h b/lib/eal/include/rte_memory.h
index 68b069fd04..99a11398b4 100644
--- a/lib/eal/include/rte_memory.h
+++ b/lib/eal/include/rte_memory.h
@@ -21,7 +21,6 @@ extern "C" {
 
 #include <rte_bitops.h>
 #include <rte_common.h>
-#include <rte_compat.h>
 #include <rte_config.h>
 #include <rte_fbarray.h>
 
diff --git a/lib/eal/include/rte_memzone.h b/lib/eal/include/rte_memzone.h
index bb4223a056..5302caa437 100644
--- a/lib/eal/include/rte_memzone.h
+++ b/lib/eal/include/rte_memzone.h
@@ -23,7 +23,6 @@
  */
 
 #include <stdio.h>
-#include <rte_compat.h>
 #include <rte_memory.h>
 #include <rte_common.h>
 
diff --git a/lib/eal/include/rte_pflock.h b/lib/eal/include/rte_pflock.h
index e7bb29b3c5..a3f7291fa1 100644
--- a/lib/eal/include/rte_pflock.h
+++ b/lib/eal/include/rte_pflock.h
@@ -31,6 +31,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_pause.h>
 
diff --git a/lib/eal/include/rte_service.h b/lib/eal/include/rte_service.h
index 90116a773a..a77f33be48 100644
--- a/lib/eal/include/rte_service.h
+++ b/lib/eal/include/rte_service.h
@@ -30,6 +30,7 @@ extern "C" {
 #include<stdio.h>
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_config.h>
 #include <rte_lcore.h>
 
diff --git a/lib/eal/include/rte_service_component.h b/lib/eal/include/rte_service_component.h
index 9be49d698a..a5350c97e5 100644
--- a/lib/eal/include/rte_service_component.h
+++ b/lib/eal/include/rte_service_component.h
@@ -14,7 +14,6 @@
 extern "C" {
 #endif
 
-#include <rte_compat.h>
 #include <rte_service.h>
 
 /**
diff --git a/lib/eal/loongarch/include/rte_prefetch.h b/lib/eal/loongarch/include/rte_prefetch.h
index ac18318fe4..64b1fd2c2a 100644
--- a/lib/eal/loongarch/include/rte_prefetch.h
+++ b/lib/eal/loongarch/include/rte_prefetch.h
@@ -9,6 +9,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include "generic/rte_prefetch.h"
 
diff --git a/lib/eal/ppc/include/rte_atomic.h b/lib/eal/ppc/include/rte_atomic.h
index 86d3f9b2a1..663b4d37b8 100644
--- a/lib/eal/ppc/include/rte_atomic.h
+++ b/lib/eal/ppc/include/rte_atomic.h
@@ -17,7 +17,6 @@ extern "C" {
 #endif
 
 #include <stdint.h>
-#include <rte_compat.h>
 #include "generic/rte_atomic.h"
 
 #define	rte_mb()  asm volatile("sync" : : : "memory")
diff --git a/lib/eal/ppc/include/rte_prefetch.h b/lib/eal/ppc/include/rte_prefetch.h
index 6df8087e41..2e1b5751e0 100644
--- a/lib/eal/ppc/include/rte_prefetch.h
+++ b/lib/eal/ppc/include/rte_prefetch.h
@@ -10,6 +10,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include "generic/rte_prefetch.h"
 
diff --git a/lib/eal/riscv/include/rte_prefetch.h b/lib/eal/riscv/include/rte_prefetch.h
index 966d9e2687..748cf1b626 100644
--- a/lib/eal/riscv/include/rte_prefetch.h
+++ b/lib/eal/riscv/include/rte_prefetch.h
@@ -12,6 +12,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include "generic/rte_prefetch.h"
 
diff --git a/lib/eal/x86/include/rte_io.h b/lib/eal/x86/include/rte_io.h
index 730f958758..0e1fefdee1 100644
--- a/lib/eal/x86/include/rte_io.h
+++ b/lib/eal/x86/include/rte_io.h
@@ -9,6 +9,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include "rte_cpuflags.h"
 
 #define RTE_NATIVE_WRITE32_WC
diff --git a/lib/eal/x86/include/rte_prefetch.h b/lib/eal/x86/include/rte_prefetch.h
index 53404989dd..7fd01c4913 100644
--- a/lib/eal/x86/include/rte_prefetch.h
+++ b/lib/eal/x86/include/rte_prefetch.h
@@ -9,6 +9,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include "generic/rte_prefetch.h"
 
diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h
index 1300acc95d..6a550cfc83 100644
--- a/lib/ethdev/ethdev_driver.h
+++ b/lib/ethdev/ethdev_driver.h
@@ -20,6 +20,7 @@ extern "C" {
  */
 
 #include <dev_driver.h>
+#include <rte_compat.h>
 #include <rte_ethdev.h>
 
 /**
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 8858b56428..b60987db4b 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -17,6 +17,7 @@
 #include <stddef.h>
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_ether.h>
 #include <rte_icmp.h>
diff --git a/lib/ethdev/rte_tm.h b/lib/ethdev/rte_tm.h
index d39e897849..001d13f301 100644
--- a/lib/ethdev/rte_tm.h
+++ b/lib/ethdev/rte_tm.h
@@ -22,6 +22,7 @@
 
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_meter.h>
 
diff --git a/lib/eventdev/eventdev_pmd_pci.h b/lib/eventdev/eventdev_pmd_pci.h
index 7bbec40c71..26aa3a6635 100644
--- a/lib/eventdev/eventdev_pmd_pci.h
+++ b/lib/eventdev/eventdev_pmd_pci.h
@@ -19,6 +19,7 @@ extern "C" {
 
 #include <string.h>
 
+#include <rte_compat.h>
 #include <rte_config.h>
 #include <rte_eal.h>
 #include <rte_lcore.h>
diff --git a/lib/eventdev/eventdev_pmd_vdev.h b/lib/eventdev/eventdev_pmd_vdev.h
index cf2333cf41..5fa9d699ac 100644
--- a/lib/eventdev/eventdev_pmd_vdev.h
+++ b/lib/eventdev/eventdev_pmd_vdev.h
@@ -19,6 +19,7 @@ extern "C" {
 
 #include <string.h>
 
+#include <rte_compat.h>
 #include <rte_config.h>
 #include <rte_debug.h>
 #include <rte_eal.h>
diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h b/lib/eventdev/rte_event_eth_rx_adapter.h
index a9fdeb7b45..d0e7d0092c 100644
--- a/lib/eventdev/rte_event_eth_rx_adapter.h
+++ b/lib/eventdev/rte_event_eth_rx_adapter.h
@@ -87,6 +87,7 @@ extern "C" {
 
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_service.h>
 
 #include "rte_eventdev.h"
diff --git a/lib/eventdev/rte_event_eth_tx_adapter.h b/lib/eventdev/rte_event_eth_tx_adapter.h
index 74ded7b651..645b87b78a 100644
--- a/lib/eventdev/rte_event_eth_tx_adapter.h
+++ b/lib/eventdev/rte_event_eth_tx_adapter.h
@@ -79,6 +79,7 @@ extern "C" {
 
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_mbuf.h>
 
 #include "rte_eventdev.h"
diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
index 82e8976e57..a90e23ac8b 100644
--- a/lib/eventdev/rte_eventdev.h
+++ b/lib/eventdev/rte_eventdev.h
@@ -210,6 +210,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_errno.h>
 #include <rte_mbuf_pool_ops.h>
diff --git a/lib/gpudev/gpudev_driver.h b/lib/gpudev/gpudev_driver.h
index 23972b3dbd..d5e2c8e1ef 100644
--- a/lib/gpudev/gpudev_driver.h
+++ b/lib/gpudev/gpudev_driver.h
@@ -16,6 +16,7 @@
 
 #include <dev_driver.h>
 
+#include <rte_compat.h>
 #include "rte_gpudev.h"
 
 /* Flags indicate current state of device. */
diff --git a/lib/graph/rte_graph_worker.h b/lib/graph/rte_graph_worker.h
index 6dc7461659..fc6fee48c8 100644
--- a/lib/graph/rte_graph_worker.h
+++ b/lib/graph/rte_graph_worker.h
@@ -16,6 +16,7 @@
  * process, enqueue and move streams of objects to the next nodes.
  */
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_cycles.h>
 #include <rte_prefetch.h>
diff --git a/lib/hash/rte_hash.h b/lib/hash/rte_hash.h
index 7fa9702742..a399346d02 100644
--- a/lib/hash/rte_hash.h
+++ b/lib/hash/rte_hash.h
@@ -14,7 +14,6 @@
 #include <stdint.h>
 #include <stddef.h>
 
-#include <rte_compat.h>
 #include <rte_rcu_qsbr.h>
 
 #ifdef __cplusplus
diff --git a/lib/hash/rte_thash.h b/lib/hash/rte_thash.h
index c20ff0244c..7b1d154786 100644
--- a/lib/hash/rte_thash.h
+++ b/lib/hash/rte_thash.h
@@ -20,6 +20,7 @@ extern "C" {
 #endif
 
 #include <stdint.h>
+#include <rte_compat.h>
 #include <rte_byteorder.h>
 #include <rte_ip.h>
 #include <rte_common.h>
diff --git a/lib/hash/rte_thash_gfni.h b/lib/hash/rte_thash_gfni.h
index e97d912d40..ef90faa302 100644
--- a/lib/hash/rte_thash_gfni.h
+++ b/lib/hash/rte_thash_gfni.h
@@ -9,6 +9,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_log.h>
 
 #ifdef RTE_ARCH_X86
diff --git a/lib/hash/rte_thash_x86_gfni.h b/lib/hash/rte_thash_x86_gfni.h
index 657b1862c3..880739b710 100644
--- a/lib/hash/rte_thash_x86_gfni.h
+++ b/lib/hash/rte_thash_x86_gfni.h
@@ -12,6 +12,7 @@
  * using Galois Fields New Instructions.
  */
 
+#include <rte_compat.h>
 #include <rte_vect.h>
 
 #ifdef __cplusplus
diff --git a/lib/ip_frag/rte_ip_frag.h b/lib/ip_frag/rte_ip_frag.h
index 75bb42b262..feab72ae64 100644
--- a/lib/ip_frag/rte_ip_frag.h
+++ b/lib/ip_frag/rte_ip_frag.h
@@ -19,6 +19,7 @@ extern "C" {
 #include <stdint.h>
 #include <stdio.h>
 
+#include <rte_compat.h>
 #include <rte_config.h>
 #include <rte_malloc.h>
 #include <rte_memory.h>
diff --git a/lib/ipsec/rte_ipsec.h b/lib/ipsec/rte_ipsec.h
index 5308f250a7..04129926b6 100644
--- a/lib/ipsec/rte_ipsec.h
+++ b/lib/ipsec/rte_ipsec.h
@@ -14,6 +14,7 @@
  * processing (ESP/AH).
  */
 
+#include <rte_compat.h>
 #include <rte_ipsec_sa.h>
 #include <rte_mbuf.h>
 
diff --git a/lib/ipsec/rte_ipsec_sad.h b/lib/ipsec/rte_ipsec_sad.h
index dbd89901af..0adf89d931 100644
--- a/lib/ipsec/rte_ipsec_sad.h
+++ b/lib/ipsec/rte_ipsec_sad.h
@@ -8,7 +8,6 @@
 
 #include <stdint.h>
 
-#include <rte_compat.h>
 
 /**
  * @file rte_ipsec_sad.h
diff --git a/lib/kni/rte_kni.h b/lib/kni/rte_kni.h
index b85d3dd32b..37d67509a0 100644
--- a/lib/kni/rte_kni.h
+++ b/lib/kni/rte_kni.h
@@ -17,6 +17,7 @@
  * and burst transmit packets to KNI interfaces.
  */
 
+#include <rte_compat.h>
 #include <rte_pci.h>
 #include <rte_ether.h>
 
diff --git a/lib/lpm/rte_lpm.h b/lib/lpm/rte_lpm.h
index 82139c6447..09ad307869 100644
--- a/lib/lpm/rte_lpm.h
+++ b/lib/lpm/rte_lpm.h
@@ -13,6 +13,7 @@
 
 #include <errno.h>
 #include <stdint.h>
+#include <rte_compat.h>
 #include <rte_branch_prediction.h>
 #include <rte_byteorder.h>
 #include <rte_common.h>
diff --git a/lib/lpm/rte_lpm_sve.h b/lib/lpm/rte_lpm_sve.h
index 2e319373e5..94ead70c39 100644
--- a/lib/lpm/rte_lpm_sve.h
+++ b/lib/lpm/rte_lpm_sve.h
@@ -5,6 +5,7 @@
 #ifndef _RTE_LPM_SVE_H_
 #define _RTE_LPM_SVE_H_
 
+#include <rte_compat.h>
 #include <rte_vect.h>
 
 #ifdef __cplusplus
diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h
index b181f2cf9d..a30e1e0eaf 100644
--- a/lib/mbuf/rte_mbuf_core.h
+++ b/lib/mbuf/rte_mbuf_core.h
@@ -18,7 +18,6 @@
 
 #include <stdint.h>
 
-#include <rte_compat.h>
 #include <rte_byteorder.h>
 
 #ifdef __cplusplus
diff --git a/lib/member/rte_member.h b/lib/member/rte_member.h
index 178efeed33..072a253c89 100644
--- a/lib/member/rte_member.h
+++ b/lib/member/rte_member.h
@@ -65,6 +65,7 @@ extern "C" {
 #include <stdbool.h>
 #include <inttypes.h>
 
+#include <rte_compat.h>
 #include <rte_common.h>
 
 /** The set ID type that stored internally in hash table based set summary. */
diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h
index 3725a72951..3142efc484 100644
--- a/lib/mempool/rte_mempool.h
+++ b/lib/mempool/rte_mempool.h
@@ -37,6 +37,7 @@
 #include <stdint.h>
 #include <inttypes.h>
 
+#include <rte_compat.h>
 #include <rte_config.h>
 #include <rte_spinlock.h>
 #include <rte_debug.h>
diff --git a/lib/meter/rte_meter.h b/lib/meter/rte_meter.h
index 62c8c1ecc2..0932645d0a 100644
--- a/lib/meter/rte_meter.h
+++ b/lib/meter/rte_meter.h
@@ -23,7 +23,6 @@ extern "C" {
 
 #include <stdint.h>
 
-#include "rte_compat.h"
 
 /*
  * Application Programmer's Interface (API)
diff --git a/lib/metrics/rte_metrics.h b/lib/metrics/rte_metrics.h
index 5c33af9999..5e17873dd7 100644
--- a/lib/metrics/rte_metrics.h
+++ b/lib/metrics/rte_metrics.h
@@ -24,7 +24,6 @@
 #define _RTE_METRICS_H_
 
 #include <stdint.h>
-#include <rte_compat.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/lib/metrics/rte_metrics_telemetry.h b/lib/metrics/rte_metrics_telemetry.h
index 09b14d9336..dd84f5431e 100644
--- a/lib/metrics/rte_metrics_telemetry.h
+++ b/lib/metrics/rte_metrics_telemetry.h
@@ -8,6 +8,7 @@
 #define json_t void *
 #endif
 
+#include <rte_compat.h>
 #include "rte_metrics.h"
 
 #ifndef _RTE_METRICS_TELEMETRY_H_
diff --git a/lib/net/rte_ip.h b/lib/net/rte_ip.h
index ecd250e9be..9c8e8206f0 100644
--- a/lib/net/rte_ip.h
+++ b/lib/net/rte_ip.h
@@ -28,6 +28,7 @@
 #include <netinet/ip6.h>
 #endif
 
+#include <rte_compat.h>
 #include <rte_byteorder.h>
 #include <rte_mbuf.h>
 
diff --git a/lib/node/rte_node_eth_api.h b/lib/node/rte_node_eth_api.h
index 4e28f86d77..1e7477349c 100644
--- a/lib/node/rte_node_eth_api.h
+++ b/lib/node/rte_node_eth_api.h
@@ -21,6 +21,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_mempool.h>
 
diff --git a/lib/pdump/rte_pdump.h b/lib/pdump/rte_pdump.h
index 41c4b7800b..b1a391830c 100644
--- a/lib/pdump/rte_pdump.h
+++ b/lib/pdump/rte_pdump.h
@@ -13,6 +13,7 @@
  */
 
 #include <stdint.h>
+#include <rte_compat.h>
 #include <rte_bpf.h>
 
 #ifdef __cplusplus
diff --git a/lib/power/rte_power.h b/lib/power/rte_power.h
index 47345e26df..f122dab02b 100644
--- a/lib/power/rte_power.h
+++ b/lib/power/rte_power.h
@@ -10,6 +10,7 @@
  * RTE Power Management
  */
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_log.h>
 #include <rte_power_guest_channel.h>
diff --git a/lib/power/rte_power_empty_poll.h b/lib/power/rte_power_empty_poll.h
index f6306fdcdf..b9819337e6 100644
--- a/lib/power/rte_power_empty_poll.h
+++ b/lib/power/rte_power_empty_poll.h
@@ -12,6 +12,7 @@
 #include <stdint.h>
 #include <stdbool.h>
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_string_fns.h>
 #include <rte_timer.h>
diff --git a/lib/power/rte_power_intel_uncore.h b/lib/power/rte_power_intel_uncore.h
index bcad5e5535..0bd9f193a1 100644
--- a/lib/power/rte_power_intel_uncore.h
+++ b/lib/power/rte_power_intel_uncore.h
@@ -10,6 +10,7 @@
  * RTE Intel Uncore Frequency Management
  */
 
+#include <rte_compat.h>
 #include "rte_power.h"
 
 #ifdef __cplusplus
diff --git a/lib/power/rte_power_pmd_mgmt.h b/lib/power/rte_power_pmd_mgmt.h
index 7ae6ef2d32..0f1a2eb22e 100644
--- a/lib/power/rte_power_pmd_mgmt.h
+++ b/lib/power/rte_power_pmd_mgmt.h
@@ -12,6 +12,7 @@
 
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_log.h>
 #include <rte_power.h>
 
diff --git a/lib/rcu/rte_rcu_qsbr.h b/lib/rcu/rte_rcu_qsbr.h
index 36571c15df..ccae5d54f7 100644
--- a/lib/rcu/rte_rcu_qsbr.h
+++ b/lib/rcu/rte_rcu_qsbr.h
@@ -33,6 +33,7 @@ extern "C" {
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdint.h>
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_atomic.h>
diff --git a/lib/regexdev/rte_regexdev.h b/lib/regexdev/rte_regexdev.h
index 9473c6bb4c..25476f1f73 100644
--- a/lib/regexdev/rte_regexdev.h
+++ b/lib/regexdev/rte_regexdev.h
@@ -198,6 +198,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_dev.h>
 #include <rte_mbuf.h>
diff --git a/lib/regexdev/rte_regexdev_driver.h b/lib/regexdev/rte_regexdev_driver.h
index 6246b144a6..1fcd156556 100644
--- a/lib/regexdev/rte_regexdev_driver.h
+++ b/lib/regexdev/rte_regexdev_driver.h
@@ -14,6 +14,7 @@
  * RegEx lib.
  */
 
+#include <rte_compat.h>
 #include "rte_regexdev.h"
 
 #ifdef __cplusplus
diff --git a/lib/reorder/rte_reorder.h b/lib/reorder/rte_reorder.h
index 4f9f71af75..5abdb258e2 100644
--- a/lib/reorder/rte_reorder.h
+++ b/lib/reorder/rte_reorder.h
@@ -15,6 +15,7 @@
  *
  */
 
+#include <rte_compat.h>
 #include <rte_mbuf.h>
 #include <rte_mbuf_dyn.h>
 
diff --git a/lib/sched/rte_pie.h b/lib/sched/rte_pie.h
index 528f2ea878..2236b98a71 100644
--- a/lib/sched/rte_pie.h
+++ b/lib/sched/rte_pie.h
@@ -16,6 +16,7 @@ extern "C" {
 
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_random.h>
 #include <rte_debug.h>
 #include <rte_cycles.h>
diff --git a/lib/security/rte_security_driver.h b/lib/security/rte_security_driver.h
index 9a767226bd..421e6f7780 100644
--- a/lib/security/rte_security_driver.h
+++ b/lib/security/rte_security_driver.h
@@ -17,6 +17,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include "rte_security.h"
 
 /**
diff --git a/lib/telemetry/rte_telemetry.h b/lib/telemetry/rte_telemetry.h
index a0d21d6b7f..d9918c4e96 100644
--- a/lib/telemetry/rte_telemetry.h
+++ b/lib/telemetry/rte_telemetry.h
@@ -4,7 +4,6 @@
 
 #include <stdint.h>
 
-#include <rte_compat.h>
 
 #ifndef _RTE_TELEMETRY_H_
 #define _RTE_TELEMETRY_H_
diff --git a/lib/timer/rte_timer.h b/lib/timer/rte_timer.h
index 503438a36b..c8710c4dc9 100644
--- a/lib/timer/rte_timer.h
+++ b/lib/timer/rte_timer.h
@@ -36,6 +36,7 @@
 
 #include <stdio.h>
 #include <stdint.h>
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_spinlock.h>
 
diff --git a/lib/vhost/rte_vhost.h b/lib/vhost/rte_vhost.h
index f9d1ed3432..a395843fe9 100644
--- a/lib/vhost/rte_vhost.h
+++ b/lib/vhost/rte_vhost.h
@@ -14,6 +14,7 @@
 #include <stdint.h>
 #include <sys/eventfd.h>
 
+#include <rte_compat.h>
 #include <rte_memory.h>
 #include <rte_mempool.h>
 
-- 
2.37.3


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

* Re: [PATCH] cleanup compat header inclusions
  2022-11-02 15:08 [PATCH] cleanup compat header inclusions David Marchand
@ 2022-11-02 16:08 ` Bruce Richardson
  2022-11-02 16:33 ` David Marchand
  2022-11-03 14:00 ` [PATCH v2] " David Marchand
  2 siblings, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2022-11-02 16:08 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, thomas, gakhil, ferruh.yigit, andrew.rybchenko, jerinj

On Wed, Nov 02, 2022 at 04:08:28PM +0100, David Marchand wrote:
> With symbols going though experimental/stable stages, we accumulated
> a lot of discrepancies about inclusion of the rte_compat.h header.
> 
> Some headers are including it where unneeded, while others rely on
> implicit inclusion.
> 
> Fix unneeded inclusions:
> $ git grep -l include..rte_compat.h |
>   xargs grep -LE '__rte_(internal|experimental)' |
>   xargs sed -i -e '/#include..rte_compat.h/d'
> 
> Fix missing inclusion, by inserting rte_compat.h before the first
> inclusion of a DPDK header:
> $ git grep -lE '__rte_(internal|experimental)' |
>   xargs grep -L include..rte_compat.h |
>   xargs sed -i -e \
>     '0,/#include..\(rte_\|.*pmd.h.$\)/{
>       s/\(#include..\(rte_\|.*pmd.h.$\)\)/#include <rte_compat.h>\n\1/
>     }'
> 
> Fix missing inclusion, by inserting rte_compat.h after the last
> inclusion of a non DPDK header:
> $ for file in $(git grep -lE '__rte_(internal|experimental)' |
>   xargs grep -L include..rte_compat.h); do
>     tac $file > $file.$$
>     sed -i -e \
>       '0,/#include../{
>         s/\(#include..*$\)/#include <rte_compat.h>\n\n\1/
>       }' $file.$$
>     tac $file.$$ > $file
>     rm $file.$$
>   done
> 
> Fix missing inclusion, by inserting rte_compat.h after the header guard:
> $ git grep -lE '__rte_(internal|experimental)' |
>   xargs grep -L include..rte_compat.h |
>   xargs sed -i -e \
>     '0,/#define/{
>       s/\(#define .*$\)/\1\n\n#include <rte_compat.h>/
>     }'
> 
> And finally, exclude rte_compat.h itself.
> $ git checkout lib/eal/include/rte_compat.h
> 
> At the end of all this, we have a clean tree:
> $ git grep -lE '__rte_(internal|experimental)' |
>   xargs grep -L include..rte_compat.h
> buildtools/check-symbols.sh
> devtools/checkpatches.sh
> doc/guides/contributing/abi_policy.rst
> doc/guides/rel_notes/release_20_11.rst
> lib/eal/include/rte_compat.h
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
Very nice work, thanks!

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

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

* Re: [PATCH] cleanup compat header inclusions
  2022-11-02 15:08 [PATCH] cleanup compat header inclusions David Marchand
  2022-11-02 16:08 ` Bruce Richardson
@ 2022-11-02 16:33 ` David Marchand
  2022-11-03 14:00 ` [PATCH v2] " David Marchand
  2 siblings, 0 replies; 6+ messages in thread
From: David Marchand @ 2022-11-02 16:33 UTC (permalink / raw)
  To: dev; +Cc: thomas, gakhil, ferruh.yigit, andrew.rybchenko, jerinj

On Wed, Nov 2, 2022 at 4:09 PM David Marchand <david.marchand@redhat.com> wrote:
> diff --git a/drivers/baseband/acc/rte_acc_common_cfg.h b/drivers/baseband/acc/rte_acc_common_cfg.h
> index cce75d5878..c6545d49db 100644
> --- a/drivers/baseband/acc/rte_acc_common_cfg.h
> +++ b/drivers/baseband/acc/rte_acc_common_cfg.h
> @@ -19,6 +19,7 @@
>  #include <stdint.h>
>  #include <stdbool.h>
>
> +
>  #ifdef __cplusplus
>  extern "C" {
>  #endif

o_O
This hunk is strange and it is not generated with the commands I
listed in the commitlog.
This is probably a pebcak on my side when I refreshed the patch after rc2..

v2 on the way.


-- 
David Marchand


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

* [PATCH v2] cleanup compat header inclusions
  2022-11-02 15:08 [PATCH] cleanup compat header inclusions David Marchand
  2022-11-02 16:08 ` Bruce Richardson
  2022-11-02 16:33 ` David Marchand
@ 2022-11-03 14:00 ` David Marchand
  2022-11-06  8:36   ` Andrew Rybchenko
  2 siblings, 1 reply; 6+ messages in thread
From: David Marchand @ 2022-11-03 14:00 UTC (permalink / raw)
  To: dev
  Cc: thomas, gakhil, ferruh.yigit, andrew.rybchenko, jerinj, bruce.richardson

With symbols going though experimental/stable stages, we accumulated
a lot of discrepancies about inclusion of the rte_compat.h header.

Some headers are including it where unneeded, while others rely on
implicit inclusion.

Fix unneeded inclusions:
$ git grep -l include..rte_compat.h |
  xargs grep -LE '__rte_(internal|experimental)' |
  xargs sed -i -e '/#include..rte_compat.h/d'

Fix missing inclusion, by inserting rte_compat.h before the first
inclusion of a DPDK header:
$ git grep -lE '__rte_(internal|experimental)' |
  xargs grep -L include..rte_compat.h |
  xargs sed -i -e \
    '0,/#include..\(rte_\|.*pmd.h.$\)/{
      s/\(#include..\(rte_\|.*pmd.h.$\)\)/#include <rte_compat.h>\n\1/
    }'

Fix missing inclusion, by inserting rte_compat.h after the last
inclusion of a non DPDK header:
$ for file in $(git grep -lE '__rte_(internal|experimental)' |
  xargs grep -L include..rte_compat.h); do
    tac $file > $file.$$
    sed -i -e \
      '0,/#include../{
        s/\(#include..*$\)/#include <rte_compat.h>\n\n\1/
      }' $file.$$
    tac $file.$$ > $file
    rm $file.$$
  done

Fix missing inclusion, by inserting rte_compat.h after the header guard:
$ git grep -lE '__rte_(internal|experimental)' |
  xargs grep -L include..rte_compat.h |
  xargs sed -i -e \
    '0,/#define/{
      s/\(#define .*$\)/\1\n\n#include <rte_compat.h>/
    }'

And finally, exclude rte_compat.h itself.
$ git checkout lib/eal/include/rte_compat.h

At the end of all this, we have a clean tree:
$ git grep -lE '__rte_(internal|experimental)' |
  xargs grep -L include..rte_compat.h
buildtools/check-symbols.sh
devtools/checkpatches.sh
doc/guides/contributing/abi_policy.rst
doc/guides/rel_notes/release_20_11.rst
lib/eal/include/rte_compat.h

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
Changes since v1:
- dropped unrelated empty line change in
  drivers/baseband/acc/rte_acc_common_cfg.h,

---
 drivers/baseband/acc/rte_acc_cfg.h                     | 1 +
 drivers/baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h | 2 ++
 drivers/baseband/fpga_lte_fec/fpga_lte_fec.h           | 2 ++
 drivers/bus/dpaa/include/fsl_bman.h                    | 2 ++
 drivers/bus/dpaa/include/fsl_qman.h                    | 1 +
 drivers/bus/dpaa/include/fsl_usd.h                     | 2 ++
 drivers/bus/dpaa/include/netcfg.h                      | 2 ++
 drivers/bus/dpaa/include/process.h                     | 1 +
 drivers/bus/fslmc/mc/fsl_dpci.h                        | 2 ++
 drivers/bus/fslmc/mc/fsl_dpcon.h                       | 2 ++
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.h               | 2 ++
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h                | 1 +
 drivers/bus/pci/rte_bus_pci.h                          | 1 +
 drivers/bus/vmbus/rte_bus_vmbus.h                      | 1 -
 drivers/common/cnxk/roc_platform.h                     | 1 +
 drivers/common/cpt/cpt_pmd_ops_helper.h                | 2 ++
 drivers/common/dpaax/dpaax_iova_table.h                | 1 +
 drivers/common/iavf/iavf_prototype.h                   | 2 ++
 drivers/common/idpf/base/idpf_controlq_api.h           | 2 ++
 drivers/common/mlx5/linux/mlx5_common_os.h             | 1 +
 drivers/common/mlx5/linux/mlx5_nl.h                    | 1 +
 drivers/common/mlx5/mlx5_common.h                      | 1 +
 drivers/common/mlx5/mlx5_common_devx.h                 | 2 ++
 drivers/common/mlx5/mlx5_common_mp.h                   | 1 +
 drivers/common/mlx5/mlx5_common_mr.h                   | 1 +
 drivers/common/mlx5/mlx5_common_utils.h                | 1 +
 drivers/common/mlx5/mlx5_malloc.h                      | 2 ++
 drivers/common/mlx5/windows/mlx5_common_os.h           | 1 +
 drivers/common/octeontx/octeontx_mbox.h                | 1 +
 drivers/common/sfc_efx/efsys.h                         | 1 +
 drivers/common/sfc_efx/sfc_efx.h                       | 2 ++
 drivers/common/sfc_efx/sfc_efx_mcdi.h                  | 1 +
 drivers/crypto/cnxk/cn10k_cryptodev_ops.h              | 1 +
 drivers/crypto/cnxk/cn9k_cryptodev_ops.h               | 1 +
 drivers/crypto/dpaa2_sec/dpaa2_sec_event.h             | 2 ++
 drivers/crypto/dpaa_sec/dpaa_sec_event.h               | 2 ++
 drivers/crypto/octeontx/otx_cryptodev_ops.h            | 1 +
 drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h                 | 2 ++
 drivers/event/dlb2/rte_pmd_dlb2.h                      | 2 ++
 drivers/mempool/dpaa2/dpaa2_hw_mempool.h               | 2 ++
 drivers/mempool/dpaa2/rte_dpaa2_mempool.h              | 1 +
 drivers/net/bonding/rte_eth_bond_8023ad.c              | 1 -
 drivers/net/cnxk/cnxk_ethdev.h                         | 1 +
 drivers/net/dpaa/dpaa_ethdev.h                         | 1 +
 drivers/net/dpaa2/dpaa2_ethdev.h                       | 1 +
 drivers/net/dpaa2/rte_pmd_dpaa2.h                      | 1 +
 drivers/net/iavf/rte_pmd_iavf.h                        | 1 +
 drivers/net/ice/ice_ethdev.h                           | 1 +
 drivers/net/mlx5/rte_pmd_mlx5.h                        | 2 ++
 drivers/net/txgbe/rte_pmd_txgbe.h                      | 1 -
 lib/bbdev/rte_bbdev.h                                  | 1 +
 lib/bbdev/rte_bbdev_op.h                               | 1 +
 lib/bpf/rte_bpf.h                                      | 1 +
 lib/compressdev/rte_comp.h                             | 1 +
 lib/compressdev/rte_compressdev.h                      | 1 +
 lib/compressdev/rte_compressdev_pmd.h                  | 1 +
 lib/cryptodev/cryptodev_pmd.h                          | 1 +
 lib/cryptodev/rte_crypto_sym.h                         | 1 +
 lib/cryptodev/rte_cryptodev.h                          | 1 +
 lib/dmadev/rte_dmadev_pmd.h                            | 1 +
 lib/eal/arm/include/rte_io_64.h                        | 1 +
 lib/eal/arm/include/rte_prefetch_32.h                  | 1 +
 lib/eal/arm/include/rte_prefetch_64.h                  | 1 +
 lib/eal/freebsd/eal.c                                  | 1 -
 lib/eal/freebsd/eal_dev.c                              | 1 -
 lib/eal/include/generic/rte_atomic.h                   | 1 +
 lib/eal/include/generic/rte_cycles.h                   | 1 -
 lib/eal/include/generic/rte_pause.h                    | 1 -
 lib/eal/include/rte_bitmap.h                           | 1 +
 lib/eal/include/rte_class.h                            | 1 +
 lib/eal/include/rte_eal_memconfig.h                    | 1 -
 lib/eal/include/rte_epoll.h                            | 1 -
 lib/eal/include/rte_fbarray.h                          | 1 -
 lib/eal/include/rte_lcore.h                            | 1 +
 lib/eal/include/rte_log.h                              | 1 -
 lib/eal/include/rte_malloc.h                           | 1 -
 lib/eal/include/rte_memory.h                           | 1 -
 lib/eal/include/rte_memzone.h                          | 1 -
 lib/eal/include/rte_pflock.h                           | 1 +
 lib/eal/include/rte_service.h                          | 1 +
 lib/eal/include/rte_service_component.h                | 1 -
 lib/eal/loongarch/include/rte_prefetch.h               | 1 +
 lib/eal/ppc/include/rte_atomic.h                       | 1 -
 lib/eal/ppc/include/rte_prefetch.h                     | 1 +
 lib/eal/riscv/include/rte_prefetch.h                   | 1 +
 lib/eal/x86/include/rte_io.h                           | 1 +
 lib/eal/x86/include/rte_prefetch.h                     | 1 +
 lib/ethdev/ethdev_driver.h                             | 1 +
 lib/ethdev/rte_flow.h                                  | 1 +
 lib/ethdev/rte_tm.h                                    | 1 +
 lib/eventdev/eventdev_pmd_pci.h                        | 1 +
 lib/eventdev/eventdev_pmd_vdev.h                       | 1 +
 lib/eventdev/rte_event_eth_rx_adapter.h                | 1 +
 lib/eventdev/rte_event_eth_tx_adapter.h                | 1 +
 lib/eventdev/rte_eventdev.h                            | 1 +
 lib/gpudev/gpudev_driver.h                             | 1 +
 lib/graph/rte_graph_worker.h                           | 1 +
 lib/hash/rte_hash.h                                    | 1 -
 lib/hash/rte_thash.h                                   | 1 +
 lib/hash/rte_thash_gfni.h                              | 1 +
 lib/hash/rte_thash_x86_gfni.h                          | 1 +
 lib/ip_frag/rte_ip_frag.h                              | 1 +
 lib/ipsec/rte_ipsec.h                                  | 1 +
 lib/ipsec/rte_ipsec_sad.h                              | 1 -
 lib/kni/rte_kni.h                                      | 1 +
 lib/lpm/rte_lpm.h                                      | 1 +
 lib/lpm/rte_lpm_sve.h                                  | 1 +
 lib/mbuf/rte_mbuf_core.h                               | 1 -
 lib/member/rte_member.h                                | 1 +
 lib/mempool/rte_mempool.h                              | 1 +
 lib/meter/rte_meter.h                                  | 1 -
 lib/metrics/rte_metrics.h                              | 1 -
 lib/metrics/rte_metrics_telemetry.h                    | 1 +
 lib/net/rte_ip.h                                       | 1 +
 lib/node/rte_node_eth_api.h                            | 1 +
 lib/pdump/rte_pdump.h                                  | 1 +
 lib/power/rte_power.h                                  | 1 +
 lib/power/rte_power_empty_poll.h                       | 1 +
 lib/power/rte_power_intel_uncore.h                     | 1 +
 lib/power/rte_power_pmd_mgmt.h                         | 1 +
 lib/rcu/rte_rcu_qsbr.h                                 | 1 +
 lib/regexdev/rte_regexdev.h                            | 1 +
 lib/regexdev/rte_regexdev_driver.h                     | 1 +
 lib/reorder/rte_reorder.h                              | 1 +
 lib/sched/rte_pie.h                                    | 1 +
 lib/security/rte_security_driver.h                     | 1 +
 lib/telemetry/rte_telemetry.h                          | 1 -
 lib/timer/rte_timer.h                                  | 1 +
 lib/vhost/rte_vhost.h                                  | 1 +
 129 files changed, 127 insertions(+), 22 deletions(-)

diff --git a/drivers/baseband/acc/rte_acc_cfg.h b/drivers/baseband/acc/rte_acc_cfg.h
index 21bcf88dad..9526b7ab8e 100644
--- a/drivers/baseband/acc/rte_acc_cfg.h
+++ b/drivers/baseband/acc/rte_acc_cfg.h
@@ -18,6 +18,7 @@
 
 #include <stdint.h>
 #include <stdbool.h>
+#include <rte_compat.h>
 #include "rte_acc_common_cfg.h"
 
 #ifdef __cplusplus
diff --git a/drivers/baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h b/drivers/baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h
index 93a87c8e82..f042d5dea5 100644
--- a/drivers/baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h
+++ b/drivers/baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h
@@ -8,6 +8,8 @@
 #include <stdint.h>
 #include <stdbool.h>
 
+#include <rte_compat.h>
+
 /**
  * @file rte_pmd_fpga_5gnr_fec.h
  *
diff --git a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.h b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.h
index b35c7a484e..9a01a58a49 100644
--- a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.h
+++ b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.h
@@ -8,6 +8,8 @@
 #include <stdint.h>
 #include <stdbool.h>
 
+#include <rte_compat.h>
+
 /**
  * @file fpga_lte_fec.h
  *
diff --git a/drivers/bus/dpaa/include/fsl_bman.h b/drivers/bus/dpaa/include/fsl_bman.h
index 82da2fcfe0..6719a4e3c9 100644
--- a/drivers/bus/dpaa/include/fsl_bman.h
+++ b/drivers/bus/dpaa/include/fsl_bman.h
@@ -7,6 +7,8 @@
 #ifndef __FSL_BMAN_H
 #define __FSL_BMAN_H
 
+#include <rte_compat.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h
index 9b63e559bc..5953309b7a 100644
--- a/drivers/bus/dpaa/include/fsl_qman.h
+++ b/drivers/bus/dpaa/include/fsl_qman.h
@@ -13,6 +13,7 @@ extern "C" {
 #endif
 
 #include <dpaa_rbtree.h>
+#include <rte_compat.h>
 #include <rte_eventdev.h>
 
 /* FQ lookups (turn this on for 64bit user-space) */
diff --git a/drivers/bus/dpaa/include/fsl_usd.h b/drivers/bus/dpaa/include/fsl_usd.h
index 97279421ad..5bf13c0b46 100644
--- a/drivers/bus/dpaa/include/fsl_usd.h
+++ b/drivers/bus/dpaa/include/fsl_usd.h
@@ -13,6 +13,8 @@
 #include <dpaa_list.h>
 #include <fsl_qman.h>
 
+#include <rte_compat.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/drivers/bus/dpaa/include/netcfg.h b/drivers/bus/dpaa/include/netcfg.h
index 43c7e1cfe1..5bdcc9186a 100644
--- a/drivers/bus/dpaa/include/netcfg.h
+++ b/drivers/bus/dpaa/include/netcfg.h
@@ -10,6 +10,8 @@
 
 #include <fman.h>
 
+#include <rte_compat.h>
+
 /* Configuration information related to a specific ethernet port */
 struct fm_eth_port_cfg {
 	/**< A list of PCD FQ ranges, obtained from FMC configuration */
diff --git a/drivers/bus/dpaa/include/process.h b/drivers/bus/dpaa/include/process.h
index 48d6b5693f..610664672c 100644
--- a/drivers/bus/dpaa/include/process.h
+++ b/drivers/bus/dpaa/include/process.h
@@ -10,6 +10,7 @@
 #define	__PROCESS_H
 
 #include <compat.h>
+#include <rte_compat.h>
 #include <rte_ethdev.h>
 
 /* The process device underlies process-wide user/kernel interactions, such as
diff --git a/drivers/bus/fslmc/mc/fsl_dpci.h b/drivers/bus/fslmc/mc/fsl_dpci.h
index 81fd3438aa..397b4bc2be 100644
--- a/drivers/bus/fslmc/mc/fsl_dpci.h
+++ b/drivers/bus/fslmc/mc/fsl_dpci.h
@@ -9,6 +9,8 @@
 
 #include <fsl_dpopr.h>
 
+#include <rte_compat.h>
+
 /* Data Path Communication Interface API
  * Contains initialization APIs and runtime control APIs for DPCI
  */
diff --git a/drivers/bus/fslmc/mc/fsl_dpcon.h b/drivers/bus/fslmc/mc/fsl_dpcon.h
index 7caa6c68a1..db72477c8a 100644
--- a/drivers/bus/fslmc/mc/fsl_dpcon.h
+++ b/drivers/bus/fslmc/mc/fsl_dpcon.h
@@ -7,6 +7,8 @@
 #ifndef __FSL_DPCON_H
 #define __FSL_DPCON_H
 
+#include <rte_compat.h>
+
 /* Data Path Concentrator API
  * Contains initialization APIs and runtime control APIs for DPCON
  */
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h
index b8eb8ee0ab..7407f8d38d 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h
@@ -11,6 +11,8 @@
 #include <mc/fsl_dpio.h>
 #include <mc/fsl_mc_sys.h>
 
+#include <rte_compat.h>
+
 struct dpaa2_io_portal_t {
 	struct dpaa2_dpio_dev *dpio_dev;
 	struct dpaa2_dpio_dev *ethrx_dpio_dev;
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index 024fbf9935..bd949ade3a 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -8,6 +8,7 @@
 #ifndef _DPAA2_HW_PVT_H_
 #define _DPAA2_HW_PVT_H_
 
+#include <rte_compat.h>
 #include <rte_eventdev.h>
 #include <dpaax_iova_table.h>
 
diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h
index 60e50ca875..b193114fe5 100644
--- a/drivers/bus/pci/rte_bus_pci.h
+++ b/drivers/bus/pci/rte_bus_pci.h
@@ -22,6 +22,7 @@ extern "C" {
 #include <stdint.h>
 #include <inttypes.h>
 
+#include <rte_compat.h>
 #include <rte_debug.h>
 #include <rte_interrupts.h>
 #include <rte_pci.h>
diff --git a/drivers/bus/vmbus/rte_bus_vmbus.h b/drivers/bus/vmbus/rte_bus_vmbus.h
index 03894a5d46..9467bd8f3d 100644
--- a/drivers/bus/vmbus/rte_bus_vmbus.h
+++ b/drivers/bus/vmbus/rte_bus_vmbus.h
@@ -23,7 +23,6 @@ extern "C" {
 #include <stdint.h>
 #include <inttypes.h>
 
-#include <rte_compat.h>
 #include <rte_uuid.h>
 #include <rte_debug.h>
 #include <rte_interrupts.h>
diff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc_platform.h
index 5efe44674a..1a48ff3db4 100644
--- a/drivers/common/cnxk/roc_platform.h
+++ b/drivers/common/cnxk/roc_platform.h
@@ -5,6 +5,7 @@
 #ifndef _ROC_PLATFORM_H_
 #define _ROC_PLATFORM_H_
 
+#include <rte_compat.h>
 #include <rte_alarm.h>
 #include <rte_bitmap.h>
 #include <bus_pci_driver.h>
diff --git a/drivers/common/cpt/cpt_pmd_ops_helper.h b/drivers/common/cpt/cpt_pmd_ops_helper.h
index 413ca50edd..0ba872e74e 100644
--- a/drivers/common/cpt/cpt_pmd_ops_helper.h
+++ b/drivers/common/cpt/cpt_pmd_ops_helper.h
@@ -5,6 +5,8 @@
 #ifndef _CPT_PMD_OPS_HELPER_H_
 #define _CPT_PMD_OPS_HELPER_H_
 
+#include <rte_compat.h>
+
 /*
  * This file defines the agreement between the common layer and the individual
  * crypto drivers for OCTEON TX series. Control path in otx* directory can
diff --git a/drivers/common/dpaax/dpaax_iova_table.h b/drivers/common/dpaax/dpaax_iova_table.h
index 9a18eafca0..1f915eb270 100644
--- a/drivers/common/dpaax/dpaax_iova_table.h
+++ b/drivers/common/dpaax/dpaax_iova_table.h
@@ -19,6 +19,7 @@
 #include <errno.h>
 #include <arpa/inet.h>
 
+#include <rte_compat.h>
 #include <rte_eal.h>
 #include <rte_branch_prediction.h>
 #include <rte_memory.h>
diff --git a/drivers/common/iavf/iavf_prototype.h b/drivers/common/iavf/iavf_prototype.h
index 1c125d1d94..b5124de5bf 100644
--- a/drivers/common/iavf/iavf_prototype.h
+++ b/drivers/common/iavf/iavf_prototype.h
@@ -9,6 +9,8 @@
 #include "iavf_alloc.h"
 #include "virtchnl.h"
 
+#include <rte_compat.h>
+
 /* Prototypes for shared code functions that are not in
  * the standard function pointer structures.  These are
  * mostly because they are needed even before the init
diff --git a/drivers/common/idpf/base/idpf_controlq_api.h b/drivers/common/idpf/base/idpf_controlq_api.h
index 2d79c7f4dd..68ac0cfe70 100644
--- a/drivers/common/idpf/base/idpf_controlq_api.h
+++ b/drivers/common/idpf/base/idpf_controlq_api.h
@@ -9,6 +9,8 @@
 #include "idpf_mem.h"
 #else /* !__KERNEL__ */
 #include "idpf_osdep.h"
+
+#include <rte_compat.h>
 #endif /* !__KERNEL__ */
 
 struct idpf_hw;
diff --git a/drivers/common/mlx5/linux/mlx5_common_os.h b/drivers/common/mlx5/linux/mlx5_common_os.h
index 81702b8768..e8aa1d46ec 100644
--- a/drivers/common/mlx5/linux/mlx5_common_os.h
+++ b/drivers/common/mlx5/linux/mlx5_common_os.h
@@ -8,6 +8,7 @@
 #include <stdio.h>
 #include <malloc.h>
 
+#include <rte_compat.h>
 #include <rte_pci.h>
 #include <bus_pci_driver.h>
 #include <rte_debug.h>
diff --git a/drivers/common/mlx5/linux/mlx5_nl.h b/drivers/common/mlx5/linux/mlx5_nl.h
index 0b7552338a..db01d7323e 100644
--- a/drivers/common/mlx5/linux/mlx5_nl.h
+++ b/drivers/common/mlx5/linux/mlx5_nl.h
@@ -7,6 +7,7 @@
 
 #include <linux/netlink.h>
 
+#include <rte_compat.h>
 #include <rte_ether.h>
 
 #include "mlx5_common.h"
diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h
index 629a639a81..d6e91b5296 100644
--- a/drivers/common/mlx5/mlx5_common.h
+++ b/drivers/common/mlx5/mlx5_common.h
@@ -7,6 +7,7 @@
 
 #include <stdio.h>
 
+#include <rte_compat.h>
 #include <rte_pci.h>
 #include <bus_pci_driver.h>
 #include <rte_debug.h>
diff --git a/drivers/common/mlx5/mlx5_common_devx.h b/drivers/common/mlx5/mlx5_common_devx.h
index 12b0cb121f..743f06042c 100644
--- a/drivers/common/mlx5/mlx5_common_devx.h
+++ b/drivers/common/mlx5/mlx5_common_devx.h
@@ -7,6 +7,8 @@
 
 #include "mlx5_devx_cmds.h"
 
+#include <rte_compat.h>
+
 /* The standard page size */
 #define MLX5_LOG_PAGE_SIZE 12
 
diff --git a/drivers/common/mlx5/mlx5_common_mp.h b/drivers/common/mlx5/mlx5_common_mp.h
index 4599ba8f92..34e4fae28a 100644
--- a/drivers/common/mlx5/mlx5_common_mp.h
+++ b/drivers/common/mlx5/mlx5_common_mp.h
@@ -7,6 +7,7 @@
 #define RTE_PMD_MLX5_COMMON_MP_H_
 
 #include <mlx5_glue.h>
+#include <rte_compat.h>
 #include <rte_eal.h>
 #include <rte_string_fns.h>
 
diff --git a/drivers/common/mlx5/mlx5_common_mr.h b/drivers/common/mlx5/mlx5_common_mr.h
index f774ccbf33..e03cd9f707 100644
--- a/drivers/common/mlx5/mlx5_common_mr.h
+++ b/drivers/common/mlx5/mlx5_common_mr.h
@@ -11,6 +11,7 @@
 #include <sys/queue.h>
 
 
+#include <rte_compat.h>
 #include <rte_rwlock.h>
 #include <rte_bitmap.h>
 #include <rte_mbuf.h>
diff --git a/drivers/common/mlx5/mlx5_common_utils.h b/drivers/common/mlx5/mlx5_common_utils.h
index 98e487e7ef..ae15119a33 100644
--- a/drivers/common/mlx5/mlx5_common_utils.h
+++ b/drivers/common/mlx5/mlx5_common_utils.h
@@ -5,6 +5,7 @@
 #ifndef RTE_PMD_MLX5_COMMON_UTILS_H_
 #define RTE_PMD_MLX5_COMMON_UTILS_H_
 
+#include <rte_compat.h>
 #include <rte_rwlock.h>
 
 #include "mlx5_common.h"
diff --git a/drivers/common/mlx5/mlx5_malloc.h b/drivers/common/mlx5/mlx5_malloc.h
index 92149f7b92..9086a4f3f2 100644
--- a/drivers/common/mlx5/mlx5_malloc.h
+++ b/drivers/common/mlx5/mlx5_malloc.h
@@ -5,6 +5,8 @@
 #ifndef MLX5_MALLOC_H_
 #define MLX5_MALLOC_H_
 
+#include <rte_compat.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/drivers/common/mlx5/windows/mlx5_common_os.h b/drivers/common/mlx5/windows/mlx5_common_os.h
index e9e9108127..acee0c987f 100644
--- a/drivers/common/mlx5/windows/mlx5_common_os.h
+++ b/drivers/common/mlx5/windows/mlx5_common_os.h
@@ -8,6 +8,7 @@
 #include <stdio.h>
 #include <sys/types.h>
 
+#include <rte_compat.h>
 #include <rte_errno.h>
 #include <rte_interrupts.h>
 
diff --git a/drivers/common/octeontx/octeontx_mbox.h b/drivers/common/octeontx/octeontx_mbox.h
index 706b198f6e..ab4c010558 100644
--- a/drivers/common/octeontx/octeontx_mbox.h
+++ b/drivers/common/octeontx/octeontx_mbox.h
@@ -5,6 +5,7 @@
 #ifndef __OCTEONTX_MBOX_H__
 #define __OCTEONTX_MBOX_H__
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_spinlock.h>
 
diff --git a/drivers/common/sfc_efx/efsys.h b/drivers/common/sfc_efx/efsys.h
index 224254bee7..41fa3da762 100644
--- a/drivers/common/sfc_efx/efsys.h
+++ b/drivers/common/sfc_efx/efsys.h
@@ -12,6 +12,7 @@
 
 #include <stdbool.h>
 
+#include <rte_compat.h>
 #include <rte_spinlock.h>
 #include <rte_byteorder.h>
 #include <rte_debug.h>
diff --git a/drivers/common/sfc_efx/sfc_efx.h b/drivers/common/sfc_efx/sfc_efx.h
index d3ea586cb8..6b60ac6f67 100644
--- a/drivers/common/sfc_efx/sfc_efx.h
+++ b/drivers/common/sfc_efx/sfc_efx.h
@@ -15,6 +15,8 @@
 #include "efx.h"
 #include "efsys.h"
 
+#include <rte_compat.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/drivers/common/sfc_efx/sfc_efx_mcdi.h b/drivers/common/sfc_efx/sfc_efx_mcdi.h
index 85f9c5f204..2ad4c36c8d 100644
--- a/drivers/common/sfc_efx/sfc_efx_mcdi.h
+++ b/drivers/common/sfc_efx/sfc_efx_mcdi.h
@@ -12,6 +12,7 @@
 
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_spinlock.h>
 
 #include "efsys.h"
diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_ops.h b/drivers/crypto/cnxk/cn10k_cryptodev_ops.h
index 3d7c6d195a..43a1314138 100644
--- a/drivers/crypto/cnxk/cn10k_cryptodev_ops.h
+++ b/drivers/crypto/cnxk/cn10k_cryptodev_ops.h
@@ -5,6 +5,7 @@
 #ifndef _CN10K_CRYPTODEV_OPS_H_
 #define _CN10K_CRYPTODEV_OPS_H_
 
+#include <rte_compat.h>
 #include <cryptodev_pmd.h>
 #include <rte_cryptodev.h>
 #include <rte_eventdev.h>
diff --git a/drivers/crypto/cnxk/cn9k_cryptodev_ops.h b/drivers/crypto/cnxk/cn9k_cryptodev_ops.h
index 9f6dc24603..c6ec96153e 100644
--- a/drivers/crypto/cnxk/cn9k_cryptodev_ops.h
+++ b/drivers/crypto/cnxk/cn9k_cryptodev_ops.h
@@ -5,6 +5,7 @@
 #ifndef _CN9K_CRYPTODEV_OPS_H_
 #define _CN9K_CRYPTODEV_OPS_H_
 
+#include <rte_compat.h>
 #include <cryptodev_pmd.h>
 
 extern struct rte_cryptodev_ops cn9k_cpt_ops;
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_event.h b/drivers/crypto/dpaa2_sec/dpaa2_sec_event.h
index 675cbbb81d..bd37365eac 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_event.h
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_event.h
@@ -6,6 +6,8 @@
 #ifndef _DPAA2_SEC_EVENT_H_
 #define _DPAA2_SEC_EVENT_H_
 
+#include <rte_compat.h>
+
 __rte_internal
 int dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev,
 		int qp_id,
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec_event.h b/drivers/crypto/dpaa_sec/dpaa_sec_event.h
index 0b09fa8f75..d1cc08002e 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec_event.h
+++ b/drivers/crypto/dpaa_sec/dpaa_sec_event.h
@@ -6,6 +6,8 @@
 #ifndef _DPAA_SEC_EVENT_H_
 #define _DPAA_SEC_EVENT_H_
 
+#include <rte_compat.h>
+
 __rte_internal
 int dpaa_sec_eventq_attach(const struct rte_cryptodev *dev,
 		int qp_id,
diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.h b/drivers/crypto/octeontx/otx_cryptodev_ops.h
index 83b82ea059..e68f0b38df 100644
--- a/drivers/crypto/octeontx/otx_cryptodev_ops.h
+++ b/drivers/crypto/octeontx/otx_cryptodev_ops.h
@@ -5,6 +5,7 @@
 #ifndef _OTX_CRYPTODEV_OPS_H_
 #define _OTX_CRYPTODEV_OPS_H_
 
+#include <rte_compat.h>
 #include <cryptodev_pmd.h>
 
 #define OTX_CPT_MIN_HEADROOM_REQ	(24)
diff --git a/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h b/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h
index 7744dacb2c..dc8acb4aec 100644
--- a/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h
+++ b/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h
@@ -5,6 +5,8 @@
 #ifndef _RTE_PMD_DPAA2_QDMA_H_
 #define _RTE_PMD_DPAA2_QDMA_H_
 
+#include <rte_compat.h>
+
 /** States if the source addresses is physical. */
 #define RTE_DPAA2_QDMA_JOB_SRC_PHY		(1ULL << 30)
 
diff --git a/drivers/event/dlb2/rte_pmd_dlb2.h b/drivers/event/dlb2/rte_pmd_dlb2.h
index 1dbd885a16..334c6c356d 100644
--- a/drivers/event/dlb2/rte_pmd_dlb2.h
+++ b/drivers/event/dlb2/rte_pmd_dlb2.h
@@ -17,6 +17,8 @@ extern "C" {
 
 #include <stdint.h>
 
+#include <rte_compat.h>
+
 /**
  * @warning
  * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.h b/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
index 7c493b28e7..9e21823fb6 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
@@ -8,6 +8,8 @@
 #ifndef _DPAA2_HW_DPBP_H_
 #define _DPAA2_HW_DPBP_H_
 
+#include <rte_compat.h>
+
 #define DPAA2_MAX_BUF_POOLS	8
 
 struct buf_pool_cfg {
diff --git a/drivers/mempool/dpaa2/rte_dpaa2_mempool.h b/drivers/mempool/dpaa2/rte_dpaa2_mempool.h
index 28dea74326..7fe3d93f61 100644
--- a/drivers/mempool/dpaa2/rte_dpaa2_mempool.h
+++ b/drivers/mempool/dpaa2/rte_dpaa2_mempool.h
@@ -16,6 +16,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_mempool.h>
 
 /**
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 29a71ae0bf..4a266bb2ca 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -10,7 +10,6 @@
 #include <rte_malloc.h>
 #include <rte_errno.h>
 #include <rte_cycles.h>
-#include <rte_compat.h>
 
 #include "eth_bond_private.h"
 
diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
index f54a767dbe..651ef45ea8 100644
--- a/drivers/net/cnxk/cnxk_ethdev.h
+++ b/drivers/net/cnxk/cnxk_ethdev.h
@@ -9,6 +9,7 @@
 
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
+#include <rte_compat.h>
 #include <rte_kvargs.h>
 #include <rte_mbuf.h>
 #include <rte_mbuf_pool_ops.h>
diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index 502c1c88b8..5b6802ece8 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -10,6 +10,7 @@
 /* System headers */
 #include <stdbool.h>
 #include <ethdev_driver.h>
+#include <rte_compat.h>
 #include <rte_event_eth_rx_adapter.h>
 
 #include <fsl_usd.h>
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h
index c88c8146dc..9feb631d5f 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.h
+++ b/drivers/net/dpaa2/dpaa2_ethdev.h
@@ -8,6 +8,7 @@
 #ifndef _DPAA2_ETHDEV_H
 #define _DPAA2_ETHDEV_H
 
+#include <rte_compat.h>
 #include <rte_event_eth_rx_adapter.h>
 #include <rte_pmd_dpaa2.h>
 
diff --git a/drivers/net/dpaa2/rte_pmd_dpaa2.h b/drivers/net/dpaa2/rte_pmd_dpaa2.h
index 8ea42ee130..a1152eb717 100644
--- a/drivers/net/dpaa2/rte_pmd_dpaa2.h
+++ b/drivers/net/dpaa2/rte_pmd_dpaa2.h
@@ -11,6 +11,7 @@
  * NXP dpaa2 PMD specific functions.
  */
 
+#include <rte_compat.h>
 #include <rte_flow.h>
 
 /**
diff --git a/drivers/net/iavf/rte_pmd_iavf.h b/drivers/net/iavf/rte_pmd_iavf.h
index 7426eb9be3..56d453fc4c 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>
 
diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h
index 487a331117..c8311be179 100644
--- a/drivers/net/ice/ice_ethdev.h
+++ b/drivers/net/ice/ice_ethdev.h
@@ -5,6 +5,7 @@
 #ifndef _ICE_ETHDEV_H_
 #define _ICE_ETHDEV_H_
 
+#include <rte_compat.h>
 #include <rte_kvargs.h>
 #include <rte_time.h>
 
diff --git a/drivers/net/mlx5/rte_pmd_mlx5.h b/drivers/net/mlx5/rte_pmd_mlx5.h
index d4caea5b20..b71a291256 100644
--- a/drivers/net/mlx5/rte_pmd_mlx5.h
+++ b/drivers/net/mlx5/rte_pmd_mlx5.h
@@ -5,6 +5,8 @@
 #ifndef RTE_PMD_PRIVATE_MLX5_H_
 #define RTE_PMD_PRIVATE_MLX5_H_
 
+#include <rte_compat.h>
+
 /**
  * @file
  * MLX5 public header.
diff --git a/drivers/net/txgbe/rte_pmd_txgbe.h b/drivers/net/txgbe/rte_pmd_txgbe.h
index d222fc3537..bb723c5e3a 100644
--- a/drivers/net/txgbe/rte_pmd_txgbe.h
+++ b/drivers/net/txgbe/rte_pmd_txgbe.h
@@ -12,7 +12,6 @@
 #ifndef _PMD_TXGBE_H_
 #define _PMD_TXGBE_H_
 
-#include <rte_compat.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
 
diff --git a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h
index 1eb5fa532b..52f6ed9b01 100644
--- a/lib/bbdev/rte_bbdev.h
+++ b/lib/bbdev/rte_bbdev.h
@@ -27,6 +27,7 @@ extern "C" {
 #include <stdint.h>
 #include <stdbool.h>
 
+#include <rte_compat.h>
 #include <rte_cpuflags.h>
 
 #include "rte_bbdev_op.h"
diff --git a/lib/bbdev/rte_bbdev_op.h b/lib/bbdev/rte_bbdev_op.h
index 2b6ffb80fe..96a390cd9b 100644
--- a/lib/bbdev/rte_bbdev_op.h
+++ b/lib/bbdev/rte_bbdev_op.h
@@ -17,6 +17,7 @@ extern "C" {
 
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_mbuf.h>
 #include <rte_memory.h>
diff --git a/lib/bpf/rte_bpf.h b/lib/bpf/rte_bpf.h
index 7e7d03b9c7..4d71120dbd 100644
--- a/lib/bpf/rte_bpf.h
+++ b/lib/bpf/rte_bpf.h
@@ -16,6 +16,7 @@
  * (https://www.kernel.org/doc/Documentation/networking/filter.txt).
  */
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_mbuf.h>
 #include <bpf_def.h>
diff --git a/lib/compressdev/rte_comp.h b/lib/compressdev/rte_comp.h
index 99a48711e4..a8f398b57b 100644
--- a/lib/compressdev/rte_comp.h
+++ b/lib/compressdev/rte_comp.h
@@ -16,6 +16,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_mbuf.h>
 
 /**
diff --git a/lib/compressdev/rte_compressdev.h b/lib/compressdev/rte_compressdev.h
index aa865c4c03..42bda9fc79 100644
--- a/lib/compressdev/rte_compressdev.h
+++ b/lib/compressdev/rte_compressdev.h
@@ -22,6 +22,7 @@ extern "C" {
 #endif
 
 
+#include <rte_compat.h>
 #include "rte_comp.h"
 
 /**
diff --git a/lib/compressdev/rte_compressdev_pmd.h b/lib/compressdev/rte_compressdev_pmd.h
index 72e52f876f..ea012908b7 100644
--- a/lib/compressdev/rte_compressdev_pmd.h
+++ b/lib/compressdev/rte_compressdev_pmd.h
@@ -21,6 +21,7 @@ extern "C" {
 
 #include <dev_driver.h>
 
+#include <rte_compat.h>
 #include "rte_compressdev.h"
 #include "rte_compressdev_internal.h"
 
diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
index f27b3249ea..0020102eb7 100644
--- a/lib/cryptodev/cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -20,6 +20,7 @@ extern "C" {
 #include <string.h>
 
 #include <dev_driver.h>
+#include <rte_compat.h>
 #include <rte_malloc.h>
 #include <rte_log.h>
 #include <rte_common.h>
diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h
index bd59fe4d26..33b4966e16 100644
--- a/lib/cryptodev/rte_crypto_sym.h
+++ b/lib/cryptodev/rte_crypto_sym.h
@@ -20,6 +20,7 @@ extern "C" {
 
 #include <string.h>
 
+#include <rte_compat.h>
 #include <rte_mbuf.h>
 #include <rte_memory.h>
 #include <rte_mempool.h>
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index ece7157970..86d792e2e7 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -18,6 +18,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include "rte_kvargs.h"
 #include "rte_crypto.h"
 #include <rte_common.h>
diff --git a/lib/dmadev/rte_dmadev_pmd.h b/lib/dmadev/rte_dmadev_pmd.h
index acd7f71cd1..c61cedfb23 100644
--- a/lib/dmadev/rte_dmadev_pmd.h
+++ b/lib/dmadev/rte_dmadev_pmd.h
@@ -16,6 +16,7 @@
 
 #include <dev_driver.h>
 
+#include <rte_compat.h>
 #include "rte_dmadev.h"
 
 #ifdef __cplusplus
diff --git a/lib/eal/arm/include/rte_io_64.h b/lib/eal/arm/include/rte_io_64.h
index f9a1f10ce7..96da7789ce 100644
--- a/lib/eal/arm/include/rte_io_64.h
+++ b/lib/eal/arm/include/rte_io_64.h
@@ -14,6 +14,7 @@ extern "C" {
 #define RTE_OVERRIDE_IO_H
 
 #include "generic/rte_io.h"
+#include <rte_compat.h>
 #include "rte_atomic_64.h"
 
 static __rte_always_inline uint8_t
diff --git a/lib/eal/arm/include/rte_prefetch_32.h b/lib/eal/arm/include/rte_prefetch_32.h
index 303caaa780..0e9a140c8a 100644
--- a/lib/eal/arm/include/rte_prefetch_32.h
+++ b/lib/eal/arm/include/rte_prefetch_32.h
@@ -9,6 +9,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include "generic/rte_prefetch.h"
 
diff --git a/lib/eal/arm/include/rte_prefetch_64.h b/lib/eal/arm/include/rte_prefetch_64.h
index e28b66fee0..22cba48e29 100644
--- a/lib/eal/arm/include/rte_prefetch_64.h
+++ b/lib/eal/arm/include/rte_prefetch_64.h
@@ -9,6 +9,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include "generic/rte_prefetch.h"
 
diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index 1b58cd3da6..607684c1a3 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -21,7 +21,6 @@
 #include <sys/queue.h>
 #include <sys/stat.h>
 
-#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_memory.h>
diff --git a/lib/eal/freebsd/eal_dev.c b/lib/eal/freebsd/eal_dev.c
index 8e06e70890..c3dfe9108f 100644
--- a/lib/eal/freebsd/eal_dev.c
+++ b/lib/eal/freebsd/eal_dev.c
@@ -3,7 +3,6 @@
  */
 
 #include <rte_log.h>
-#include <rte_compat.h>
 #include <rte_dev.h>
 
 int
diff --git a/lib/eal/include/generic/rte_atomic.h b/lib/eal/include/generic/rte_atomic.h
index 276272f40b..f5c49a9870 100644
--- a/lib/eal/include/generic/rte_atomic.h
+++ b/lib/eal/include/generic/rte_atomic.h
@@ -13,6 +13,7 @@
  */
 
 #include <stdint.h>
+#include <rte_compat.h>
 #include <rte_common.h>
 
 #ifdef __DOXYGEN__
diff --git a/lib/eal/include/generic/rte_cycles.h b/lib/eal/include/generic/rte_cycles.h
index f4fdca4165..69f3cee8d1 100644
--- a/lib/eal/include/generic/rte_cycles.h
+++ b/lib/eal/include/generic/rte_cycles.h
@@ -13,7 +13,6 @@
  */
 
 #include <stdint.h>
-#include <rte_compat.h>
 #include <rte_debug.h>
 #include <rte_atomic.h>
 
diff --git a/lib/eal/include/generic/rte_pause.h b/lib/eal/include/generic/rte_pause.h
index 032f9ac05a..2173a544d5 100644
--- a/lib/eal/include/generic/rte_pause.h
+++ b/lib/eal/include/generic/rte_pause.h
@@ -17,7 +17,6 @@
 #include <assert.h>
 #include <rte_common.h>
 #include <rte_atomic.h>
-#include <rte_compat.h>
 
 /**
  * Pause CPU execution for a short while
diff --git a/lib/eal/include/rte_bitmap.h b/lib/eal/include/rte_bitmap.h
index c589d5cde0..27ee3d18a4 100644
--- a/lib/eal/include/rte_bitmap.h
+++ b/lib/eal/include/rte_bitmap.h
@@ -36,6 +36,7 @@ extern "C" {
  ***/
 
 #include <string.h>
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_config.h>
 #include <rte_debug.h>
diff --git a/lib/eal/include/rte_class.h b/lib/eal/include/rte_class.h
index d560339652..47b1764e7b 100644
--- a/lib/eal/include/rte_class.h
+++ b/lib/eal/include/rte_class.h
@@ -22,6 +22,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_dev.h>
 
 /** Double linked list of classes */
diff --git a/lib/eal/include/rte_eal_memconfig.h b/lib/eal/include/rte_eal_memconfig.h
index 44f5324906..e175564647 100644
--- a/lib/eal/include/rte_eal_memconfig.h
+++ b/lib/eal/include/rte_eal_memconfig.h
@@ -7,7 +7,6 @@
 
 #include <stdbool.h>
 
-#include <rte_compat.h>
 
 /**
  * @file
diff --git a/lib/eal/include/rte_epoll.h b/lib/eal/include/rte_epoll.h
index 8c73031910..01525f523b 100644
--- a/lib/eal/include/rte_epoll.h
+++ b/lib/eal/include/rte_epoll.h
@@ -13,7 +13,6 @@
 
 #include <stdint.h>
 
-#include <rte_compat.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/lib/eal/include/rte_fbarray.h b/lib/eal/include/rte_fbarray.h
index c64868711e..e33076778f 100644
--- a/lib/eal/include/rte_fbarray.h
+++ b/lib/eal/include/rte_fbarray.h
@@ -36,7 +36,6 @@ extern "C" {
 
 #include <stdio.h>
 
-#include <rte_compat.h>
 #include <rte_rwlock.h>
 
 #define RTE_FBARRAY_NAME_LEN 64
diff --git a/lib/eal/include/rte_lcore.h b/lib/eal/include/rte_lcore.h
index 4d3978512c..6938c3fd7b 100644
--- a/lib/eal/include/rte_lcore.h
+++ b/lib/eal/include/rte_lcore.h
@@ -13,6 +13,7 @@
  */
 #include <stdio.h>
 
+#include <rte_compat.h>
 #include <rte_config.h>
 #include <rte_per_lcore.h>
 #include <rte_eal.h>
diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h
index bba5da3d85..6d2b0856a5 100644
--- a/lib/eal/include/rte_log.h
+++ b/lib/eal/include/rte_log.h
@@ -24,7 +24,6 @@ extern "C" {
 
 #include <rte_common.h>
 #include <rte_config.h>
-#include <rte_compat.h>
 
 /* SDK log type */
 #define RTE_LOGTYPE_EAL        0 /**< Log related to eal. */
diff --git a/lib/eal/include/rte_malloc.h b/lib/eal/include/rte_malloc.h
index 748dfa8697..54a8ac211e 100644
--- a/lib/eal/include/rte_malloc.h
+++ b/lib/eal/include/rte_malloc.h
@@ -13,7 +13,6 @@
 
 #include <stdio.h>
 #include <stddef.h>
-#include <rte_compat.h>
 #include <rte_memory.h>
 
 #ifdef __cplusplus
diff --git a/lib/eal/include/rte_memory.h b/lib/eal/include/rte_memory.h
index 68b069fd04..99a11398b4 100644
--- a/lib/eal/include/rte_memory.h
+++ b/lib/eal/include/rte_memory.h
@@ -21,7 +21,6 @@ extern "C" {
 
 #include <rte_bitops.h>
 #include <rte_common.h>
-#include <rte_compat.h>
 #include <rte_config.h>
 #include <rte_fbarray.h>
 
diff --git a/lib/eal/include/rte_memzone.h b/lib/eal/include/rte_memzone.h
index bb4223a056..5302caa437 100644
--- a/lib/eal/include/rte_memzone.h
+++ b/lib/eal/include/rte_memzone.h
@@ -23,7 +23,6 @@
  */
 
 #include <stdio.h>
-#include <rte_compat.h>
 #include <rte_memory.h>
 #include <rte_common.h>
 
diff --git a/lib/eal/include/rte_pflock.h b/lib/eal/include/rte_pflock.h
index e7bb29b3c5..a3f7291fa1 100644
--- a/lib/eal/include/rte_pflock.h
+++ b/lib/eal/include/rte_pflock.h
@@ -31,6 +31,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_pause.h>
 
diff --git a/lib/eal/include/rte_service.h b/lib/eal/include/rte_service.h
index 90116a773a..a77f33be48 100644
--- a/lib/eal/include/rte_service.h
+++ b/lib/eal/include/rte_service.h
@@ -30,6 +30,7 @@ extern "C" {
 #include<stdio.h>
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_config.h>
 #include <rte_lcore.h>
 
diff --git a/lib/eal/include/rte_service_component.h b/lib/eal/include/rte_service_component.h
index 9be49d698a..a5350c97e5 100644
--- a/lib/eal/include/rte_service_component.h
+++ b/lib/eal/include/rte_service_component.h
@@ -14,7 +14,6 @@
 extern "C" {
 #endif
 
-#include <rte_compat.h>
 #include <rte_service.h>
 
 /**
diff --git a/lib/eal/loongarch/include/rte_prefetch.h b/lib/eal/loongarch/include/rte_prefetch.h
index ac18318fe4..64b1fd2c2a 100644
--- a/lib/eal/loongarch/include/rte_prefetch.h
+++ b/lib/eal/loongarch/include/rte_prefetch.h
@@ -9,6 +9,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include "generic/rte_prefetch.h"
 
diff --git a/lib/eal/ppc/include/rte_atomic.h b/lib/eal/ppc/include/rte_atomic.h
index 86d3f9b2a1..663b4d37b8 100644
--- a/lib/eal/ppc/include/rte_atomic.h
+++ b/lib/eal/ppc/include/rte_atomic.h
@@ -17,7 +17,6 @@ extern "C" {
 #endif
 
 #include <stdint.h>
-#include <rte_compat.h>
 #include "generic/rte_atomic.h"
 
 #define	rte_mb()  asm volatile("sync" : : : "memory")
diff --git a/lib/eal/ppc/include/rte_prefetch.h b/lib/eal/ppc/include/rte_prefetch.h
index 6df8087e41..2e1b5751e0 100644
--- a/lib/eal/ppc/include/rte_prefetch.h
+++ b/lib/eal/ppc/include/rte_prefetch.h
@@ -10,6 +10,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include "generic/rte_prefetch.h"
 
diff --git a/lib/eal/riscv/include/rte_prefetch.h b/lib/eal/riscv/include/rte_prefetch.h
index 966d9e2687..748cf1b626 100644
--- a/lib/eal/riscv/include/rte_prefetch.h
+++ b/lib/eal/riscv/include/rte_prefetch.h
@@ -12,6 +12,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include "generic/rte_prefetch.h"
 
diff --git a/lib/eal/x86/include/rte_io.h b/lib/eal/x86/include/rte_io.h
index 730f958758..0e1fefdee1 100644
--- a/lib/eal/x86/include/rte_io.h
+++ b/lib/eal/x86/include/rte_io.h
@@ -9,6 +9,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include "rte_cpuflags.h"
 
 #define RTE_NATIVE_WRITE32_WC
diff --git a/lib/eal/x86/include/rte_prefetch.h b/lib/eal/x86/include/rte_prefetch.h
index 53404989dd..7fd01c4913 100644
--- a/lib/eal/x86/include/rte_prefetch.h
+++ b/lib/eal/x86/include/rte_prefetch.h
@@ -9,6 +9,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include "generic/rte_prefetch.h"
 
diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h
index 1300acc95d..6a550cfc83 100644
--- a/lib/ethdev/ethdev_driver.h
+++ b/lib/ethdev/ethdev_driver.h
@@ -20,6 +20,7 @@ extern "C" {
  */
 
 #include <dev_driver.h>
+#include <rte_compat.h>
 #include <rte_ethdev.h>
 
 /**
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 8858b56428..b60987db4b 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -17,6 +17,7 @@
 #include <stddef.h>
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_ether.h>
 #include <rte_icmp.h>
diff --git a/lib/ethdev/rte_tm.h b/lib/ethdev/rte_tm.h
index d39e897849..001d13f301 100644
--- a/lib/ethdev/rte_tm.h
+++ b/lib/ethdev/rte_tm.h
@@ -22,6 +22,7 @@
 
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_meter.h>
 
diff --git a/lib/eventdev/eventdev_pmd_pci.h b/lib/eventdev/eventdev_pmd_pci.h
index 7bbec40c71..26aa3a6635 100644
--- a/lib/eventdev/eventdev_pmd_pci.h
+++ b/lib/eventdev/eventdev_pmd_pci.h
@@ -19,6 +19,7 @@ extern "C" {
 
 #include <string.h>
 
+#include <rte_compat.h>
 #include <rte_config.h>
 #include <rte_eal.h>
 #include <rte_lcore.h>
diff --git a/lib/eventdev/eventdev_pmd_vdev.h b/lib/eventdev/eventdev_pmd_vdev.h
index cf2333cf41..5fa9d699ac 100644
--- a/lib/eventdev/eventdev_pmd_vdev.h
+++ b/lib/eventdev/eventdev_pmd_vdev.h
@@ -19,6 +19,7 @@ extern "C" {
 
 #include <string.h>
 
+#include <rte_compat.h>
 #include <rte_config.h>
 #include <rte_debug.h>
 #include <rte_eal.h>
diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h b/lib/eventdev/rte_event_eth_rx_adapter.h
index a9fdeb7b45..d0e7d0092c 100644
--- a/lib/eventdev/rte_event_eth_rx_adapter.h
+++ b/lib/eventdev/rte_event_eth_rx_adapter.h
@@ -87,6 +87,7 @@ extern "C" {
 
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_service.h>
 
 #include "rte_eventdev.h"
diff --git a/lib/eventdev/rte_event_eth_tx_adapter.h b/lib/eventdev/rte_event_eth_tx_adapter.h
index 74ded7b651..645b87b78a 100644
--- a/lib/eventdev/rte_event_eth_tx_adapter.h
+++ b/lib/eventdev/rte_event_eth_tx_adapter.h
@@ -79,6 +79,7 @@ extern "C" {
 
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_mbuf.h>
 
 #include "rte_eventdev.h"
diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
index 82e8976e57..a90e23ac8b 100644
--- a/lib/eventdev/rte_eventdev.h
+++ b/lib/eventdev/rte_eventdev.h
@@ -210,6 +210,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_errno.h>
 #include <rte_mbuf_pool_ops.h>
diff --git a/lib/gpudev/gpudev_driver.h b/lib/gpudev/gpudev_driver.h
index 23972b3dbd..d5e2c8e1ef 100644
--- a/lib/gpudev/gpudev_driver.h
+++ b/lib/gpudev/gpudev_driver.h
@@ -16,6 +16,7 @@
 
 #include <dev_driver.h>
 
+#include <rte_compat.h>
 #include "rte_gpudev.h"
 
 /* Flags indicate current state of device. */
diff --git a/lib/graph/rte_graph_worker.h b/lib/graph/rte_graph_worker.h
index 6dc7461659..fc6fee48c8 100644
--- a/lib/graph/rte_graph_worker.h
+++ b/lib/graph/rte_graph_worker.h
@@ -16,6 +16,7 @@
  * process, enqueue and move streams of objects to the next nodes.
  */
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_cycles.h>
 #include <rte_prefetch.h>
diff --git a/lib/hash/rte_hash.h b/lib/hash/rte_hash.h
index 7fa9702742..a399346d02 100644
--- a/lib/hash/rte_hash.h
+++ b/lib/hash/rte_hash.h
@@ -14,7 +14,6 @@
 #include <stdint.h>
 #include <stddef.h>
 
-#include <rte_compat.h>
 #include <rte_rcu_qsbr.h>
 
 #ifdef __cplusplus
diff --git a/lib/hash/rte_thash.h b/lib/hash/rte_thash.h
index c20ff0244c..7b1d154786 100644
--- a/lib/hash/rte_thash.h
+++ b/lib/hash/rte_thash.h
@@ -20,6 +20,7 @@ extern "C" {
 #endif
 
 #include <stdint.h>
+#include <rte_compat.h>
 #include <rte_byteorder.h>
 #include <rte_ip.h>
 #include <rte_common.h>
diff --git a/lib/hash/rte_thash_gfni.h b/lib/hash/rte_thash_gfni.h
index e97d912d40..ef90faa302 100644
--- a/lib/hash/rte_thash_gfni.h
+++ b/lib/hash/rte_thash_gfni.h
@@ -9,6 +9,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_log.h>
 
 #ifdef RTE_ARCH_X86
diff --git a/lib/hash/rte_thash_x86_gfni.h b/lib/hash/rte_thash_x86_gfni.h
index 657b1862c3..880739b710 100644
--- a/lib/hash/rte_thash_x86_gfni.h
+++ b/lib/hash/rte_thash_x86_gfni.h
@@ -12,6 +12,7 @@
  * using Galois Fields New Instructions.
  */
 
+#include <rte_compat.h>
 #include <rte_vect.h>
 
 #ifdef __cplusplus
diff --git a/lib/ip_frag/rte_ip_frag.h b/lib/ip_frag/rte_ip_frag.h
index 75bb42b262..feab72ae64 100644
--- a/lib/ip_frag/rte_ip_frag.h
+++ b/lib/ip_frag/rte_ip_frag.h
@@ -19,6 +19,7 @@ extern "C" {
 #include <stdint.h>
 #include <stdio.h>
 
+#include <rte_compat.h>
 #include <rte_config.h>
 #include <rte_malloc.h>
 #include <rte_memory.h>
diff --git a/lib/ipsec/rte_ipsec.h b/lib/ipsec/rte_ipsec.h
index 5308f250a7..04129926b6 100644
--- a/lib/ipsec/rte_ipsec.h
+++ b/lib/ipsec/rte_ipsec.h
@@ -14,6 +14,7 @@
  * processing (ESP/AH).
  */
 
+#include <rte_compat.h>
 #include <rte_ipsec_sa.h>
 #include <rte_mbuf.h>
 
diff --git a/lib/ipsec/rte_ipsec_sad.h b/lib/ipsec/rte_ipsec_sad.h
index dbd89901af..0adf89d931 100644
--- a/lib/ipsec/rte_ipsec_sad.h
+++ b/lib/ipsec/rte_ipsec_sad.h
@@ -8,7 +8,6 @@
 
 #include <stdint.h>
 
-#include <rte_compat.h>
 
 /**
  * @file rte_ipsec_sad.h
diff --git a/lib/kni/rte_kni.h b/lib/kni/rte_kni.h
index b85d3dd32b..37d67509a0 100644
--- a/lib/kni/rte_kni.h
+++ b/lib/kni/rte_kni.h
@@ -17,6 +17,7 @@
  * and burst transmit packets to KNI interfaces.
  */
 
+#include <rte_compat.h>
 #include <rte_pci.h>
 #include <rte_ether.h>
 
diff --git a/lib/lpm/rte_lpm.h b/lib/lpm/rte_lpm.h
index 82139c6447..09ad307869 100644
--- a/lib/lpm/rte_lpm.h
+++ b/lib/lpm/rte_lpm.h
@@ -13,6 +13,7 @@
 
 #include <errno.h>
 #include <stdint.h>
+#include <rte_compat.h>
 #include <rte_branch_prediction.h>
 #include <rte_byteorder.h>
 #include <rte_common.h>
diff --git a/lib/lpm/rte_lpm_sve.h b/lib/lpm/rte_lpm_sve.h
index 2e319373e5..94ead70c39 100644
--- a/lib/lpm/rte_lpm_sve.h
+++ b/lib/lpm/rte_lpm_sve.h
@@ -5,6 +5,7 @@
 #ifndef _RTE_LPM_SVE_H_
 #define _RTE_LPM_SVE_H_
 
+#include <rte_compat.h>
 #include <rte_vect.h>
 
 #ifdef __cplusplus
diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h
index b181f2cf9d..a30e1e0eaf 100644
--- a/lib/mbuf/rte_mbuf_core.h
+++ b/lib/mbuf/rte_mbuf_core.h
@@ -18,7 +18,6 @@
 
 #include <stdint.h>
 
-#include <rte_compat.h>
 #include <rte_byteorder.h>
 
 #ifdef __cplusplus
diff --git a/lib/member/rte_member.h b/lib/member/rte_member.h
index 178efeed33..072a253c89 100644
--- a/lib/member/rte_member.h
+++ b/lib/member/rte_member.h
@@ -65,6 +65,7 @@ extern "C" {
 #include <stdbool.h>
 #include <inttypes.h>
 
+#include <rte_compat.h>
 #include <rte_common.h>
 
 /** The set ID type that stored internally in hash table based set summary. */
diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h
index 3725a72951..3142efc484 100644
--- a/lib/mempool/rte_mempool.h
+++ b/lib/mempool/rte_mempool.h
@@ -37,6 +37,7 @@
 #include <stdint.h>
 #include <inttypes.h>
 
+#include <rte_compat.h>
 #include <rte_config.h>
 #include <rte_spinlock.h>
 #include <rte_debug.h>
diff --git a/lib/meter/rte_meter.h b/lib/meter/rte_meter.h
index 62c8c1ecc2..0932645d0a 100644
--- a/lib/meter/rte_meter.h
+++ b/lib/meter/rte_meter.h
@@ -23,7 +23,6 @@ extern "C" {
 
 #include <stdint.h>
 
-#include "rte_compat.h"
 
 /*
  * Application Programmer's Interface (API)
diff --git a/lib/metrics/rte_metrics.h b/lib/metrics/rte_metrics.h
index 5c33af9999..5e17873dd7 100644
--- a/lib/metrics/rte_metrics.h
+++ b/lib/metrics/rte_metrics.h
@@ -24,7 +24,6 @@
 #define _RTE_METRICS_H_
 
 #include <stdint.h>
-#include <rte_compat.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/lib/metrics/rte_metrics_telemetry.h b/lib/metrics/rte_metrics_telemetry.h
index 09b14d9336..dd84f5431e 100644
--- a/lib/metrics/rte_metrics_telemetry.h
+++ b/lib/metrics/rte_metrics_telemetry.h
@@ -8,6 +8,7 @@
 #define json_t void *
 #endif
 
+#include <rte_compat.h>
 #include "rte_metrics.h"
 
 #ifndef _RTE_METRICS_TELEMETRY_H_
diff --git a/lib/net/rte_ip.h b/lib/net/rte_ip.h
index ecd250e9be..9c8e8206f0 100644
--- a/lib/net/rte_ip.h
+++ b/lib/net/rte_ip.h
@@ -28,6 +28,7 @@
 #include <netinet/ip6.h>
 #endif
 
+#include <rte_compat.h>
 #include <rte_byteorder.h>
 #include <rte_mbuf.h>
 
diff --git a/lib/node/rte_node_eth_api.h b/lib/node/rte_node_eth_api.h
index 4e28f86d77..1e7477349c 100644
--- a/lib/node/rte_node_eth_api.h
+++ b/lib/node/rte_node_eth_api.h
@@ -21,6 +21,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_mempool.h>
 
diff --git a/lib/pdump/rte_pdump.h b/lib/pdump/rte_pdump.h
index 41c4b7800b..b1a391830c 100644
--- a/lib/pdump/rte_pdump.h
+++ b/lib/pdump/rte_pdump.h
@@ -13,6 +13,7 @@
  */
 
 #include <stdint.h>
+#include <rte_compat.h>
 #include <rte_bpf.h>
 
 #ifdef __cplusplus
diff --git a/lib/power/rte_power.h b/lib/power/rte_power.h
index 47345e26df..f122dab02b 100644
--- a/lib/power/rte_power.h
+++ b/lib/power/rte_power.h
@@ -10,6 +10,7 @@
  * RTE Power Management
  */
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_log.h>
 #include <rte_power_guest_channel.h>
diff --git a/lib/power/rte_power_empty_poll.h b/lib/power/rte_power_empty_poll.h
index f6306fdcdf..b9819337e6 100644
--- a/lib/power/rte_power_empty_poll.h
+++ b/lib/power/rte_power_empty_poll.h
@@ -12,6 +12,7 @@
 #include <stdint.h>
 #include <stdbool.h>
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_string_fns.h>
 #include <rte_timer.h>
diff --git a/lib/power/rte_power_intel_uncore.h b/lib/power/rte_power_intel_uncore.h
index bcad5e5535..0bd9f193a1 100644
--- a/lib/power/rte_power_intel_uncore.h
+++ b/lib/power/rte_power_intel_uncore.h
@@ -10,6 +10,7 @@
  * RTE Intel Uncore Frequency Management
  */
 
+#include <rte_compat.h>
 #include "rte_power.h"
 
 #ifdef __cplusplus
diff --git a/lib/power/rte_power_pmd_mgmt.h b/lib/power/rte_power_pmd_mgmt.h
index 7ae6ef2d32..0f1a2eb22e 100644
--- a/lib/power/rte_power_pmd_mgmt.h
+++ b/lib/power/rte_power_pmd_mgmt.h
@@ -12,6 +12,7 @@
 
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_log.h>
 #include <rte_power.h>
 
diff --git a/lib/rcu/rte_rcu_qsbr.h b/lib/rcu/rte_rcu_qsbr.h
index 36571c15df..ccae5d54f7 100644
--- a/lib/rcu/rte_rcu_qsbr.h
+++ b/lib/rcu/rte_rcu_qsbr.h
@@ -33,6 +33,7 @@ extern "C" {
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdint.h>
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_atomic.h>
diff --git a/lib/regexdev/rte_regexdev.h b/lib/regexdev/rte_regexdev.h
index 9473c6bb4c..25476f1f73 100644
--- a/lib/regexdev/rte_regexdev.h
+++ b/lib/regexdev/rte_regexdev.h
@@ -198,6 +198,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_dev.h>
 #include <rte_mbuf.h>
diff --git a/lib/regexdev/rte_regexdev_driver.h b/lib/regexdev/rte_regexdev_driver.h
index 6246b144a6..1fcd156556 100644
--- a/lib/regexdev/rte_regexdev_driver.h
+++ b/lib/regexdev/rte_regexdev_driver.h
@@ -14,6 +14,7 @@
  * RegEx lib.
  */
 
+#include <rte_compat.h>
 #include "rte_regexdev.h"
 
 #ifdef __cplusplus
diff --git a/lib/reorder/rte_reorder.h b/lib/reorder/rte_reorder.h
index 4f9f71af75..5abdb258e2 100644
--- a/lib/reorder/rte_reorder.h
+++ b/lib/reorder/rte_reorder.h
@@ -15,6 +15,7 @@
  *
  */
 
+#include <rte_compat.h>
 #include <rte_mbuf.h>
 #include <rte_mbuf_dyn.h>
 
diff --git a/lib/sched/rte_pie.h b/lib/sched/rte_pie.h
index 528f2ea878..2236b98a71 100644
--- a/lib/sched/rte_pie.h
+++ b/lib/sched/rte_pie.h
@@ -16,6 +16,7 @@ extern "C" {
 
 #include <stdint.h>
 
+#include <rte_compat.h>
 #include <rte_random.h>
 #include <rte_debug.h>
 #include <rte_cycles.h>
diff --git a/lib/security/rte_security_driver.h b/lib/security/rte_security_driver.h
index 9a767226bd..421e6f7780 100644
--- a/lib/security/rte_security_driver.h
+++ b/lib/security/rte_security_driver.h
@@ -17,6 +17,7 @@
 extern "C" {
 #endif
 
+#include <rte_compat.h>
 #include "rte_security.h"
 
 /**
diff --git a/lib/telemetry/rte_telemetry.h b/lib/telemetry/rte_telemetry.h
index a0d21d6b7f..d9918c4e96 100644
--- a/lib/telemetry/rte_telemetry.h
+++ b/lib/telemetry/rte_telemetry.h
@@ -4,7 +4,6 @@
 
 #include <stdint.h>
 
-#include <rte_compat.h>
 
 #ifndef _RTE_TELEMETRY_H_
 #define _RTE_TELEMETRY_H_
diff --git a/lib/timer/rte_timer.h b/lib/timer/rte_timer.h
index 503438a36b..c8710c4dc9 100644
--- a/lib/timer/rte_timer.h
+++ b/lib/timer/rte_timer.h
@@ -36,6 +36,7 @@
 
 #include <stdio.h>
 #include <stdint.h>
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_spinlock.h>
 
diff --git a/lib/vhost/rte_vhost.h b/lib/vhost/rte_vhost.h
index f9d1ed3432..a395843fe9 100644
--- a/lib/vhost/rte_vhost.h
+++ b/lib/vhost/rte_vhost.h
@@ -14,6 +14,7 @@
 #include <stdint.h>
 #include <sys/eventfd.h>
 
+#include <rte_compat.h>
 #include <rte_memory.h>
 #include <rte_mempool.h>
 
-- 
2.37.3


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

* Re: [PATCH v2] cleanup compat header inclusions
  2022-11-03 14:00 ` [PATCH v2] " David Marchand
@ 2022-11-06  8:36   ` Andrew Rybchenko
  2022-11-15  8:16     ` David Marchand
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Rybchenko @ 2022-11-06  8:36 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: thomas, gakhil, ferruh.yigit, jerinj, bruce.richardson

On 11/3/22 17:00, David Marchand wrote:
> With symbols going though experimental/stable stages, we accumulated
> a lot of discrepancies about inclusion of the rte_compat.h header.
> 
> Some headers are including it where unneeded, while others rely on
> implicit inclusion.
> 
> Fix unneeded inclusions:
> $ git grep -l include..rte_compat.h |
>    xargs grep -LE '__rte_(internal|experimental)' |
>    xargs sed -i -e '/#include..rte_compat.h/d'
> 
> Fix missing inclusion, by inserting rte_compat.h before the first
> inclusion of a DPDK header:
> $ git grep -lE '__rte_(internal|experimental)' |
>    xargs grep -L include..rte_compat.h |
>    xargs sed -i -e \
>      '0,/#include..\(rte_\|.*pmd.h.$\)/{
>        s/\(#include..\(rte_\|.*pmd.h.$\)\)/#include <rte_compat.h>\n\1/
>      }'
> 
> Fix missing inclusion, by inserting rte_compat.h after the last
> inclusion of a non DPDK header:
> $ for file in $(git grep -lE '__rte_(internal|experimental)' |
>    xargs grep -L include..rte_compat.h); do
>      tac $file > $file.$$
>      sed -i -e \
>        '0,/#include../{
>          s/\(#include..*$\)/#include <rte_compat.h>\n\n\1/
>        }' $file.$$
>      tac $file.$$ > $file
>      rm $file.$$
>    done
> 
> Fix missing inclusion, by inserting rte_compat.h after the header guard:
> $ git grep -lE '__rte_(internal|experimental)' |
>    xargs grep -L include..rte_compat.h |
>    xargs sed -i -e \
>      '0,/#define/{
>        s/\(#define .*$\)/\1\n\n#include <rte_compat.h>/
>      }'
> 
> And finally, exclude rte_compat.h itself.
> $ git checkout lib/eal/include/rte_compat.h
> 
> At the end of all this, we have a clean tree:
> $ git grep -lE '__rte_(internal|experimental)' |
>    xargs grep -L include..rte_compat.h
> buildtools/check-symbols.sh
> devtools/checkpatches.sh
> doc/guides/contributing/abi_policy.rst
> doc/guides/rel_notes/release_20_11.rst
> lib/eal/include/rte_compat.h
> 
> 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>



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

* Re: [PATCH v2] cleanup compat header inclusions
  2022-11-06  8:36   ` Andrew Rybchenko
@ 2022-11-15  8:16     ` David Marchand
  0 siblings, 0 replies; 6+ messages in thread
From: David Marchand @ 2022-11-15  8:16 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, thomas, gakhil, ferruh.yigit, jerinj, bruce.richardson,
	Andrew Rybchenko

On Sun, Nov 6, 2022 at 9:36 AM Andrew Rybchenko
<andrew.rybchenko@oktetlabs.ru> wrote:
> On 11/3/22 17:00, David Marchand wrote:
> > With symbols going though experimental/stable stages, we accumulated
> > a lot of discrepancies about inclusion of the rte_compat.h header.
> >
> > Some headers are including it where unneeded, while others rely on
> > implicit inclusion.
> >
> > Fix unneeded inclusions:
> > $ git grep -l include..rte_compat.h |
> >    xargs grep -LE '__rte_(internal|experimental)' |
> >    xargs sed -i -e '/#include..rte_compat.h/d'
> >
> > Fix missing inclusion, by inserting rte_compat.h before the first
> > inclusion of a DPDK header:
> > $ git grep -lE '__rte_(internal|experimental)' |
> >    xargs grep -L include..rte_compat.h |
> >    xargs sed -i -e \
> >      '0,/#include..\(rte_\|.*pmd.h.$\)/{
> >        s/\(#include..\(rte_\|.*pmd.h.$\)\)/#include <rte_compat.h>\n\1/
> >      }'
> >
> > Fix missing inclusion, by inserting rte_compat.h after the last
> > inclusion of a non DPDK header:
> > $ for file in $(git grep -lE '__rte_(internal|experimental)' |
> >    xargs grep -L include..rte_compat.h); do
> >      tac $file > $file.$$
> >      sed -i -e \
> >        '0,/#include../{
> >          s/\(#include..*$\)/#include <rte_compat.h>\n\n\1/
> >        }' $file.$$
> >      tac $file.$$ > $file
> >      rm $file.$$
> >    done
> >
> > Fix missing inclusion, by inserting rte_compat.h after the header guard:
> > $ git grep -lE '__rte_(internal|experimental)' |
> >    xargs grep -L include..rte_compat.h |
> >    xargs sed -i -e \
> >      '0,/#define/{
> >        s/\(#define .*$\)/\1\n\n#include <rte_compat.h>/
> >      }'
> >
> > And finally, exclude rte_compat.h itself.
> > $ git checkout lib/eal/include/rte_compat.h
> >
> > At the end of all this, we have a clean tree:
> > $ git grep -lE '__rte_(internal|experimental)' |
> >    xargs grep -L include..rte_compat.h
> > buildtools/check-symbols.sh
> > devtools/checkpatches.sh
> > doc/guides/contributing/abi_policy.rst
> > doc/guides/rel_notes/release_20_11.rst
> > lib/eal/include/rte_compat.h
> >
> > 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>

Applied, thanks.


-- 
David Marchand


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

end of thread, other threads:[~2022-11-15  8:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02 15:08 [PATCH] cleanup compat header inclusions David Marchand
2022-11-02 16:08 ` Bruce Richardson
2022-11-02 16:33 ` David Marchand
2022-11-03 14:00 ` [PATCH v2] " David Marchand
2022-11-06  8:36   ` Andrew Rybchenko
2022-11-15  8:16     ` 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).