@@ -40,6 +40,8 @@
*
*/
+#include <rte_common.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -111,6 +113,7 @@ struct rte_crypto_op {
void *opaque_data;
/**< Opaque pointer for user data */
+ RTE_STD_C11
union {
struct rte_crypto_sym_op *sym;
/**< Symmetric operation parameters */
@@ -42,6 +42,8 @@
* as supported symmetric crypto operation combinations.
*/
+#include <rte_common.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -333,6 +335,7 @@ struct rte_crypto_sym_xform {
/**< next xform in chain */
enum rte_crypto_sym_xform_type type
; /**< xform type */
+ RTE_STD_C11
union {
struct rte_crypto_auth_xform auth;
/**< Authentication / hash xform */
@@ -371,6 +374,7 @@ struct rte_crypto_sym_op {
enum rte_crypto_sym_op_sess_type type;
+ RTE_STD_C11
union {
struct rte_cryptodev_sym_session *session;
/**< Handle for the initialised session context */
@@ -44,6 +44,8 @@
*
*/
+#include <rte_common.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -104,6 +106,7 @@ extern const char **rte_cyptodev_names;
struct rte_cryptodev_symmetric_capability {
enum rte_crypto_sym_xform_type xform_type;
/**< Transform type : Authentication / Cipher */
+ RTE_STD_C11
union {
struct {
enum rte_crypto_auth_algorithm algo;
@@ -177,6 +180,7 @@ struct rte_cryptodev_capabilities {
enum rte_crypto_op_type op;
/**< Operation type */
+ RTE_STD_C11
union {
struct rte_cryptodev_symmetric_capability sym;
/**< Symmetric operation capability parameters */
@@ -838,6 +842,7 @@ rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
/** Cryptodev symmetric crypto session */
struct rte_cryptodev_sym_session {
+ RTE_STD_C11
struct {
uint8_t dev_id;
/**< Device Id */
@@ -52,6 +52,7 @@ extern "C" {
#include <rte_mbuf.h>
#include <rte_mempool.h>
#include <rte_log.h>
+#include <rte_common.h>
#include "rte_crypto.h"
#include "rte_cryptodev.h"
@@ -65,6 +66,7 @@ extern "C" {
#endif
struct rte_cryptodev_session {
+ RTE_STD_C11
struct {
uint8_t dev_id;
enum rte_cryptodev_type type;
@@ -33,6 +33,8 @@
#ifndef _RTE_CYCLES_PPC_64_H_
#define _RTE_CYCLES_PPC_64_H_
+#include <rte_common.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -52,6 +54,7 @@ rte_rdtsc(void)
{
union {
uint64_t tsc_64;
+ RTE_STD_C11
struct {
#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
uint32_t hi_32;
@@ -40,6 +40,8 @@
#ifndef _RTE_ATOMIC_I686_H_
#define _RTE_ATOMIC_I686_H_
+#include <rte_common.h>
+
/*------------------------- 64 bit atomic operations -------------------------*/
#ifndef RTE_FORCE_INTRINSICS
@@ -47,6 +49,7 @@ static inline int
rte_atomic64_cmpset(volatile uint64_t *dst, uint64_t exp, uint64_t src)
{
uint8_t res;
+ RTE_STD_C11
union {
struct {
uint32_t l32;
@@ -64,6 +64,8 @@
#ifndef _RTE_CYCLES_X86_64_H_
#define _RTE_CYCLES_X86_64_H_
+#include <rte_common.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -81,6 +83,7 @@ rte_rdtsc(void)
{
union {
uint64_t tsc_64;
+ RTE_STD_C11
struct {
uint32_t lo_32;
uint32_t hi_32;
@@ -59,6 +59,13 @@ extern "C" {
#define asm __asm__
#endif
+/** C extension macro for environments lacking C11 features. */
+#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L
+#define RTE_STD_C11 __extension__
+#else
+#define RTE_STD_C11
+#endif
+
#ifdef RTE_ARCH_STRICT_ALIGN
typedef uint64_t unaligned_uint64_t __attribute__ ((aligned(1)));
typedef uint32_t unaligned_uint32_t __attribute__ ((aligned(1)));
@@ -76,6 +76,7 @@ struct rte_devargs {
TAILQ_ENTRY(rte_devargs) next;
/** Type of device. */
enum rte_devtype type;
+ RTE_STD_C11
union {
/** Used if type is RTE_DEVTYPE_*_PCI. */
struct {
@@ -34,6 +34,8 @@
#ifndef _RTE_INTERRUPTS_H_
#define _RTE_INTERRUPTS_H_
+#include <rte_common.h>
+
/**
* @file
*
@@ -104,6 +104,7 @@ typedef uint64_t phys_addr_t; /**< Physical address definition. */
*/
struct rte_memseg {
phys_addr_t phys_addr; /**< Start physical address. */
+ RTE_STD_C11
union {
void *addr; /**< Start virtual address. */
uint64_t addr_64; /**< Makes sure addr is always 64 bits */
@@ -53,6 +53,7 @@
#include <stdio.h>
#include <rte_memory.h>
+#include <rte_common.h>
#ifdef __cplusplus
extern "C" {
@@ -78,6 +79,7 @@ struct rte_memzone {
char name[RTE_MEMZONE_NAMESIZE]; /**< Name of the memory zone. */
phys_addr_t phys_addr; /**< Start physical address. */
+ RTE_STD_C11
union {
void *addr; /**< Start virtual address. */
uint64_t addr_64; /**< Makes sure addr is always 64-bits */
@@ -82,6 +82,7 @@ struct rte_epoll_event {
/** Handle for interrupts. */
struct rte_intr_handle {
+ RTE_STD_C11
union {
int vfio_dev_fd; /**< VFIO device file descriptor */
int uio_cfg_fd; /**< UIO config file descriptor
@@ -40,6 +40,8 @@
* toeplitz hash functions.
*/
+#include <rte_common.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -102,6 +104,7 @@ static const __m128i rte_thash_ipv6_bswap_mask = {
struct rte_ipv4_tuple {
uint32_t src_addr;
uint32_t dst_addr;
+ RTE_STD_C11
union {
struct {
uint16_t dport;
@@ -119,6 +122,7 @@ struct rte_ipv4_tuple {
struct rte_ipv6_tuple {
uint8_t src_addr[16];
uint8_t dst_addr[16];
+ RTE_STD_C11
union {
struct {
uint16_t dport;
@@ -100,6 +100,7 @@ struct rte_lpm_tbl_entry_v20 {
* a group index pointing to a tbl8 structure (tbl24 only, when
* valid_group is set)
*/
+ RTE_STD_C11
union {
uint8_t next_hop;
uint8_t group_idx;
@@ -754,6 +754,7 @@ struct rte_mbuf {
* or non-atomic) is controlled by the CONFIG_RTE_MBUF_REFCNT_ATOMIC
* config option.
*/
+ RTE_STD_C11
union {
rte_atomic16_t refcnt_atomic; /**< Atomically accessed refcnt */
uint16_t refcnt; /**< Non-atomically accessed refcnt */
@@ -770,6 +771,7 @@ struct rte_mbuf {
* The packet type, which is the combination of outer/inner L2, L3, L4
* and tunnel types.
*/
+ RTE_STD_C11
union {
uint32_t packet_type; /**< L2/L3/L4 and tunnel information. */
struct {
@@ -790,6 +792,7 @@ struct rte_mbuf {
union {
uint32_t rss; /**< RSS hash result if RSS enabled */
struct {
+ RTE_STD_C11
union {
struct {
uint16_t hash;
@@ -816,6 +819,7 @@ struct rte_mbuf {
/* second cache line - fields only used in slow path or on TX */
MARKER cacheline1 __rte_cache_min_aligned;
+ RTE_STD_C11
union {
void *userdata; /**< Can be used for external metadata */
uint64_t udata64; /**< Allow 8-byte userdata on 32-bit */
@@ -825,6 +829,7 @@ struct rte_mbuf {
struct rte_mbuf *next; /**< Next segment of scattered packet. */
/* fields to support TX offloads */
+ RTE_STD_C11
union {
uint64_t tx_offload; /**< combined for easy fetch */
__extension__
@@ -34,6 +34,8 @@
#ifndef __INCLUDE_RTE_PIPELINE_H__
#define __INCLUDE_RTE_PIPELINE_H__
+#include <rte_common.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -244,6 +246,7 @@ struct rte_pipeline_table_entry {
/** Reserved action */
enum rte_pipeline_action action;
+ RTE_STD_C11
union {
/** Output port ID (meta-data for "Send packet to output port"
action) */
@@ -66,6 +66,7 @@
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
+#include <rte_common.h>
#ifdef __cplusplus
extern "C" {
@@ -91,6 +92,7 @@ enum rte_timer_type {
* config) and an owner (the id of the lcore that owns the timer).
*/
union rte_timer_status {
+ RTE_STD_C11
struct {
uint16_t state; /**< Stop, pending, running, config. */
int16_t owner; /**< The lcore that owns the timer. */