[16/83] net/ice: move alignment attribute on types

Message ID 1710949096-5786-17-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Superseded
Delegated to: David Marchand
Headers
Series move alignment attribute on types |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tyler Retzlaff March 20, 2024, 3:37 p.m. UTC
  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@linux.microsoft.com>
---
 drivers/net/ice/ice_ethdev.h | 2 +-
 drivers/net/ice/ice_rxtx.c   | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
  

Patch

diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h
index 1a848b3..984479a 100644
--- a/drivers/net/ice/ice_ethdev.h
+++ b/drivers/net/ice/ice_ethdev.h
@@ -605,7 +605,7 @@  struct ice_adapter {
 	bool tx_vec_allowed;
 	bool tx_simple_allowed;
 	/* ptype mapping table */
-	uint32_t ptype_tbl[ICE_MAX_PKT_TYPE] __rte_cache_min_aligned;
+	alignas(RTE_CACHE_LINE_MIN_SIZE) uint32_t ptype_tbl[ICE_MAX_PKT_TYPE];
 	bool is_safe_mode;
 	struct ice_devargs devargs;
 	enum ice_pkg_type active_pkg_type; /* loaded ddp package type */
diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 13aabe9..95a2db3 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -4013,8 +4013,7 @@ 
 static inline uint32_t
 ice_get_default_pkt_type(uint16_t ptype)
 {
-	static const uint32_t type_table[ICE_MAX_PKT_TYPE]
-		__rte_cache_aligned = {
+	static const alignas(RTE_CACHE_LINE_SIZE) uint32_t type_table[ICE_MAX_PKT_TYPE] = {
 		/* L2 types */
 		/* [0] reserved */
 		[1] = RTE_PTYPE_L2_ETHER,