lib: fix missing includes in exported headers
authorAdrien Mazarguil <adrien.mazarguil@6wind.com>
Thu, 21 Dec 2017 13:00:04 +0000 (14:00 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 16 Jan 2018 23:31:05 +0000 (00:31 +0100)
commit0d440d081ca1b5cccbb3b991908842c70731e460
treee756501a610d9c0aebfc6c2c34b760e5dd9c00ab
parent34c709f9b21cc5bc9bad338e908ebca08a6dfc37
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: f1a7a5c5f404 ("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>
41 files changed:
drivers/net/avp/rte_avp_common.h
lib/librte_cmdline/cmdline_cirbuf.h
lib/librte_cryptodev/rte_cryptodev.h
lib/librte_cryptodev/rte_cryptodev_pmd.h
lib/librte_eal/common/include/arch/x86/rte_atomic.h
lib/librte_eal/common/include/arch/x86/rte_byteorder.h
lib/librte_eal/common/include/arch/x86/rte_cycles.h
lib/librte_eal/common/include/arch/x86/rte_memcpy.h
lib/librte_eal/common/include/arch/x86/rte_vect.h
lib/librte_eal/common/include/generic/rte_byteorder.h
lib/librte_eal/common/include/rte_bitmap.h
lib/librte_eal/common/include/rte_common.h
lib/librte_eal/common/include/rte_dev.h
lib/librte_eal/common/include/rte_eal.h
lib/librte_eal/common/include/rte_eal_memconfig.h
lib/librte_eal/common/include/rte_keepalive.h
lib/librte_eal/common/include/rte_lcore.h
lib/librte_eal/common/include/rte_log.h
lib/librte_eal/common/include/rte_memory.h
lib/librte_eal/common/include/rte_service.h
lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
lib/librte_ether/rte_ethdev.h
lib/librte_ether/rte_ethdev_pci.h
lib/librte_ether/rte_ethdev_vdev.h
lib/librte_eventdev/rte_eventdev.h
lib/librte_eventdev/rte_eventdev_pmd.h
lib/librte_eventdev/rte_eventdev_pmd_pci.h
lib/librte_eventdev/rte_eventdev_pmd_vdev.h
lib/librte_hash/rte_fbk_hash.h
lib/librte_hash/rte_hash_crc.h
lib/librte_hash/rte_jhash.h
lib/librte_hash/rte_thash.h
lib/librte_ip_frag/rte_ip_frag.h
lib/librte_lpm/rte_lpm.h
lib/librte_mbuf/rte_mbuf.h
lib/librte_member/rte_member.h
lib/librte_mempool/rte_mempool.h
lib/librte_ring/rte_ring.h
lib/librte_table/rte_lru.h
lib/librte_table/rte_lru_x86.h
lib/librte_timer/rte_timer.h