[PATCH v2 15/83] net/iavf: move alignment attribute on types
Tyler Retzlaff
roretzla at linux.microsoft.com
Mon Apr 15 22:03:37 CEST 2024
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 <roretzla at linux.microsoft.com>
Acked-by: Morten Brørup <mb at smartsharesystems.com>
---
drivers/net/iavf/iavf.h | 2 +-
drivers/net/iavf/iavf_rxtx.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h
index 824ae4a..7ab41c9 100644
--- a/drivers/net/iavf/iavf.h
+++ b/drivers/net/iavf/iavf.h
@@ -375,7 +375,7 @@ struct iavf_adapter {
/* For vector PMD */
bool rx_vec_allowed;
bool tx_vec_allowed;
- uint32_t ptype_tbl[IAVF_MAX_PKT_TYPE] __rte_cache_min_aligned;
+ alignas(RTE_CACHE_LINE_MIN_SIZE) uint32_t ptype_tbl[IAVF_MAX_PKT_TYPE];
bool stopped;
bool closed;
bool no_poll;
diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 0a5246d..59a0b9e 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -4449,8 +4449,7 @@ struct iavf_tx_context_desc_qws {
static inline uint32_t
iavf_get_default_ptype(uint16_t ptype)
{
- static const uint32_t ptype_tbl[IAVF_MAX_PKT_TYPE]
- __rte_cache_aligned = {
+ static const alignas(RTE_CACHE_LINE_SIZE) uint32_t ptype_tbl[IAVF_MAX_PKT_TYPE] = {
/* L2 types */
/* [0] reserved */
[1] = RTE_PTYPE_L2_ETHER,
--
1.8.3.1
More information about the dev
mailing list