[43/83] event/octeontx: move alignment attribute on types

Message ID 1710949096-5786-44-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 warning coding style issues

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/event/octeontx/ssovf_evdev.h  | 8 ++++----
 drivers/event/octeontx/timvf_evdev.h  | 8 ++++----
 drivers/event/octeontx/timvf_worker.c | 2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)
  

Patch

diff --git a/drivers/event/octeontx/ssovf_evdev.h b/drivers/event/octeontx/ssovf_evdev.h
index 8a4cb20..293eb85 100644
--- a/drivers/event/octeontx/ssovf_evdev.h
+++ b/drivers/event/octeontx/ssovf_evdev.h
@@ -134,7 +134,7 @@  enum ssovf_type {
 	OCTEONTX_SSO_HWS,  /* SSO hardware workslot vf */
 };
 
-struct ssovf_evdev {
+struct __rte_cache_aligned ssovf_evdev {
 	OFFLOAD_FLAGS; /*Sequence should not be changed */
 	uint8_t max_event_queues;
 	uint8_t max_event_ports;
@@ -150,10 +150,10 @@  struct ssovf_evdev {
 	uint8_t *rxq_pool_rcnt;
 	uint16_t tim_ring_cnt;
 	uint16_t *tim_ring_ids;
-} __rte_cache_aligned;
+};
 
 /* Event port aka HWS */
-struct ssows {
+struct __rte_cache_aligned ssows {
 	uint8_t cur_tt;
 	uint8_t cur_grp;
 	uint8_t swtag_req;
@@ -162,7 +162,7 @@  struct ssows {
 	uint8_t *grps[SSO_MAX_VHGRP];
 	uint8_t port;
 	void *lookup_mem;
-} __rte_cache_aligned;
+};
 
 static inline struct ssovf_evdev *
 ssovf_pmd_priv(const struct rte_eventdev *eventdev)
diff --git a/drivers/event/octeontx/timvf_evdev.h b/drivers/event/octeontx/timvf_evdev.h
index cef02cd..e7a63e4 100644
--- a/drivers/event/octeontx/timvf_evdev.h
+++ b/drivers/event/octeontx/timvf_evdev.h
@@ -123,7 +123,7 @@  enum timvf_clk_src {
 };
 
 /* TIM_MEM_BUCKET */
-struct tim_mem_bucket {
+struct __rte_aligned(8) tim_mem_bucket {
 	uint64_t first_chunk;
 	union {
 		uint64_t w1;
@@ -139,7 +139,7 @@  struct tim_mem_bucket {
 	};
 	uint64_t current_chunk;
 	uint64_t pad;
-} __rte_packed __rte_aligned(8);
+} __rte_packed;
 
 struct tim_mem_entry {
 	uint64_t w0;
@@ -160,7 +160,7 @@  struct timvf_ctrl_reg {
 		struct tim_mem_bucket * const bkt,
 		struct timvf_ring * const timr);
 
-struct timvf_ring {
+struct __rte_cache_aligned timvf_ring {
 	bkt_id get_target_bkt;
 	refill_chunk refill_chunk;
 	struct rte_reciprocal_u64 fast_div;
@@ -178,7 +178,7 @@  struct timvf_ring {
 	uint64_t nb_timers;
 	enum timvf_clk_src clk_src;
 	uint16_t tim_ring_id;
-} __rte_cache_aligned;
+};
 
 static __rte_always_inline uint32_t
 bkt_mod(const uint32_t rel_bkt, const uint32_t nb_bkts)
diff --git a/drivers/event/octeontx/timvf_worker.c b/drivers/event/octeontx/timvf_worker.c
index 50790e1..feb7c4d 100644
--- a/drivers/event/octeontx/timvf_worker.c
+++ b/drivers/event/octeontx/timvf_worker.c
@@ -146,7 +146,7 @@ 
 	uint16_t idx;
 	uint16_t arr_idx = 0;
 	struct timvf_ring *timr = adptr->data->adapter_priv;
-	struct tim_mem_entry entry[TIMVF_MAX_BURST] __rte_cache_aligned;
+	alignas(RTE_CACHE_LINE_SIZE) struct tim_mem_entry entry[TIMVF_MAX_BURST];
 
 	if (unlikely(!timeout_tick || timeout_tick >= timr->nb_bkts)) {
 		const enum rte_event_timer_state state = timeout_tick ?