numam-dpdk/lib/librte_net/rte_mpls.h
Raslan Darawsheh e4f9eab7d9 net: fix pedantic build
when trying to compile rte_mpls with pedantic enabled,
on old compilers like 4.8 it will complain about bit field definition.

error: type of bit-field 'bs' is a GCC extension [-Werror=pedantic]
error: type of bit-field 'tc' is a GCC extension [-Werror=pedantic]
error: type of bit-field 'tag_lsb' is a GCC extension [-Werror=pedantic]

This fixes the compilation error by adding extension to the header
definition.

Fixes: e480cf487a ("net: add MPLS header structure")
Cc: stable@dpdk.org

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-07-21 17:36:54 +02:00

44 lines
780 B
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2016 6WIND S.A.
*/
#ifndef _RTE_MPLS_H_
#define _RTE_MPLS_H_
/**
* @file
*
* MPLS-related defines
*/
#include <stdint.h>
#include <rte_byteorder.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* MPLS header.
*/
__extension__
struct rte_mpls_hdr {
uint16_t tag_msb; /**< Label(msb). */
#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
uint8_t tag_lsb:4; /**< Label(lsb). */
uint8_t tc:3; /**< Traffic class. */
uint8_t bs:1; /**< Bottom of stack. */
#else
uint8_t bs:1; /**< Bottom of stack. */
uint8_t tc:3; /**< Traffic class. */
uint8_t tag_lsb:4; /**< label(lsb) */
#endif
uint8_t ttl; /**< Time to live. */
} __rte_packed;
#ifdef __cplusplus
}
#endif
#endif /* RTE_MPLS_H_ */