From: Adrien Mazarguil Date: Thu, 21 Dec 2017 13:00:04 +0000 (+0100) Subject: lib: fix missing includes in exported headers X-Git-Tag: spdx-start~261 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0d440d081ca1b5cccbb3b991908842c70731e460;p=dpdk.git lib: fix missing includes in exported headers Many exported headers rely on definitions found in rte_config.h without including it, as shown by the following command: grep -L '^#include ' -- \ $(grep -Rl \ $(sed -n '/^#define \([^ ]\+\).*$/{s//\1/;H;};${x;s/\n//;s/\n/\\|/g;p;}' \ build/include/rte_config.h) \ -- build/include/) We cannot assume external applications will include rte_config.h on their own, neither directly nor through a -include parameter like DPDK does internally. This not only causes obvious compilation failures that can be reproduced with check-includes.sh such as: [...]/rte_memory.h:88:43: error: ‘RTE_CACHE_LINE_SIZE’ was not declared in this scope #define __rte_cache_aligned __rte_aligned(RTE_CACHE_LINE_SIZE) ^ It also results in less visible issues, for instance rte_hash_crc.h relying on RTE_ARCH_X86_64's presence to provide dedicated inline functions. This patch partially reverts the commit below and adds missing include lines to the remaining files. Fixes: f1a7a5c5f404 ("remove include of generated config header") Cc: stable@dpdk.org Signed-off-by: Adrien Mazarguil Acked-by: Thomas Monjalon --- diff --git a/drivers/net/avp/rte_avp_common.h b/drivers/net/avp/rte_avp_common.h index 54437e9a11..81dfe5ea6a 100644 --- a/drivers/net/avp/rte_avp_common.h +++ b/drivers/net/avp/rte_avp_common.h @@ -63,6 +63,7 @@ #else #include #include +#include #include #include #include diff --git a/lib/librte_cmdline/cmdline_cirbuf.h b/lib/librte_cmdline/cmdline_cirbuf.h index 6321dec5c3..87407efa14 100644 --- a/lib/librte_cmdline/cmdline_cirbuf.h +++ b/lib/librte_cmdline/cmdline_cirbuf.h @@ -61,6 +61,8 @@ #ifndef _CIRBUF_H_ #define _CIRBUF_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h index dade5548f5..ed92f9822e 100644 --- a/lib/librte_cryptodev/rte_cryptodev.h +++ b/lib/librte_cryptodev/rte_cryptodev.h @@ -49,6 +49,7 @@ extern "C" { #include "rte_crypto.h" #include "rte_dev.h" #include +#include extern const char **rte_cyptodev_names; diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.h b/lib/librte_cryptodev/rte_cryptodev_pmd.h index 744405e2f5..c3bf91c3cf 100644 --- a/lib/librte_cryptodev/rte_cryptodev_pmd.h +++ b/lib/librte_cryptodev/rte_cryptodev_pmd.h @@ -46,6 +46,7 @@ extern "C" { #include +#include #include #include #include diff --git a/lib/librte_eal/common/include/arch/x86/rte_atomic.h b/lib/librte_eal/common/include/arch/x86/rte_atomic.h index 8469f97e19..36cfabc38f 100644 --- a/lib/librte_eal/common/include/arch/x86/rte_atomic.h +++ b/lib/librte_eal/common/include/arch/x86/rte_atomic.h @@ -11,6 +11,7 @@ extern "C" { #include #include +#include #include #include "generic/rte_atomic.h" diff --git a/lib/librte_eal/common/include/arch/x86/rte_byteorder.h b/lib/librte_eal/common/include/arch/x86/rte_byteorder.h index 56b0a31e23..a2dfecc1f5 100644 --- a/lib/librte_eal/common/include/arch/x86/rte_byteorder.h +++ b/lib/librte_eal/common/include/arch/x86/rte_byteorder.h @@ -11,6 +11,7 @@ extern "C" { #include #include +#include #include "generic/rte_byteorder.h" #ifndef RTE_BYTE_ORDER diff --git a/lib/librte_eal/common/include/arch/x86/rte_cycles.h b/lib/librte_eal/common/include/arch/x86/rte_cycles.h index 1bb3e1dbe7..b95beced9a 100644 --- a/lib/librte_eal/common/include/arch/x86/rte_cycles.h +++ b/lib/librte_eal/common/include/arch/x86/rte_cycles.h @@ -47,6 +47,7 @@ extern int rte_cycles_vmware_tsc_map; #include #endif #include +#include static inline uint64_t rte_rdtsc(void) diff --git a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h index c166fb00c0..cc140ecca9 100644 --- a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h +++ b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h @@ -16,6 +16,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/lib/librte_eal/common/include/arch/x86/rte_vect.h b/lib/librte_eal/common/include/arch/x86/rte_vect.h index a7d531d1a4..cf4e9db383 100644 --- a/lib/librte_eal/common/include/arch/x86/rte_vect.h +++ b/lib/librte_eal/common/include/arch/x86/rte_vect.h @@ -12,6 +12,7 @@ */ #include +#include #include "generic/rte_vect.h" #if (defined(__ICC) || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)) diff --git a/lib/librte_eal/common/include/generic/rte_byteorder.h b/lib/librte_eal/common/include/generic/rte_byteorder.h index f3167636c5..9bed85cca1 100644 --- a/lib/librte_eal/common/include/generic/rte_byteorder.h +++ b/lib/librte_eal/common/include/generic/rte_byteorder.h @@ -22,6 +22,7 @@ #endif #include +#include /* * Compile-time endianness detection diff --git a/lib/librte_eal/common/include/rte_bitmap.h b/lib/librte_eal/common/include/rte_bitmap.h index 9425aceb60..7d4935fcca 100644 --- a/lib/librte_eal/common/include/rte_bitmap.h +++ b/lib/librte_eal/common/include/rte_bitmap.h @@ -37,6 +37,7 @@ extern "C" { #include #include +#include #include #include #include diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h index 9b9294edb0..c7803e41c1 100644 --- a/lib/librte_eal/common/include/rte_common.h +++ b/lib/librte_eal/common/include/rte_common.h @@ -22,6 +22,8 @@ extern "C" { #include #include +#include + #ifndef typeof #define typeof __typeof__ #endif diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h index 9342e0cbd2..8088dcc538 100644 --- a/lib/librte_eal/common/include/rte_dev.h +++ b/lib/librte_eal/common/include/rte_dev.h @@ -49,6 +49,7 @@ extern "C" { #include #include +#include #include __attribute__((format(printf, 2, 0))) diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h index 02fa109680..2aba2c8bd4 100644 --- a/lib/librte_eal/common/include/rte_eal.h +++ b/lib/librte_eal/common/include/rte_eal.h @@ -14,6 +14,7 @@ #include #include +#include #include #include diff --git a/lib/librte_eal/common/include/rte_eal_memconfig.h b/lib/librte_eal/common/include/rte_eal_memconfig.h index e195b27426..29fa0b60d5 100644 --- a/lib/librte_eal/common/include/rte_eal_memconfig.h +++ b/lib/librte_eal/common/include/rte_eal_memconfig.h @@ -5,6 +5,7 @@ #ifndef _RTE_EAL_MEMCONFIG_H_ #define _RTE_EAL_MEMCONFIG_H_ +#include #include #include #include diff --git a/lib/librte_eal/common/include/rte_keepalive.h b/lib/librte_eal/common/include/rte_keepalive.h index 88ad8e487a..e9f8f083a1 100644 --- a/lib/librte_eal/common/include/rte_keepalive.h +++ b/lib/librte_eal/common/include/rte_keepalive.h @@ -39,6 +39,7 @@ #ifndef _KEEPALIVE_H_ #define _KEEPALIVE_H_ +#include #include #ifndef RTE_KEEPALIVE_MAXCORES diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h index 223658baea..d84bcffba8 100644 --- a/lib/librte_eal/common/include/rte_lcore.h +++ b/lib/librte_eal/common/include/rte_lcore.h @@ -11,6 +11,7 @@ * API for lcore and socket manipulation * */ +#include #include #include #include diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h index 83faddf703..9029c7856d 100644 --- a/lib/librte_eal/common/include/rte_log.h +++ b/lib/librte_eal/common/include/rte_log.h @@ -22,6 +22,7 @@ extern "C" { #include #include +#include struct rte_log_dynamic_type; diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h index ed5a3be8af..302f865b14 100644 --- a/lib/librte_eal/common/include/rte_memory.h +++ b/lib/librte_eal/common/include/rte_memory.h @@ -20,6 +20,7 @@ extern "C" { #endif #include +#include __extension__ enum rte_page_sizes { diff --git a/lib/librte_eal/common/include/rte_service.h b/lib/librte_eal/common/include/rte_service.h index 85e964b055..02b1512f64 100644 --- a/lib/librte_eal/common/include/rte_service.h +++ b/lib/librte_eal/common/include/rte_service.h @@ -31,6 +31,7 @@ extern "C" { #include #include +#include #include #define RTE_SERVICE_NAME_MAX 32 diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h index 9e7b5ea495..61ace6f26d 100644 --- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h +++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h @@ -11,6 +11,7 @@ #define RTE_STD_C11 #else #include +#include #endif /** diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index f0eeefe6a3..a5ba564129 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -152,6 +152,7 @@ extern "C" { #include #include #include +#include #include "rte_ether.h" #include "rte_eth_ctrl.h" diff --git a/lib/librte_ether/rte_ethdev_pci.h b/lib/librte_ether/rte_ethdev_pci.h index 722075e096..ad64a169c7 100644 --- a/lib/librte_ether/rte_ethdev_pci.h +++ b/lib/librte_ether/rte_ethdev_pci.h @@ -37,6 +37,7 @@ #include #include #include +#include #include /** diff --git a/lib/librte_ether/rte_ethdev_vdev.h b/lib/librte_ether/rte_ethdev_vdev.h index ff92e6ed0e..feb5a3eb09 100644 --- a/lib/librte_ether/rte_ethdev_vdev.h +++ b/lib/librte_ether/rte_ethdev_vdev.h @@ -34,6 +34,7 @@ #ifndef _RTE_ETHDEV_VDEV_H_ #define _RTE_ETHDEV_VDEV_H_ +#include #include #include #include diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h index f1949ff7d8..9134b49848 100644 --- a/lib/librte_eventdev/rte_eventdev.h +++ b/lib/librte_eventdev/rte_eventdev.h @@ -239,6 +239,7 @@ extern "C" { #endif #include +#include #include #include diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h index c2fd09c02f..b485a57d0e 100644 --- a/lib/librte_eventdev/rte_eventdev_pmd.h +++ b/lib/librte_eventdev/rte_eventdev_pmd.h @@ -20,6 +20,7 @@ extern "C" { #include #include +#include #include #include #include diff --git a/lib/librte_eventdev/rte_eventdev_pmd_pci.h b/lib/librte_eventdev/rte_eventdev_pmd_pci.h index 32a077e3c9..8fb61386fd 100644 --- a/lib/librte_eventdev/rte_eventdev_pmd_pci.h +++ b/lib/librte_eventdev/rte_eventdev_pmd_pci.h @@ -20,6 +20,7 @@ extern "C" { #include +#include #include #include #include diff --git a/lib/librte_eventdev/rte_eventdev_pmd_vdev.h b/lib/librte_eventdev/rte_eventdev_pmd_vdev.h index e1e1cd966c..8c64a06743 100644 --- a/lib/librte_eventdev/rte_eventdev_pmd_vdev.h +++ b/lib/librte_eventdev/rte_eventdev_pmd_vdev.h @@ -19,6 +19,7 @@ extern "C" { #include +#include #include #include #include diff --git a/lib/librte_hash/rte_fbk_hash.h b/lib/librte_hash/rte_fbk_hash.h index ad472802b3..09158781b4 100644 --- a/lib/librte_hash/rte_fbk_hash.h +++ b/lib/librte_hash/rte_fbk_hash.h @@ -25,6 +25,7 @@ extern "C" { #include +#include #ifndef RTE_FBK_HASH_FUNC_DEFAULT #if defined(RTE_ARCH_X86) || defined(RTE_MACHINE_CPUFLAG_CRC32) #include diff --git a/lib/librte_hash/rte_hash_crc.h b/lib/librte_hash/rte_hash_crc.h index e61d57da01..479f84b149 100644 --- a/lib/librte_hash/rte_hash_crc.h +++ b/lib/librte_hash/rte_hash_crc.h @@ -16,6 +16,7 @@ extern "C" { #endif #include +#include #include #include #include diff --git a/lib/librte_hash/rte_jhash.h b/lib/librte_hash/rte_jhash.h index 3eca13858b..42c45685be 100644 --- a/lib/librte_hash/rte_jhash.h +++ b/lib/librte_hash/rte_jhash.h @@ -48,6 +48,7 @@ extern "C" { #include #include +#include #include #include diff --git a/lib/librte_hash/rte_thash.h b/lib/librte_hash/rte_thash.h index 4fa5e07a5e..a6ddb7bf7f 100644 --- a/lib/librte_hash/rte_thash.h +++ b/lib/librte_hash/rte_thash.h @@ -53,6 +53,7 @@ extern "C" { #include #include +#include #include #include diff --git a/lib/librte_ip_frag/rte_ip_frag.h b/lib/librte_ip_frag/rte_ip_frag.h index b24badee9f..b3f3f78df9 100644 --- a/lib/librte_ip_frag/rte_ip_frag.h +++ b/lib/librte_ip_frag/rte_ip_frag.h @@ -19,6 +19,7 @@ extern "C" { #include #include +#include #include #include #include diff --git a/lib/librte_lpm/rte_lpm.h b/lib/librte_lpm/rte_lpm.h index 12c22a6402..21550444d1 100644 --- a/lib/librte_lpm/rte_lpm.h +++ b/lib/librte_lpm/rte_lpm.h @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 6cba632b97..a827e6e2ff 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -62,6 +62,7 @@ #include #include +#include #include #include #include diff --git a/lib/librte_member/rte_member.h b/lib/librte_member/rte_member.h index b7787678f5..ab2b232170 100644 --- a/lib/librte_member/rte_member.h +++ b/lib/librte_member/rte_member.h @@ -52,6 +52,7 @@ extern "C" { #include #include +#include /** The set ID type that stored internally in hash table based set summary. */ typedef uint16_t member_set_t; diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h index 721227f6da..e21026aa77 100644 --- a/lib/librte_mempool/rte_mempool.h +++ b/lib/librte_mempool/rte_mempool.h @@ -69,6 +69,7 @@ #include #include +#include #include #include #include diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h index e92443813b..7069d52e29 100644 --- a/lib/librte_ring/rte_ring.h +++ b/lib/librte_ring/rte_ring.h @@ -96,6 +96,7 @@ extern "C" { #include #include #include +#include #include #include #include diff --git a/lib/librte_table/rte_lru.h b/lib/librte_table/rte_lru.h index 7c45e682c2..88229d8632 100644 --- a/lib/librte_table/rte_lru.h +++ b/lib/librte_table/rte_lru.h @@ -9,6 +9,7 @@ extern "C" { #endif +#include #ifdef RTE_ARCH_X86_64 #include "rte_lru_x86.h" #elif defined(RTE_ARCH_ARM64) diff --git a/lib/librte_table/rte_lru_x86.h b/lib/librte_table/rte_lru_x86.h index 372a09fb20..7a67ee8bd5 100644 --- a/lib/librte_table/rte_lru_x86.h +++ b/lib/librte_table/rte_lru_x86.h @@ -11,6 +11,8 @@ extern "C" { #include +#include + #ifndef RTE_TABLE_HASH_LRU_STRATEGY #define RTE_TABLE_HASH_LRU_STRATEGY 2 #endif diff --git a/lib/librte_timer/rte_timer.h b/lib/librte_timer/rte_timer.h index 7d3998b797..9b95cd2c98 100644 --- a/lib/librte_timer/rte_timer.h +++ b/lib/librte_timer/rte_timer.h @@ -38,6 +38,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" {