lib: add missing include dependencies

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>
This commit is contained in:
Adrien Mazarguil 2016-09-08 14:25:07 +02:00 committed by Thomas Monjalon
parent 79d6f5fc58
commit f04519d809
35 changed files with 84 additions and 0 deletions

View File

@ -34,6 +34,8 @@
#ifndef __INCLUDE_RTE_CFGFILE_H__
#define __INCLUDE_RTE_CFGFILE_H__
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -63,6 +63,7 @@
#include <termios.h>
#include <cmdline_rdline.h>
#include <cmdline_parse.h>
/**
* @file

View File

@ -61,6 +61,7 @@
#ifndef _PARSE_PORTLIST_H_
#define _PARSE_PORTLIST_H_
#include <stdint.h>
#include <cmdline_parse.h>
#ifdef __cplusplus

View 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

View 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 */

View 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)

View 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)

View File

@ -33,6 +33,7 @@
#ifndef _RTE_VECT_ARM_H_
#define _RTE_VECT_ARM_H_
#include <stdint.h>
#include "arm_neon.h"
#ifdef __cplusplus

View File

@ -46,6 +46,7 @@
extern "C" {
#endif
#include <stdint.h>
#include "generic/rte_atomic.h"
/**

View File

@ -42,6 +42,7 @@
extern "C" {
#endif
#include <stdint.h>
#include "generic/rte_byteorder.h"
/*

View 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)

View File

@ -38,6 +38,8 @@
extern "C" {
#endif
#include <stdint.h>
#include <rte_common.h>
#include <emmintrin.h>
#include "generic/rte_atomic.h"

View File

@ -37,10 +37,16 @@
* 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 -------------------------*/

View File

@ -37,9 +37,17 @@
* 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

View File

@ -38,6 +38,8 @@
extern "C" {
#endif
#include <stdint.h>
#include <rte_common.h>
#include "generic/rte_byteorder.h"
#ifndef RTE_BYTE_ORDER

View File

@ -31,9 +31,16 @@
* 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.
*

View File

@ -31,9 +31,16 @@
* 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.
*

View 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)

View 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" {

View File

@ -40,6 +40,8 @@
* RTE SSE/AVX related header.
*/
#include <stdint.h>
#if (defined(__ICC) || (__GNUC__ == 4 && __GNUC_MINOR__ < 4))
#ifdef __SSE__

View File

@ -42,6 +42,7 @@
*/
#include <stdint.h>
#include <rte_common.h>
#ifdef __DOXYGEN__

View File

@ -50,6 +50,8 @@
#include <endian.h>
#endif
#include <rte_common.h>
/*
* Compile-time endianness detection
*/

View File

@ -44,6 +44,7 @@
#include <sched.h>
#include <rte_per_lcore.h>
#include <rte_config.h>
#ifdef __cplusplus
extern "C" {

View 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

View File

@ -31,6 +31,12 @@
* 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_ */

View File

@ -45,6 +45,7 @@ extern "C" {
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include <rte_common.h>
/**

View File

@ -34,6 +34,8 @@
#ifndef _RTE_DEV_INFO_H_
#define _RTE_DEV_INFO_H_
#include <stdint.h>
/*
* Placeholder for accessing device registers
*/

View File

@ -34,6 +34,10 @@
#ifndef _RTE_ETH_CTRL_H_
#define _RTE_ETH_CTRL_H_
#include <stdint.h>
#include <rte_common.h>
#include "rte_ether.h"
/**
* @file
*

View 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" {

View 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" {

View File

@ -41,6 +41,10 @@
* 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

View File

@ -44,6 +44,8 @@
*
*/
#include <rte_mbuf.h>
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -64,6 +64,7 @@ extern "C" {
*
***/
#include <string.h>
#include <rte_common.h>
#include <rte_debug.h>
#include <rte_memory.h>

View 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;

View File

@ -38,6 +38,7 @@
extern "C" {
#endif
#include <stdint.h>
#include <sys/types.h>
#define __rte_aligned_16 __attribute__((__aligned__(16)))