]> git.droids-corp.org - dpdk.git/commitdiff
lib: add missing include dependencies
authorAdrien Mazarguil <adrien.mazarguil@6wind.com>
Thu, 8 Sep 2016 12:25:07 +0000 (14:25 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 13 Sep 2016 13:35:28 +0000 (15:35 +0200)
Exported header files for use by applications should be self sufficient and
allow out of order inclusion. Moreover, they must include all the system
headers they need for types and macros.

This commit prevents the following errors:

 error: `RTE_MAX_LCORE' undeclared here (not in a function)
 error: `RTE_LPM_VALID_EXT_ENTRY_BITMASK' undeclared
  (first use in this function)
 error: #error "Unsupported cache line size"
 error: `asm' undeclared (first use in this function)
 error: implicit declaration of function `[...]'
 error: unknown type name `[...]'
 error: field `mac_addr' has incomplete type
 error: `CHAR_BIT' undeclared here (not in a function)
 error: `struct [...]' declared inside parameter list
 error: unknown type name `uint8_t'

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
35 files changed:
lib/librte_cfgfile/rte_cfgfile.h
lib/librte_cmdline/cmdline.h
lib/librte_cmdline/cmdline_parse_portlist.h
lib/librte_cmdline/cmdline_socket.h
lib/librte_eal/common/include/arch/arm/rte_byteorder.h
lib/librte_eal/common/include/arch/arm/rte_prefetch_32.h
lib/librte_eal/common/include/arch/arm/rte_prefetch_64.h
lib/librte_eal/common/include/arch/arm/rte_vect.h
lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h
lib/librte_eal/common/include/arch/ppc_64/rte_byteorder.h
lib/librte_eal/common/include/arch/ppc_64/rte_prefetch.h
lib/librte_eal/common/include/arch/x86/rte_atomic.h
lib/librte_eal/common/include/arch/x86/rte_atomic_32.h
lib/librte_eal/common/include/arch/x86/rte_atomic_64.h
lib/librte_eal/common/include/arch/x86/rte_byteorder.h
lib/librte_eal/common/include/arch/x86/rte_byteorder_32.h
lib/librte_eal/common/include/arch/x86/rte_byteorder_64.h
lib/librte_eal/common/include/arch/x86/rte_prefetch.h
lib/librte_eal/common/include/arch/x86/rte_rtm.h
lib/librte_eal/common/include/arch/x86/rte_vect.h
lib/librte_eal/common/include/generic/rte_atomic.h
lib/librte_eal/common/include/generic/rte_byteorder.h
lib/librte_eal/common/include/rte_eal.h
lib/librte_eal/common/include/rte_memory.h
lib/librte_eal/common/include/rte_time.h
lib/librte_eal/common/include/rte_version.h
lib/librte_ether/rte_dev_info.h
lib/librte_ether/rte_eth_ctrl.h
lib/librte_lpm/rte_lpm_neon.h
lib/librte_lpm/rte_lpm_sse.h
lib/librte_pdump/rte_pdump.h
lib/librte_reorder/rte_reorder.h
lib/librte_sched/rte_bitmap.h
lib/librte_sched/rte_reciprocal.h
lib/librte_sched/rte_sched_common.h

index f649836c63235fa74f56edd1beae5633a1a5c117..e81a5a272432573ee5f88d29cd16dfee7866e8b6 100644 (file)
@@ -34,6 +34,8 @@
 #ifndef __INCLUDE_RTE_CFGFILE_H__
 #define __INCLUDE_RTE_CFGFILE_H__
 
+#include <stddef.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
index 2578ca816fabb95f232085b984192d14e4d365c5..65d73b01b81e2959a9c4771492fd317c27a49867 100644 (file)
@@ -63,6 +63,7 @@
 
 #include <termios.h>
 #include <cmdline_rdline.h>
+#include <cmdline_parse.h>
 
 /**
  * @file
index 73d70e05acbf9253bffd54e9ba22ce559c9fc140..058df3eefdb11275d6ef2d68f32e27d9c044c17c 100644 (file)
@@ -61,6 +61,7 @@
 #ifndef _PARSE_PORTLIST_H_
 #define _PARSE_PORTLIST_H_
 
+#include <stdint.h>
 #include <cmdline_parse.h>
 
 #ifdef __cplusplus
index 8cc2dfbc85b46756c728b0bca3d6d28658b107f8..aa6068e7e4f0847e6853d3904f0a15ad6e9f9e49 100644 (file)
@@ -61,6 +61,9 @@
 #ifndef _CMDLINE_SOCKET_H_
 #define _CMDLINE_SOCKET_H_
 
+#include <cmdline_parse.h>
+#include <cmdline.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
index 3f2dd1f2542369996faf20f914195b652f7fccff..1b312b30609433e4a24e5f88e206e627cd0a6076 100644 (file)
@@ -41,6 +41,8 @@
 extern "C" {
 #endif
 
+#include <stdint.h>
+#include <rte_common.h>
 #include "generic/rte_byteorder.h"
 
 /* fix missing __builtin_bswap16 for gcc older then 4.8 */
index 5aeed22d057447ad34424496c731154a4253e018..43cde1726006b54fc5797a49b9c8383924f5ffd1 100644 (file)
@@ -37,6 +37,7 @@
 extern "C" {
 #endif
 
+#include <rte_common.h>
 #include "generic/rte_prefetch.h"
 
 static inline void rte_prefetch0(const volatile void *p)
index 3ed46a46ffe70d24206871ac1f8f0e2dfc64b358..0d077ea6f8d7f241226cbb8beaca7f80b38ce760 100644 (file)
@@ -37,6 +37,7 @@
 extern "C" {
 #endif
 
+#include <rte_common.h>
 #include "generic/rte_prefetch.h"
 
 static inline void rte_prefetch0(const volatile void *p)
index a33c05442f1dad503df2d208fb1d397b916f929d..b86c2cf5d99408d63e889a717ea83236ed635170 100644 (file)
@@ -33,6 +33,7 @@
 #ifndef _RTE_VECT_ARM_H_
 #define _RTE_VECT_ARM_H_
 
+#include <stdint.h>
 #include "arm_neon.h"
 
 #ifdef __cplusplus
index 924e89408d73c17d33e81c5dd1de35011d4097cf..fb4fccb480fcee8c19a95ba30cd322e17052a40d 100644 (file)
@@ -46,6 +46,7 @@
 extern "C" {
 #endif
 
+#include <stdint.h>
 #include "generic/rte_atomic.h"
 
 /**
index 3c1734ed1a040c0d9e44c8f9b0cd5d34baed292d..544de3c22d333202083fedd778d5181ea04c066c 100644 (file)
@@ -42,6 +42,7 @@
 extern "C" {
 #endif
 
+#include <stdint.h>
 #include "generic/rte_byteorder.h"
 
 /*
index 9a1995eaaa0f1f90d8b4f69242dfef92b5c785df..fd2e53b9254aed8611d676825a08ea02cf8225ec 100644 (file)
@@ -37,6 +37,7 @@
 extern "C" {
 #endif
 
+#include <rte_common.h>
 #include "generic/rte_prefetch.h"
 
 static inline void rte_prefetch0(const volatile void *p)
index b20056b86845caf336fc71817afe429d1ffd3ffb..00b1cdf5d006955d3899766e32c4d691b44b113e 100644 (file)
@@ -38,6 +38,8 @@
 extern "C" {
 #endif
 
+#include <stdint.h>
+#include <rte_common.h>
 #include <emmintrin.h>
 #include "generic/rte_atomic.h"
 
index 5ce01b32531e574c6488f3f328931467fa2b188f..2e04c7595f7b240193b1650628670f925f810a23 100644 (file)
  * All rights reserved.
  */
 
+#ifndef _RTE_ATOMIC_X86_H_
+#error do not include this file directly, use <rte_atomic.h> instead
+#endif
+
 #ifndef _RTE_ATOMIC_I686_H_
 #define _RTE_ATOMIC_I686_H_
 
+#include <stdint.h>
 #include <rte_common.h>
+#include <rte_atomic.h>
 
 /*------------------------- 64 bit atomic operations -------------------------*/
 
index 4de660004c0e8787f71ac467f49c1d0fc6b4f46a..1a53a766bd729f465032ba24dc3da2caabb8a35e 100644 (file)
  * All rights reserved.
  */
 
+#ifndef _RTE_ATOMIC_X86_H_
+#error do not include this file directly, use <rte_atomic.h> instead
+#endif
+
 #ifndef _RTE_ATOMIC_X86_64_H_
 #define _RTE_ATOMIC_X86_64_H_
 
+#include <stdint.h>
+#include <rte_common.h>
+#include <rte_atomic.h>
+
 /*------------------------- 64 bit atomic operations -------------------------*/
 
 #ifndef RTE_FORCE_INTRINSICS
index ffdb6ef5488e41b65a5f0815c80bed63c36257df..251f11b4d1d9fd93b6e61a3f83535522852b412f 100644 (file)
@@ -38,6 +38,8 @@
 extern "C" {
 #endif
 
+#include <stdint.h>
+#include <rte_common.h>
 #include "generic/rte_byteorder.h"
 
 #ifndef RTE_BYTE_ORDER
index 51c306f818043615cce7377f863d36c29d6d0670..14d64834ff0d53483cd658e10e634cbc8c56787c 100644 (file)
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifndef _RTE_BYTEORDER_X86_H_
+#error do not include this file directly, use <rte_byteorder.h> instead
+#endif
+
 #ifndef _RTE_BYTEORDER_I686_H_
 #define _RTE_BYTEORDER_I686_H_
 
+#include <stdint.h>
+#include <rte_byteorder.h>
+
 /*
  * An architecture-optimized byte swap for a 64-bit value.
  *
index dda572bd8399d12bcff69f6cb0b9ba3e7f2cb10f..516ac0527bb76128f641e88ead518e948e378585 100644 (file)
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifndef _RTE_BYTEORDER_X86_H_
+#error do not include this file directly, use <rte_byteorder.h> instead
+#endif
+
 #ifndef _RTE_BYTEORDER_X86_64_H_
 #define _RTE_BYTEORDER_X86_64_H_
 
+#include <stdint.h>
+#include <rte_common.h>
+
 /*
  * An architecture-optimized byte swap for a 64-bit value.
  *
index 5dac47ebd44d20388a1a893c3ff4fa265c0e5574..f464398f554575aa3e7ac3c31ede869bfb6a572d 100644 (file)
@@ -38,6 +38,7 @@
 extern "C" {
 #endif
 
+#include <rte_common.h>
 #include "generic/rte_prefetch.h"
 
 static inline void rte_prefetch0(const volatile void *p)
index 0649f7940d0fe81b8f042e559aff9c0ac3892707..ab09995216d5d6b87fc12e70913fe1af9bbf694b 100644 (file)
@@ -20,6 +20,7 @@
 /* Official RTM intrinsics interface matching gcc/icc, but works
    on older gcc compatible compilers and binutils. */
 
+#include <rte_common.h>
 
 #ifdef __cplusplus
 extern "C" {
index 2836f2c25743d94907780c7d670e08abc29ee10f..77f2e253fbbe228ff74cf23a9c00e6b13b7f22f7 100644 (file)
@@ -40,6 +40,8 @@
  * RTE SSE/AVX related header.
  */
 
+#include <stdint.h>
+
 #if (defined(__ICC) || (__GNUC__ == 4 &&  __GNUC_MINOR__ < 4))
 
 #ifdef __SSE__
index bfb4fe4479e876c6ccb5a2e5e3cf026b703d2fbd..43a704ec162e93900c7e651d5433f271859bbdfb 100644 (file)
@@ -42,6 +42,7 @@
  */
 
 #include <stdint.h>
+#include <rte_common.h>
 
 #ifdef __DOXYGEN__
 
index c46fdcf20dee22e273a1d049f5bcd0ae31cb9c60..e00bccbc7b0598087a4c0f72ac2cb23d63c948b6 100644 (file)
@@ -50,6 +50,8 @@
 #include <endian.h>
 #endif
 
+#include <rte_common.h>
+
 /*
  * Compile-time endianness detection
  */
index a71d6f570acae630804bd46e39a1ad1bc3f4be86..98d20db6a6af01fc62b2d45174917fcfa01e56de 100644 (file)
@@ -44,6 +44,7 @@
 #include <sched.h>
 
 #include <rte_per_lcore.h>
+#include <rte_config.h>
 
 #ifdef __cplusplus
 extern "C" {
index 06b6596895941b49960067e927318662c3094e28..2e69821c7f1f1727298725f1e5fcac3981b3edab 100644 (file)
@@ -44,6 +44,8 @@
 #include <stddef.h>
 #include <stdio.h>
 
+#include <rte_config.h>
+
 #ifdef RTE_EXEC_ENV_LINUXAPP
 #include <exec-env/rte_dom0_common.h>
 #endif
index 4b13b9c1ca9338dd3ec076ad81b96fdac11ef8a2..28c6274c462535162fa713f1c015ad7532924d9a 100644 (file)
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifndef _RTE_TIME_H_
+#define _RTE_TIME_H_
+
+#include <stdint.h>
+#include <time.h>
+
 #define NSEC_PER_SEC             1000000000L
 
 /**
@@ -120,3 +126,5 @@ rte_ns_to_timespec(uint64_t nsec)
 
        return ts;
 }
+
+#endif /* _RTE_TIME_H_ */
index 2c20cb3eba33d3881c7334d01e67e863e511e9aa..844e40c97eda1ed9fad7ab610275f3d0c1921e7a 100644 (file)
@@ -45,6 +45,7 @@ extern "C" {
 
 #include <stdint.h>
 #include <string.h>
+#include <stdio.h>
 #include <rte_common.h>
 
 /**
index 574683d3154347685a965a4fa2c2e1b9bbab621f..aab6d1a6d6d9bd50a7825ba2b6fe716989bcf756 100644 (file)
@@ -34,6 +34,8 @@
 #ifndef _RTE_DEV_INFO_H_
 #define _RTE_DEV_INFO_H_
 
+#include <stdint.h>
+
 /*
  * Placeholder for accessing device registers
  */
index c3a2c9e4295c8be56bb8a3ff722ac126cf144809..fe80eb0137a118911c6d3756a9adf94b79651cd4 100644 (file)
 #ifndef _RTE_ETH_CTRL_H_
 #define _RTE_ETH_CTRL_H_
 
+#include <stdint.h>
+#include <rte_common.h>
+#include "rte_ether.h"
+
 /**
  * @file
  *
index 7c64315993b907cd59c75eba6d4956181bc142a6..7efd9a0d99de62ef0aea796ac410b825623dcfbe 100644 (file)
@@ -43,6 +43,7 @@
 #include <rte_byteorder.h>
 #include <rte_common.h>
 #include <rte_vect.h>
+#include <rte_lpm.h>
 
 #ifdef __cplusplus
 extern "C" {
index da83099561252d3cde896b54d4e93dec3ec1bd96..ef33c6a1b8fb1fae9a3e4bf726b9221d84b6aa82 100644 (file)
@@ -38,6 +38,7 @@
 #include <rte_byteorder.h>
 #include <rte_common.h>
 #include <rte_vect.h>
+#include <rte_lpm.h>
 
 #ifdef __cplusplus
 extern "C" {
index b5f4e2f302a6892675e12e101e6ee0c8577e029a..924b8043d81e0733ff61b3e22c9a5b47ae0d04ab 100644 (file)
  * packet dump library to provide packet capturing support on dpdk.
  */
 
+#include <stdint.h>
+#include <rte_mempool.h>
+#include <rte_ring.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
index c7a2934c385d270f1947bf9503d190dd9c1ce1d4..737e0554cc32efed9591a7a73e0dd4d50417d8f1 100644 (file)
@@ -44,6 +44,8 @@
  *
  */
 
+#include <rte_mbuf.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
index 1b5df0218ec11ef57ad18c4abbac31dd5e663ac8..010d752c2f423dd90d1b95b95ecff2d7d27abfec 100644 (file)
@@ -64,6 +64,7 @@ extern "C" {
  *
  ***/
 
+#include <string.h>
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_memory.h>
index abd15251d017082083fe1f3da0bd2d80c602f595..5e21f096fa8d808d80df1a8753ad07955c487070 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef _RTE_RECIPROCAL_H_
 #define _RTE_RECIPROCAL_H_
 
+#include <stdint.h>
+
 struct rte_reciprocal {
        uint32_t m;
        uint8_t sh1, sh2;
index 8920adecfdd8ecaf604b34bdf7c47481113c2f3a..aed144ba2f71cf9b1dd93a587c3e7584b2ab4270 100644 (file)
@@ -38,6 +38,7 @@
 extern "C" {
 #endif
 
+#include <stdint.h>
 #include <sys/types.h>
 
 #define __rte_aligned_16 __attribute__((__aligned__(16)))