From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B798F43E7E; Mon, 15 Apr 2024 22:12:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2DCB842E18; Mon, 15 Apr 2024 22:06:23 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 0146540DF5 for ; Mon, 15 Apr 2024 22:05:05 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 41A4B20FD8D1; Mon, 15 Apr 2024 13:04:47 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 41A4B20FD8D1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713211491; bh=jU/wciiNLTJm2GMuUcH80RvErDNkqyBOJNALLx6Zxvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y7mcpZLd7v/rlEgQfgL3ZzR3UQr0Jn68qIuFeyvgEjSGfirGCS2s4G2ORrtGE+wmq SCJLpiJ0h8Q5+w8VHEVC6QU4p+/46c+9TsUTFw898fqiWNIk1kaEg+OH4vl26JIfb6 C954xrhdlslzZioDWZb/0ANx0LyakmIq+/pz9quA= From: Tyler Retzlaff To: dev@dpdk.org Cc: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= , "Min Hu (Connor)" , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Abdullah Sevincer , Ajit Khaparde , Akhil Goyal , Alok Prasad , Amit Bernstein , Anatoly Burakov , Andrew Boyer , Andrew Rybchenko , Ankur Dwivedi , Anoob Joseph , Ashish Gupta , Ashwin Sekhar T K , Bruce Richardson , Byron Marohn , Chaoyong He , Chas Williams , Chenbo Xia , Chengwen Feng , Conor Walsh , Cristian Dumitrescu , Dariusz Sosnowski , David Hunt , Devendra Singh Rawat , Ed Czeck , Evgeny Schemeilin , Fan Zhang , Gagandeep Singh , Guoyang Zhou , Harman Kalra , Harry van Haaren , Hemant Agrawal , Honnappa Nagarahalli , Hyong Youb Kim , Jakub Grajciar , Jerin Jacob , Jian Wang , Jiawen Wu , Jie Hai , Jingjing Wu , John Daley , John Miller , Joyce Kong , Kai Ji , Kevin Laatz , Kiran Kumar K , Konstantin Ananyev , Lee Daly , Liang Ma , Liron Himi , Long Li , Maciej Czekaj , Matan Azrad , Matt Peters , Maxime Coquelin , Michael Shamis , Nagadheeraj Rottela , Nicolas Chautru , Nithin Dabilpuram , Ori Kam , Pablo de Lara , Pavan Nikhilesh , Peter Mccarthy , Radu Nicolau , Rahul Lakkireddy , Rakesh Kudurumalla , Raveendra Padasalagi , Reshma Pattan , Ron Beider , Ruifeng Wang , Sachin Saxena , Selwin Sebastian , Shai Brandes , Shepard Siegel , Shijith Thotton , Sivaprasad Tummala , Somnath Kotur , Srikanth Yalavarthi , Stephen Hemminger , Steven Webster , Suanming Mou , Sunil Kumar Kori , Sunil Uttarwar , Sunila Sahu , Tejasree Kondoj , Viacheslav Ovsiienko , Vikas Gupta , Volodymyr Fialko , Wajeeh Atrash , Wisam Jaddo , Xiaoyun Wang , Yipeng Wang , Yisen Zhuang , Yuying Zhang , Zhangfei Gao , Zhirun Yan , Ziyang Xuan , Tyler Retzlaff Subject: [PATCH v2 46/83] event/cnxk: move alignment attribute on types Date: Mon, 15 Apr 2024 13:04:08 -0700 Message-Id: <1713211485-9021-47-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1713211485-9021-1-git-send-email-roretzla@linux.microsoft.com> References: <1710949096-5786-1-git-send-email-roretzla@linux.microsoft.com> <1713211485-9021-1-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 Acked-by: Morten Brørup --- drivers/event/cnxk/cn10k_eventdev.h | 8 ++++---- drivers/event/cnxk/cnxk_eventdev.h | 24 ++++++++++++------------ drivers/event/cnxk/cnxk_tim_evdev.h | 4 ++-- drivers/event/cnxk/cnxk_tim_worker.c | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/event/cnxk/cn10k_eventdev.h b/drivers/event/cnxk/cn10k_eventdev.h index e79b68e..3721214 100644 --- a/drivers/event/cnxk/cn10k_eventdev.h +++ b/drivers/event/cnxk/cn10k_eventdev.h @@ -8,7 +8,7 @@ #define CN10K_SSO_DEFAULT_STASH_OFFSET -1 #define CN10K_SSO_DEFAULT_STASH_LENGTH 2 -struct cn10k_sso_hws { +struct __rte_cache_aligned cn10k_sso_hws { uint64_t base; uint32_t gw_wdata; void *lookup_mem; @@ -19,15 +19,15 @@ struct cn10k_sso_hws { struct cnxk_timesync_info **tstamp; uint64_t meta_aura; /* Add Work Fastpath data */ - int64_t *fc_mem __rte_cache_aligned; + alignas(RTE_CACHE_LINE_SIZE) int64_t *fc_mem; int64_t *fc_cache_space; uintptr_t aw_lmt; uintptr_t grp_base; int32_t xaq_lmt; /* Tx Fastpath data */ - uintptr_t lmt_base __rte_cache_aligned; + alignas(RTE_CACHE_LINE_SIZE) uintptr_t lmt_base; uint64_t lso_tun_fmt; uint8_t tx_adptr_data[]; -} __rte_cache_aligned; +}; #endif /* __CN10K_EVENTDEV_H__ */ diff --git a/drivers/event/cnxk/cnxk_eventdev.h b/drivers/event/cnxk/cnxk_eventdev.h index fa99ded..ece4939 100644 --- a/drivers/event/cnxk/cnxk_eventdev.h +++ b/drivers/event/cnxk/cnxk_eventdev.h @@ -80,7 +80,7 @@ struct cnxk_sso_stash { uint16_t stash_length; }; -struct cnxk_sso_evdev { +struct __rte_cache_aligned cnxk_sso_evdev { struct roc_sso sso; uint8_t max_event_queues; uint8_t max_event_ports; @@ -124,10 +124,10 @@ struct cnxk_sso_evdev { uint32_t gw_mode; uint16_t stash_cnt; struct cnxk_sso_stash *stash_parse_data; -} __rte_cache_aligned; +}; /* Event port a.k.a GWS */ -struct cn9k_sso_hws { +struct __rte_cache_aligned cn9k_sso_hws { uint64_t base; uint64_t gw_wdata; void *lookup_mem; @@ -136,15 +136,15 @@ struct cn9k_sso_hws { /* PTP timestamp */ struct cnxk_timesync_info **tstamp; /* Add Work Fastpath data */ - uint64_t xaq_lmt __rte_cache_aligned; + alignas(RTE_CACHE_LINE_SIZE) uint64_t xaq_lmt; uint64_t *fc_mem; uintptr_t grp_base; /* Tx Fastpath data */ - uint64_t lso_tun_fmt __rte_cache_aligned; + alignas(RTE_CACHE_LINE_SIZE) uint64_t lso_tun_fmt; uint8_t tx_adptr_data[]; -} __rte_cache_aligned; +}; -struct cn9k_sso_hws_dual { +struct __rte_cache_aligned cn9k_sso_hws_dual { uint64_t base[2]; /* Ping and Pong */ uint64_t gw_wdata; void *lookup_mem; @@ -154,18 +154,18 @@ struct cn9k_sso_hws_dual { /* PTP timestamp */ struct cnxk_timesync_info **tstamp; /* Add Work Fastpath data */ - uint64_t xaq_lmt __rte_cache_aligned; + alignas(RTE_CACHE_LINE_SIZE) uint64_t xaq_lmt; uint64_t *fc_mem; uintptr_t grp_base; /* Tx Fastpath data */ - uint64_t lso_tun_fmt __rte_cache_aligned; + alignas(RTE_CACHE_LINE_SIZE) uint64_t lso_tun_fmt; uint8_t tx_adptr_data[]; -} __rte_cache_aligned; +}; -struct cnxk_sso_hws_cookie { +struct __rte_cache_aligned cnxk_sso_hws_cookie { const struct rte_eventdev *event_dev; bool configured; -} __rte_cache_aligned; +}; static inline int parse_kvargs_flag(const char *key, const char *value, void *opaque) diff --git a/drivers/event/cnxk/cnxk_tim_evdev.h b/drivers/event/cnxk/cnxk_tim_evdev.h index b91fcb3..6cf10db 100644 --- a/drivers/event/cnxk/cnxk_tim_evdev.h +++ b/drivers/event/cnxk/cnxk_tim_evdev.h @@ -123,7 +123,7 @@ struct cnxk_tim_bkt { uint64_t pad; }; -struct cnxk_tim_ring { +struct __rte_cache_aligned cnxk_tim_ring { uint16_t nb_chunk_slots; uint32_t nb_bkts; uintptr_t tbase; @@ -149,7 +149,7 @@ struct cnxk_tim_ring { uint64_t nb_chunks; uint64_t chunk_sz; enum roc_tim_clk_src clk_src; -} __rte_cache_aligned; +}; struct cnxk_tim_ent { uint64_t w0; diff --git a/drivers/event/cnxk/cnxk_tim_worker.c b/drivers/event/cnxk/cnxk_tim_worker.c index 944490d..1f2f2fe 100644 --- a/drivers/event/cnxk/cnxk_tim_worker.c +++ b/drivers/event/cnxk/cnxk_tim_worker.c @@ -92,7 +92,7 @@ const uint64_t timeout_tick, const uint16_t nb_timers, const uint8_t flags) { - struct cnxk_tim_ent entry[CNXK_TIM_MAX_BURST] __rte_cache_aligned; + alignas(RTE_CACHE_LINE_SIZE) struct cnxk_tim_ent entry[CNXK_TIM_MAX_BURST]; struct cnxk_tim_ring *tim_ring = adptr->data->adapter_priv; uint16_t set_timers = 0; uint16_t arr_idx = 0; -- 1.8.3.1