Move location of __rte_aligned(a) to new conventional location. The new placement between {struct,union} and the tag allows the desired alignment to be imparted on the type regardless of the toolchain being used for both C and C++. Additionally, it avoids confusion by Doxygen when generating documentation.
Signed-off-by: Tyler Retzlaff <roret...@linux.microsoft.com> --- drivers/net/txgbe/txgbe_ipsec.h | 4 ++-- drivers/net/txgbe/txgbe_ptypes.c | 10 +++++----- drivers/net/txgbe/txgbe_rxtx.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/txgbe/txgbe_ipsec.h b/drivers/net/txgbe/txgbe_ipsec.h index 995e29e..e93f9a3 100644 --- a/drivers/net/txgbe/txgbe_ipsec.h +++ b/drivers/net/txgbe/txgbe_ipsec.h @@ -44,7 +44,7 @@ struct ipaddr { }; /** inline crypto private session structure */ -struct txgbe_crypto_session { +struct __rte_cache_aligned txgbe_crypto_session { enum txgbe_operation op; const uint8_t *key; uint32_t key_len; @@ -54,7 +54,7 @@ struct txgbe_crypto_session { struct ipaddr src_ip; struct ipaddr dst_ip; struct rte_eth_dev *dev; -} __rte_cache_aligned; +}; struct txgbe_crypto_rx_ip_table { struct ipaddr ip; diff --git a/drivers/net/txgbe/txgbe_ptypes.c b/drivers/net/txgbe/txgbe_ptypes.c index c07977b..a8e7271 100644 --- a/drivers/net/txgbe/txgbe_ptypes.c +++ b/drivers/net/txgbe/txgbe_ptypes.c @@ -47,7 +47,7 @@ #define RTE_PTYPE_INNER_L3_NONE 0 #define RTE_PTYPE_INNER_L4_NONE 0 -static u32 txgbe_ptype_lookup[TXGBE_PTID_MAX] __rte_cache_aligned = { +static alignas(RTE_CACHE_LINE_SIZE) u32 txgbe_ptype_lookup[TXGBE_PTID_MAX] = { /* L2:0-3 L3:4-7 L4:8-11 TUN:12-15 EL2:16-19 EL3:20-23 EL2:24-27 */ /* L2: ETH */ TPTE(0x10, ETHER, NONE, NONE, NONE, NONE, NONE, NONE), @@ -393,8 +393,8 @@ u8 txgbe_encode_ptype(u32 ptype) * Use 2 different table for normal packet and tunnel packet * to save the space. */ -const u32 -txgbe_ptype_table[TXGBE_PTID_MAX] __rte_cache_aligned = { +const alignas(RTE_CACHE_LINE_SIZE) u32 +txgbe_ptype_table[TXGBE_PTID_MAX] = { [TXGBE_PT_ETHER] = RTE_PTYPE_L2_ETHER, [TXGBE_PT_IPV4] = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4, @@ -478,8 +478,8 @@ u8 txgbe_encode_ptype(u32 ptype) RTE_PTYPE_INNER_L3_IPV6_EXT | RTE_PTYPE_INNER_L4_SCTP, }; -const u32 -txgbe_ptype_table_tn[TXGBE_PTID_MAX] __rte_cache_aligned = { +const alignas(RTE_CACHE_LINE_SIZE) u32 +txgbe_ptype_table_tn[TXGBE_PTID_MAX] = { [TXGBE_PT_NVGRE] = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4_EXT_UNKNOWN | RTE_PTYPE_TUNNEL_GRE | RTE_PTYPE_INNER_L2_ETHER, diff --git a/drivers/net/txgbe/txgbe_rxtx.c b/drivers/net/txgbe/txgbe_rxtx.c index 1cd4b25..2568bf0 100644 --- a/drivers/net/txgbe/txgbe_rxtx.c +++ b/drivers/net/txgbe/txgbe_rxtx.c @@ -1107,7 +1107,7 @@ static inline uint64_t txgbe_rxd_pkt_info_to_pkt_flags(uint32_t pkt_info) { - static uint64_t ip_rss_types_map[16] __rte_cache_aligned = { + static alignas(RTE_CACHE_LINE_SIZE) uint64_t ip_rss_types_map[16] = { 0, RTE_MBUF_F_RX_RSS_HASH, RTE_MBUF_F_RX_RSS_HASH, RTE_MBUF_F_RX_RSS_HASH, 0, RTE_MBUF_F_RX_RSS_HASH, 0, RTE_MBUF_F_RX_RSS_HASH, RTE_MBUF_F_RX_RSS_HASH, 0, 0, 0, -- 1.8.3.1