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 8F1BE43D05; Wed, 20 Mar 2024 16:45:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3191442EBE; Wed, 20 Mar 2024 16:39:42 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 01F6F42D9A for ; Wed, 20 Mar 2024 16:38:39 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 46E53208B324; Wed, 20 Mar 2024 08:38:22 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 46E53208B324 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1710949105; bh=HICI3sSArcDJ9jWFDmNo9bPjBBobtkTIOMhkDEyevEQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Omu6pDNhKH18dLUvMyWStd26fgjoHbHIDCbxfMsKwI/llqm9C0gnIxRMxwNBuBKEh jIf5I9cCAZoXSwdk2NRstaHFUTkyQ4FRNtFe6sFgS7tBIF18/dsrLefRI7hy1eLl7N 0+yVuY/OzPx1KE905CD0yAoykbHpJXxvC5DdsWIs= 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 , Junfeng Guo , 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 80/83] app/test-eventdev: move alignment attribute on types Date: Wed, 20 Mar 2024 08:38:13 -0700 Message-Id: <1710949096-5786-81-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1710949096-5786-1-git-send-email-roretzla@linux.microsoft.com> References: <1710949096-5786-1-git-send-email-roretzla@linux.microsoft.com> 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 --- app/test-eventdev/test_order_common.h | 4 ++-- app/test-eventdev/test_perf_common.h | 24 ++++++++++++------------ app/test-eventdev/test_pipeline_common.h | 18 +++++++++--------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/app/test-eventdev/test_order_common.h b/app/test-eventdev/test_order_common.h index 1507265..d4cbc5c 100644 --- a/app/test-eventdev/test_order_common.h +++ b/app/test-eventdev/test_order_common.h @@ -39,7 +39,7 @@ struct prod_data { struct test_order *t; }; -struct test_order { +struct __rte_cache_aligned test_order { /* Don't change the offset of "err". Signal handler use this memory * to terminate all lcores work. */ @@ -60,7 +60,7 @@ struct test_order { uint32_t *producer_flow_seq; uint32_t *expected_flow_seq; struct evt_options *opt; -} __rte_cache_aligned; +}; static inline void order_flow_id_copy_from_mbuf(struct test_order *t, struct rte_event *event) diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h index 2b4f572..bc627de 100644 --- a/app/test-eventdev/test_perf_common.h +++ b/app/test-eventdev/test_perf_common.h @@ -31,13 +31,13 @@ struct test_perf; -struct worker_data { +struct __rte_cache_aligned worker_data { uint64_t processed_pkts; uint64_t latency; uint8_t dev_id; uint8_t port_id; struct test_perf *t; -} __rte_cache_aligned; +}; struct crypto_adptr_data { uint8_t cdev_id; @@ -51,16 +51,16 @@ struct dma_adptr_data { void **dma_op; }; -struct prod_data { +struct __rte_cache_aligned prod_data { uint8_t dev_id; uint8_t port_id; uint8_t queue_id; struct crypto_adptr_data ca; struct dma_adptr_data da; struct test_perf *t; -} __rte_cache_aligned; +}; -struct test_perf { +struct __rte_cache_aligned test_perf { /* Don't change the offset of "done". Signal handler use this memory * to terminate all lcores work. */ @@ -74,17 +74,17 @@ struct test_perf { struct prod_data prod[EVT_MAX_PORTS]; struct worker_data worker[EVT_MAX_PORTS]; struct evt_options *opt; - uint8_t sched_type_list[EVT_MAX_STAGES] __rte_cache_aligned; - struct rte_event_timer_adapter *timer_adptr[ - RTE_EVENT_TIMER_ADAPTER_NUM_MAX] __rte_cache_aligned; + alignas(RTE_CACHE_LINE_SIZE) uint8_t sched_type_list[EVT_MAX_STAGES]; + alignas(RTE_CACHE_LINE_SIZE) struct rte_event_timer_adapter *timer_adptr[ + RTE_EVENT_TIMER_ADAPTER_NUM_MAX]; struct rte_mempool *ca_op_pool; struct rte_mempool *ca_sess_pool; struct rte_mempool *ca_asym_sess_pool; struct rte_mempool *ca_vector_pool; struct rte_mempool *da_op_pool; -} __rte_cache_aligned; +}; -struct perf_elt { +struct __rte_cache_aligned perf_elt { union { struct rte_event_timer tim; struct { @@ -92,7 +92,7 @@ struct perf_elt { uint64_t timestamp; }; }; -} __rte_cache_aligned; +}; #define BURST_SIZE 16 #define MAX_PROD_ENQ_BURST_SIZE 128 @@ -111,7 +111,7 @@ struct perf_elt { const uint8_t nb_stages = t->opt->nb_stages;\ const uint8_t laststage = nb_stages - 1;\ uint8_t cnt = 0;\ - void *bufs[16] __rte_cache_aligned;\ + alignas(RTE_CACHE_LINE_SIZE) void *bufs[16];\ int const sz = RTE_DIM(bufs);\ uint8_t stage;\ struct perf_elt *pe = NULL;\ diff --git a/app/test-eventdev/test_pipeline_common.h b/app/test-eventdev/test_pipeline_common.h index 2b7f3e7..cb6375f 100644 --- a/app/test-eventdev/test_pipeline_common.h +++ b/app/test-eventdev/test_pipeline_common.h @@ -31,14 +31,14 @@ struct test_pipeline; -struct worker_data { +struct __rte_cache_aligned worker_data { uint64_t processed_pkts; uint8_t dev_id; uint8_t port_id; struct test_pipeline *t; -} __rte_cache_aligned; +}; -struct test_pipeline { +struct __rte_cache_aligned test_pipeline { /* Don't change the offset of "done". Signal handler use this memory * to terminate all lcores work. */ @@ -52,8 +52,8 @@ struct test_pipeline { struct rte_mempool *pool[RTE_MAX_ETHPORTS]; struct worker_data worker[EVT_MAX_PORTS]; struct evt_options *opt; - uint8_t sched_type_list[EVT_MAX_STAGES] __rte_cache_aligned; -} __rte_cache_aligned; + alignas(RTE_CACHE_LINE_SIZE) uint8_t sched_type_list[EVT_MAX_STAGES]; +}; #define BURST_SIZE 16 @@ -62,7 +62,7 @@ struct test_pipeline { struct test_pipeline *t = w->t; \ const uint8_t dev = w->dev_id; \ const uint8_t port = w->port_id; \ - struct rte_event ev __rte_cache_aligned + alignas(RTE_CACHE_LINE_SIZE) struct rte_event ev #define PIPELINE_WORKER_SINGLE_STAGE_BURST_INIT \ int i; \ @@ -70,7 +70,7 @@ struct test_pipeline { struct test_pipeline *t = w->t; \ const uint8_t dev = w->dev_id; \ const uint8_t port = w->port_id; \ - struct rte_event ev[BURST_SIZE + 1] __rte_cache_aligned + alignas(RTE_CACHE_LINE_SIZE) struct rte_event ev[BURST_SIZE + 1] #define PIPELINE_WORKER_MULTI_STAGE_INIT \ struct worker_data *w = arg; \ @@ -81,7 +81,7 @@ struct test_pipeline { const uint8_t last_queue = t->opt->nb_stages - 1; \ uint8_t *const sched_type_list = &t->sched_type_list[0]; \ const uint8_t nb_stages = t->opt->nb_stages + 1; \ - struct rte_event ev __rte_cache_aligned + alignas(RTE_CACHE_LINE_SIZE) struct rte_event ev #define PIPELINE_WORKER_MULTI_STAGE_BURST_INIT \ int i; \ @@ -93,7 +93,7 @@ struct test_pipeline { const uint8_t last_queue = t->opt->nb_stages - 1; \ uint8_t *const sched_type_list = &t->sched_type_list[0]; \ const uint8_t nb_stages = t->opt->nb_stages + 1; \ - struct rte_event ev[BURST_SIZE + 1] __rte_cache_aligned + alignas(RTE_CACHE_LINE_SIZE) struct rte_event ev[BURST_SIZE + 1] static __rte_always_inline void pipeline_fwd_event(struct rte_event *ev, uint8_t sched) -- 1.8.3.1