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 <rte_config.h>' -- \
$(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: f1a7a5c5f4
("remove include of generated config header")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
This commit is contained in:
parent
34c709f9b2
commit
0d440d081c
|
@ -63,6 +63,7 @@
|
|||
#else
|
||||
#include <stdint.h>
|
||||
#include <rte_common.h>
|
||||
#include <rte_config.h>
|
||||
#include <rte_memory.h>
|
||||
#include <rte_ether.h>
|
||||
#include <rte_atomic.h>
|
||||
|
|
|
@ -61,6 +61,8 @@
|
|||
#ifndef _CIRBUF_H_
|
||||
#define _CIRBUF_H_
|
||||
|
||||
#include <rte_config.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
|
@ -49,6 +49,7 @@ extern "C" {
|
|||
#include "rte_crypto.h"
|
||||
#include "rte_dev.h"
|
||||
#include <rte_common.h>
|
||||
#include <rte_config.h>
|
||||
|
||||
extern const char **rte_cyptodev_names;
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ extern "C" {
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include <rte_config.h>
|
||||
#include <rte_dev.h>
|
||||
#include <rte_malloc.h>
|
||||
#include <rte_mbuf.h>
|
||||
|
|
|
@ -11,6 +11,7 @@ extern "C" {
|
|||
|
||||
#include <stdint.h>
|
||||
#include <rte_common.h>
|
||||
#include <rte_config.h>
|
||||
#include <emmintrin.h>
|
||||
#include "generic/rte_atomic.h"
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ extern "C" {
|
|||
|
||||
#include <stdint.h>
|
||||
#include <rte_common.h>
|
||||
#include <rte_config.h>
|
||||
#include "generic/rte_byteorder.h"
|
||||
|
||||
#ifndef RTE_BYTE_ORDER
|
||||
|
|
|
@ -47,6 +47,7 @@ extern int rte_cycles_vmware_tsc_map;
|
|||
#include <rte_branch_prediction.h>
|
||||
#endif
|
||||
#include <rte_common.h>
|
||||
#include <rte_config.h>
|
||||
|
||||
static inline uint64_t
|
||||
rte_rdtsc(void)
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <string.h>
|
||||
#include <rte_vect.h>
|
||||
#include <rte_common.h>
|
||||
#include <rte_config.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <rte_config.h>
|
||||
#include "generic/rte_vect.h"
|
||||
|
||||
#if (defined(__ICC) || (__GNUC__ == 4 && __GNUC_MINOR__ < 4))
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#endif
|
||||
|
||||
#include <rte_common.h>
|
||||
#include <rte_config.h>
|
||||
|
||||
/*
|
||||
* Compile-time endianness detection
|
||||
|
|
|
@ -37,6 +37,7 @@ extern "C" {
|
|||
|
||||
#include <string.h>
|
||||
#include <rte_common.h>
|
||||
#include <rte_config.h>
|
||||
#include <rte_debug.h>
|
||||
#include <rte_memory.h>
|
||||
#include <rte_branch_prediction.h>
|
||||
|
|
|
@ -22,6 +22,8 @@ extern "C" {
|
|||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include <rte_config.h>
|
||||
|
||||
#ifndef typeof
|
||||
#define typeof __typeof__
|
||||
#endif
|
||||
|
|
|
@ -49,6 +49,7 @@ extern "C" {
|
|||
#include <stdio.h>
|
||||
#include <sys/queue.h>
|
||||
|
||||
#include <rte_config.h>
|
||||
#include <rte_log.h>
|
||||
|
||||
__attribute__((format(printf, 2, 0)))
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include <stdint.h>
|
||||
#include <sched.h>
|
||||
|
||||
#include <rte_config.h>
|
||||
#include <rte_per_lcore.h>
|
||||
#include <rte_bus.h>
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#ifndef _RTE_EAL_MEMCONFIG_H_
|
||||
#define _RTE_EAL_MEMCONFIG_H_
|
||||
|
||||
#include <rte_config.h>
|
||||
#include <rte_tailq.h>
|
||||
#include <rte_memory.h>
|
||||
#include <rte_memzone.h>
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#ifndef _KEEPALIVE_H_
|
||||
#define _KEEPALIVE_H_
|
||||
|
||||
#include <rte_config.h>
|
||||
#include <rte_memory.h>
|
||||
|
||||
#ifndef RTE_KEEPALIVE_MAXCORES
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
* API for lcore and socket manipulation
|
||||
*
|
||||
*/
|
||||
#include <rte_config.h>
|
||||
#include <rte_per_lcore.h>
|
||||
#include <rte_eal.h>
|
||||
#include <rte_launch.h>
|
||||
|
|
|
@ -22,6 +22,7 @@ extern "C" {
|
|||
#include <stdarg.h>
|
||||
|
||||
#include <rte_common.h>
|
||||
#include <rte_config.h>
|
||||
|
||||
struct rte_log_dynamic_type;
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#include <rte_common.h>
|
||||
#include <rte_config.h>
|
||||
|
||||
__extension__
|
||||
enum rte_page_sizes {
|
||||
|
|
|
@ -31,6 +31,7 @@ extern "C" {
|
|||
#include <stdint.h>
|
||||
#include <sys/queue.h>
|
||||
|
||||
#include <rte_config.h>
|
||||
#include <rte_lcore.h>
|
||||
|
||||
#define RTE_SERVICE_NAME_MAX 32
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#define RTE_STD_C11
|
||||
#else
|
||||
#include <rte_common.h>
|
||||
#include <rte_config.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
@ -152,6 +152,7 @@ extern "C" {
|
|||
#include <rte_devargs.h>
|
||||
#include <rte_errno.h>
|
||||
#include <rte_common.h>
|
||||
#include <rte_config.h>
|
||||
|
||||
#include "rte_ether.h"
|
||||
#include "rte_eth_ctrl.h"
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include <rte_malloc.h>
|
||||
#include <rte_pci.h>
|
||||
#include <rte_bus_pci.h>
|
||||
#include <rte_config.h>
|
||||
#include <rte_ethdev.h>
|
||||
|
||||
/**
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#ifndef _RTE_ETHDEV_VDEV_H_
|
||||
#define _RTE_ETHDEV_VDEV_H_
|
||||
|
||||
#include <rte_config.h>
|
||||
#include <rte_malloc.h>
|
||||
#include <rte_bus_vdev.h>
|
||||
#include <rte_ethdev.h>
|
||||
|
|
|
@ -239,6 +239,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#include <rte_common.h>
|
||||
#include <rte_config.h>
|
||||
#include <rte_memory.h>
|
||||
#include <rte_errno.h>
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ extern "C" {
|
|||
#include <string.h>
|
||||
|
||||
#include <rte_common.h>
|
||||
#include <rte_config.h>
|
||||
#include <rte_dev.h>
|
||||
#include <rte_log.h>
|
||||
#include <rte_malloc.h>
|
||||
|
|
|
@ -20,6 +20,7 @@ extern "C" {
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include <rte_config.h>
|
||||
#include <rte_eal.h>
|
||||
#include <rte_lcore.h>
|
||||
#include <rte_pci.h>
|
||||
|
|
|
@ -19,6 +19,7 @@ extern "C" {
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include <rte_config.h>
|
||||
#include <rte_debug.h>
|
||||
#include <rte_eal.h>
|
||||
#include <rte_bus_vdev.h>
|
||||
|
|
|
@ -25,6 +25,7 @@ extern "C" {
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include <rte_config.h>
|
||||
#ifndef RTE_FBK_HASH_FUNC_DEFAULT
|
||||
#if defined(RTE_ARCH_X86) || defined(RTE_MACHINE_CPUFLAG_CRC32)
|
||||
#include <rte_hash_crc.h>
|
||||
|
|
|
@ -16,6 +16,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <rte_config.h>
|
||||
#include <rte_cpuflags.h>
|
||||
#include <rte_branch_prediction.h>
|
||||
#include <rte_common.h>
|
||||
|
|
|
@ -48,6 +48,7 @@ extern "C" {
|
|||
#include <string.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include <rte_config.h>
|
||||
#include <rte_log.h>
|
||||
#include <rte_byteorder.h>
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@ extern "C" {
|
|||
|
||||
#include <stdint.h>
|
||||
#include <rte_byteorder.h>
|
||||
#include <rte_config.h>
|
||||
#include <rte_ip.h>
|
||||
#include <rte_common.h>
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ extern "C" {
|
|||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <rte_config.h>
|
||||
#include <rte_malloc.h>
|
||||
#include <rte_memory.h>
|
||||
#include <rte_ip.h>
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <rte_branch_prediction.h>
|
||||
#include <rte_byteorder.h>
|
||||
#include <rte_config.h>
|
||||
#include <rte_memory.h>
|
||||
#include <rte_common.h>
|
||||
#include <rte_vect.h>
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include <rte_common.h>
|
||||
#include <rte_config.h>
|
||||
#include <rte_mempool.h>
|
||||
#include <rte_memory.h>
|
||||
#include <rte_atomic.h>
|
||||
|
|
|
@ -52,6 +52,7 @@ extern "C" {
|
|||
#include <stdint.h>
|
||||
|
||||
#include <rte_common.h>
|
||||
#include <rte_config.h>
|
||||
|
||||
/** The set ID type that stored internally in hash table based set summary. */
|
||||
typedef uint16_t member_set_t;
|
||||
|
|
|
@ -69,6 +69,7 @@
|
|||
#include <inttypes.h>
|
||||
#include <sys/queue.h>
|
||||
|
||||
#include <rte_config.h>
|
||||
#include <rte_spinlock.h>
|
||||
#include <rte_log.h>
|
||||
#include <rte_debug.h>
|
||||
|
|
|
@ -96,6 +96,7 @@ extern "C" {
|
|||
#include <sys/queue.h>
|
||||
#include <errno.h>
|
||||
#include <rte_common.h>
|
||||
#include <rte_config.h>
|
||||
#include <rte_memory.h>
|
||||
#include <rte_lcore.h>
|
||||
#include <rte_atomic.h>
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <rte_config.h>
|
||||
#ifdef RTE_ARCH_X86_64
|
||||
#include "rte_lru_x86.h"
|
||||
#elif defined(RTE_ARCH_ARM64)
|
||||
|
|
|
@ -11,6 +11,8 @@ extern "C" {
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <rte_config.h>
|
||||
|
||||
#ifndef RTE_TABLE_HASH_LRU_STRATEGY
|
||||
#define RTE_TABLE_HASH_LRU_STRATEGY 2
|
||||
#endif
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <rte_common.h>
|
||||
#include <rte_config.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
Loading…
Reference in a new issue