* [PATCH 0/9] use C11 alignof
@ 2024-01-24 23:17 Tyler Retzlaff
2024-01-24 23:17 ` [PATCH 1/9] ring: " Tyler Retzlaff
` (12 more replies)
0 siblings, 13 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-01-24 23:17 UTC (permalink / raw)
To: dev
Cc: Akhil Goyal, Andrew Rybchenko, Anoob Joseph, Ferruh Yigit,
Honnappa Nagarahalli, Jerin Jacob, Konstantin Ananyev,
Nithin Dabilpuram, Ori Kam, Pavan Nikhilesh, Thomas Monjalon,
Volodymyr Fialko, Tyler Retzlaff
Replace use of __alignof__(T) and __alignof__(e) with C11 alignof(T)
and alignof(typeof(e)) respectively to improve portability of the code
between toolchains.
Tyler Retzlaff (9):
ring: use C11 alignof
mbuf: use C11 alignof
ethdev: use C11 alignof
eventdev: use C11 alignof
stack: use C11 alignof
node: use C11 alignof
pdcp: use C11 alignof
reorder: use C11 alignof
security: use C11 alignof
lib/ethdev/ethdev_driver.c | 3 ++-
lib/ethdev/rte_flow.c | 3 ++-
lib/eventdev/rte_eventdev.c | 3 ++-
lib/mbuf/rte_mbuf_dyn.c | 3 ++-
lib/node/node_private.h | 4 +++-
lib/pdcp/rte_pdcp.c | 4 +++-
lib/reorder/rte_reorder.c | 3 ++-
lib/ring/rte_ring.c | 3 ++-
lib/security/rte_security.c | 5 +++--
lib/stack/rte_stack.c | 3 ++-
10 files changed, 23 insertions(+), 11 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 1/9] ring: use C11 alignof
2024-01-24 23:17 [PATCH 0/9] use C11 alignof Tyler Retzlaff
@ 2024-01-24 23:17 ` Tyler Retzlaff
2024-01-24 23:17 ` [PATCH 2/9] mbuf: " Tyler Retzlaff
` (11 subsequent siblings)
12 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-01-24 23:17 UTC (permalink / raw)
To: dev
Cc: Akhil Goyal, Andrew Rybchenko, Anoob Joseph, Ferruh Yigit,
Honnappa Nagarahalli, Jerin Jacob, Konstantin Ananyev,
Nithin Dabilpuram, Ori Kam, Pavan Nikhilesh, Thomas Monjalon,
Volodymyr Fialko, Tyler Retzlaff
Replace use of __alignof__(e) with C11 alignof(typeof(e)) to improve
portability between toolchains
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/ring/rte_ring.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/ring/rte_ring.c b/lib/ring/rte_ring.c
index c59f626..a783299 100644
--- a/lib/ring/rte_ring.c
+++ b/lib/ring/rte_ring.c
@@ -7,6 +7,7 @@
* Used as BSD-3 Licensed with permission from Kip Macy.
*/
+#include <stdalign.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
@@ -288,7 +289,7 @@ struct rte_ring *
* rte_errno for us appropriately - hence no check in this function
*/
mz = rte_memzone_reserve_aligned(mz_name, ring_size, socket_id,
- mz_flags, __alignof__(*r));
+ mz_flags, alignof(typeof(*r)));
if (mz != NULL) {
r = mz->addr;
/* no need to check return value here, we already checked the
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 2/9] mbuf: use C11 alignof
2024-01-24 23:17 [PATCH 0/9] use C11 alignof Tyler Retzlaff
2024-01-24 23:17 ` [PATCH 1/9] ring: " Tyler Retzlaff
@ 2024-01-24 23:17 ` Tyler Retzlaff
2024-01-24 23:17 ` [PATCH 3/9] ethdev: " Tyler Retzlaff
` (10 subsequent siblings)
12 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-01-24 23:17 UTC (permalink / raw)
To: dev
Cc: Akhil Goyal, Andrew Rybchenko, Anoob Joseph, Ferruh Yigit,
Honnappa Nagarahalli, Jerin Jacob, Konstantin Ananyev,
Nithin Dabilpuram, Ori Kam, Pavan Nikhilesh, Thomas Monjalon,
Volodymyr Fialko, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/mbuf/rte_mbuf_dyn.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/mbuf/rte_mbuf_dyn.c b/lib/mbuf/rte_mbuf_dyn.c
index 446018f..1cfb329 100644
--- a/lib/mbuf/rte_mbuf_dyn.c
+++ b/lib/mbuf/rte_mbuf_dyn.c
@@ -2,6 +2,7 @@
* Copyright 2019 6WIND S.A.
*/
+#include <stdalign.h>
#include <sys/queue.h>
#include <stdint.h>
#include <limits.h>
@@ -585,7 +586,7 @@ void rte_mbuf_dyn_dump(FILE *out)
static const struct rte_mbuf_dynfield field_desc = {
.name = RTE_MBUF_DYNFIELD_TIMESTAMP_NAME,
.size = sizeof(rte_mbuf_timestamp_t),
- .align = __alignof__(rte_mbuf_timestamp_t),
+ .align = alignof(rte_mbuf_timestamp_t),
};
struct rte_mbuf_dynflag flag_desc = {};
int offset;
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 3/9] ethdev: use C11 alignof
2024-01-24 23:17 [PATCH 0/9] use C11 alignof Tyler Retzlaff
2024-01-24 23:17 ` [PATCH 1/9] ring: " Tyler Retzlaff
2024-01-24 23:17 ` [PATCH 2/9] mbuf: " Tyler Retzlaff
@ 2024-01-24 23:17 ` Tyler Retzlaff
2024-01-24 23:17 ` [PATCH 4/9] eventdev: " Tyler Retzlaff
` (9 subsequent siblings)
12 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-01-24 23:17 UTC (permalink / raw)
To: dev
Cc: Akhil Goyal, Andrew Rybchenko, Anoob Joseph, Ferruh Yigit,
Honnappa Nagarahalli, Jerin Jacob, Konstantin Ananyev,
Nithin Dabilpuram, Ori Kam, Pavan Nikhilesh, Thomas Monjalon,
Volodymyr Fialko, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/ethdev/ethdev_driver.c | 3 ++-
lib/ethdev/rte_flow.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/ethdev/ethdev_driver.c b/lib/ethdev/ethdev_driver.c
index bd917a1..4d45fbd 100644
--- a/lib/ethdev/ethdev_driver.c
+++ b/lib/ethdev/ethdev_driver.c
@@ -2,6 +2,7 @@
* Copyright(c) 2022 Intel Corporation
*/
+#include <stdalign.h>
#include <stdlib.h>
#include <pthread.h>
@@ -633,7 +634,7 @@ struct rte_eth_dev *
static const struct rte_mbuf_dynfield field_desc = {
.name = RTE_MBUF_DYNFIELD_IP_REASSEMBLY_NAME,
.size = sizeof(rte_eth_ip_reassembly_dynfield_t),
- .align = __alignof__(rte_eth_ip_reassembly_dynfield_t),
+ .align = alignof(rte_eth_ip_reassembly_dynfield_t),
};
static const struct rte_mbuf_dynflag ip_reassembly_dynflag = {
.name = RTE_MBUF_DYNFLAG_IP_REASSEMBLY_INCOMPLETE_NAME,
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index f49d1d3..2cd30d6 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -3,6 +3,7 @@
* Copyright 2016 Mellanox Technologies, Ltd
*/
+#include <stdalign.h>
#include <errno.h>
#include <stddef.h>
#include <stdint.h>
@@ -281,7 +282,7 @@ struct rte_flow_desc_data {
static const struct rte_mbuf_dynfield desc_offs = {
.name = RTE_MBUF_DYNFIELD_METADATA_NAME,
.size = sizeof(uint32_t),
- .align = __alignof__(uint32_t),
+ .align = alignof(uint32_t),
};
static const struct rte_mbuf_dynflag desc_flag = {
.name = RTE_MBUF_DYNFLAG_METADATA_NAME,
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 4/9] eventdev: use C11 alignof
2024-01-24 23:17 [PATCH 0/9] use C11 alignof Tyler Retzlaff
` (2 preceding siblings ...)
2024-01-24 23:17 ` [PATCH 3/9] ethdev: " Tyler Retzlaff
@ 2024-01-24 23:17 ` Tyler Retzlaff
2024-01-24 23:17 ` [PATCH 5/9] stack: " Tyler Retzlaff
` (8 subsequent siblings)
12 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-01-24 23:17 UTC (permalink / raw)
To: dev
Cc: Akhil Goyal, Andrew Rybchenko, Anoob Joseph, Ferruh Yigit,
Honnappa Nagarahalli, Jerin Jacob, Konstantin Ananyev,
Nithin Dabilpuram, Ori Kam, Pavan Nikhilesh, Thomas Monjalon,
Volodymyr Fialko, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/eventdev/rte_eventdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index 94628a6..d494f8f 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -2,6 +2,7 @@
* Copyright(c) 2016 Cavium, Inc
*/
+#include <stdalign.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
@@ -1405,7 +1406,7 @@ int rte_event_dev_selftest(uint8_t dev_id)
static const struct rte_mbuf_dynfield test_seqn_dynfield_desc = {
.name = "rte_event_pmd_selftest_seqn_dynfield",
.size = sizeof(rte_event_pmd_selftest_seqn_t),
- .align = __alignof__(rte_event_pmd_selftest_seqn_t),
+ .align = alignof(rte_event_pmd_selftest_seqn_t),
};
struct rte_eventdev *dev = &rte_eventdevs[dev_id];
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 5/9] stack: use C11 alignof
2024-01-24 23:17 [PATCH 0/9] use C11 alignof Tyler Retzlaff
` (3 preceding siblings ...)
2024-01-24 23:17 ` [PATCH 4/9] eventdev: " Tyler Retzlaff
@ 2024-01-24 23:17 ` Tyler Retzlaff
2024-01-24 23:17 ` [PATCH 6/9] node: " Tyler Retzlaff
` (7 subsequent siblings)
12 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-01-24 23:17 UTC (permalink / raw)
To: dev
Cc: Akhil Goyal, Andrew Rybchenko, Anoob Joseph, Ferruh Yigit,
Honnappa Nagarahalli, Jerin Jacob, Konstantin Ananyev,
Nithin Dabilpuram, Ori Kam, Pavan Nikhilesh, Thomas Monjalon,
Volodymyr Fialko, Tyler Retzlaff
Replace use of __alignof__(e) with C11 alignof(typeof(e)) to improve
portability between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/stack/rte_stack.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/stack/rte_stack.c b/lib/stack/rte_stack.c
index 1dab6d6..7261281 100644
--- a/lib/stack/rte_stack.c
+++ b/lib/stack/rte_stack.c
@@ -2,6 +2,7 @@
* Copyright(c) 2019 Intel Corporation
*/
+#include <stdalign.h>
#include <string.h>
#include <sys/queue.h>
@@ -90,7 +91,7 @@ struct rte_stack *
rte_mcfg_tailq_write_lock();
mz = rte_memzone_reserve_aligned(mz_name, sz, socket_id,
- 0, __alignof__(*s));
+ 0, alignof(typeof(*s)));
if (mz == NULL) {
STACK_LOG_ERR("Cannot reserve stack memzone!");
rte_mcfg_tailq_write_unlock();
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 6/9] node: use C11 alignof
2024-01-24 23:17 [PATCH 0/9] use C11 alignof Tyler Retzlaff
` (4 preceding siblings ...)
2024-01-24 23:17 ` [PATCH 5/9] stack: " Tyler Retzlaff
@ 2024-01-24 23:17 ` Tyler Retzlaff
2024-01-24 23:17 ` [PATCH 7/9] pdcp: " Tyler Retzlaff
` (6 subsequent siblings)
12 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-01-24 23:17 UTC (permalink / raw)
To: dev
Cc: Akhil Goyal, Andrew Rybchenko, Anoob Joseph, Ferruh Yigit,
Honnappa Nagarahalli, Jerin Jacob, Konstantin Ananyev,
Nithin Dabilpuram, Ori Kam, Pavan Nikhilesh, Thomas Monjalon,
Volodymyr Fialko, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/node/node_private.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/node/node_private.h b/lib/node/node_private.h
index 845fdaa..92acb9b 100644
--- a/lib/node/node_private.h
+++ b/lib/node/node_private.h
@@ -5,6 +5,8 @@
#ifndef __NODE_PRIVATE_H__
#define __NODE_PRIVATE_H__
+#include <stdalign.h>
+
#include <rte_common.h>
#include <rte_log.h>
#include <rte_mbuf.h>
@@ -42,7 +44,7 @@ struct node_mbuf_priv1 {
static const struct rte_mbuf_dynfield node_mbuf_priv1_dynfield_desc = {
.name = "rte_node_dynfield_priv1",
.size = sizeof(struct node_mbuf_priv1),
- .align = __alignof__(struct node_mbuf_priv1),
+ .align = alignof(struct node_mbuf_priv1),
};
extern int node_mbuf_priv1_dynfield_offset;
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 7/9] pdcp: use C11 alignof
2024-01-24 23:17 [PATCH 0/9] use C11 alignof Tyler Retzlaff
` (5 preceding siblings ...)
2024-01-24 23:17 ` [PATCH 6/9] node: " Tyler Retzlaff
@ 2024-01-24 23:17 ` Tyler Retzlaff
2024-01-25 4:36 ` [EXT] " Anoob Joseph
2024-01-24 23:17 ` [PATCH 8/9] reorder: " Tyler Retzlaff
` (5 subsequent siblings)
12 siblings, 1 reply; 40+ messages in thread
From: Tyler Retzlaff @ 2024-01-24 23:17 UTC (permalink / raw)
To: dev
Cc: Akhil Goyal, Andrew Rybchenko, Anoob Joseph, Ferruh Yigit,
Honnappa Nagarahalli, Jerin Jacob, Konstantin Ananyev,
Nithin Dabilpuram, Ori Kam, Pavan Nikhilesh, Thomas Monjalon,
Volodymyr Fialko, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/pdcp/rte_pdcp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/pdcp/rte_pdcp.c b/lib/pdcp/rte_pdcp.c
index 1c6d246..1c076fb 100644
--- a/lib/pdcp/rte_pdcp.c
+++ b/lib/pdcp/rte_pdcp.c
@@ -2,6 +2,8 @@
* Copyright(C) 2023 Marvell.
*/
+#include <stdalign.h>
+
#include <rte_errno.h>
#include <rte_pdcp.h>
#include <rte_malloc.h>
@@ -32,7 +34,7 @@ struct entity_layout {
const struct rte_mbuf_dynfield dynfield_desc = {
.name = RTE_PDCP_DYNFIELD_NAME,
.size = sizeof(rte_pdcp_dynfield_t),
- .align = __alignof__(rte_pdcp_dynfield_t),
+ .align = alignof(rte_pdcp_dynfield_t),
};
if (rte_pdcp_dynfield_offset != -1)
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 8/9] reorder: use C11 alignof
2024-01-24 23:17 [PATCH 0/9] use C11 alignof Tyler Retzlaff
` (6 preceding siblings ...)
2024-01-24 23:17 ` [PATCH 7/9] pdcp: " Tyler Retzlaff
@ 2024-01-24 23:17 ` Tyler Retzlaff
2024-01-25 0:36 ` [EXT] " Volodymyr Fialko
2024-01-24 23:17 ` [PATCH 9/9] security: " Tyler Retzlaff
` (4 subsequent siblings)
12 siblings, 1 reply; 40+ messages in thread
From: Tyler Retzlaff @ 2024-01-24 23:17 UTC (permalink / raw)
To: dev
Cc: Akhil Goyal, Andrew Rybchenko, Anoob Joseph, Ferruh Yigit,
Honnappa Nagarahalli, Jerin Jacob, Konstantin Ananyev,
Nithin Dabilpuram, Ori Kam, Pavan Nikhilesh, Thomas Monjalon,
Volodymyr Fialko, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/reorder/rte_reorder.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/reorder/rte_reorder.c b/lib/reorder/rte_reorder.c
index ff81544..c080b2c 100644
--- a/lib/reorder/rte_reorder.c
+++ b/lib/reorder/rte_reorder.c
@@ -2,6 +2,7 @@
* Copyright(c) 2010-2014 Intel Corporation
*/
+#include <stdalign.h>
#include <string.h>
#include <sys/queue.h>
@@ -72,7 +73,7 @@ struct rte_reorder_buffer *
static const struct rte_mbuf_dynfield reorder_seqn_dynfield_desc = {
.name = RTE_REORDER_SEQN_DYNFIELD_NAME,
.size = sizeof(rte_reorder_seqn_t),
- .align = __alignof__(rte_reorder_seqn_t),
+ .align = alignof(rte_reorder_seqn_t),
};
if (b == NULL) {
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 9/9] security: use C11 alignof
2024-01-24 23:17 [PATCH 0/9] use C11 alignof Tyler Retzlaff
` (7 preceding siblings ...)
2024-01-24 23:17 ` [PATCH 8/9] reorder: " Tyler Retzlaff
@ 2024-01-24 23:17 ` Tyler Retzlaff
2024-01-25 6:28 ` [EXT] " Akhil Goyal
2024-01-25 7:19 ` [PATCH 0/9] " Morten Brørup
` (3 subsequent siblings)
12 siblings, 1 reply; 40+ messages in thread
From: Tyler Retzlaff @ 2024-01-24 23:17 UTC (permalink / raw)
To: dev
Cc: Akhil Goyal, Andrew Rybchenko, Anoob Joseph, Ferruh Yigit,
Honnappa Nagarahalli, Jerin Jacob, Konstantin Ananyev,
Nithin Dabilpuram, Ori Kam, Pavan Nikhilesh, Thomas Monjalon,
Volodymyr Fialko, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/security/rte_security.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c
index b082a29..e5c862f 100644
--- a/lib/security/rte_security.c
+++ b/lib/security/rte_security.c
@@ -4,6 +4,7 @@
* Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
*/
+#include <stdalign.h>
#include <ctype.h>
#include <stdlib.h>
@@ -38,7 +39,7 @@
static const struct rte_mbuf_dynfield dynfield_desc = {
.name = RTE_SECURITY_DYNFIELD_NAME,
.size = sizeof(rte_security_dynfield_t),
- .align = __alignof__(rte_security_dynfield_t),
+ .align = alignof(rte_security_dynfield_t),
};
rte_security_dynfield_offset =
rte_mbuf_dynfield_register(&dynfield_desc);
@@ -51,7 +52,7 @@
static const struct rte_mbuf_dynfield dynfield_desc = {
.name = RTE_SECURITY_OOP_DYNFIELD_NAME,
.size = sizeof(rte_security_oop_dynfield_t),
- .align = __alignof__(rte_security_oop_dynfield_t),
+ .align = alignof(rte_security_oop_dynfield_t),
};
rte_security_oop_dynfield_offset =
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* RE: [EXT] [PATCH 8/9] reorder: use C11 alignof
2024-01-24 23:17 ` [PATCH 8/9] reorder: " Tyler Retzlaff
@ 2024-01-25 0:36 ` Volodymyr Fialko
0 siblings, 0 replies; 40+ messages in thread
From: Volodymyr Fialko @ 2024-01-25 0:36 UTC (permalink / raw)
To: Tyler Retzlaff, dev
Cc: Akhil Goyal, Andrew Rybchenko, Anoob Joseph, Ferruh Yigit,
Honnappa Nagarahalli, Jerin Jacob, Konstantin Ananyev,
Nithin Kumar Dabilpuram, Ori Kam, Pavan Nikhilesh Bhagavatula,
Thomas Monjalon
> -----Original Message-----
> From: Tyler Retzlaff <roretzla@linux.microsoft.com>
> Sent: Thursday, January 25, 2024 12:18 AM
> To: dev@dpdk.org
> Cc: Akhil Goyal <gakhil@marvell.com>; Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>;
> Anoob Joseph <anoobj@marvell.com>; Ferruh Yigit <ferruh.yigit@amd.com>; Honnappa Nagarahalli
> <honnappa.nagarahalli@arm.com>; Jerin Jacob <jerinj@marvell.com>; Konstantin Ananyev
> <konstantin.v.ananyev@yandex.ru>; Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; Ori Kam
> <orika@nvidia.com>; Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; Thomas Monjalon
> <thomas@monjalon.net>; Volodymyr Fialko <vfialko@marvell.com>; Tyler Retzlaff
> <roretzla@linux.microsoft.com>
> Subject: [EXT] [PATCH 8/9] reorder: use C11 alignof
>
> External Email
>
> ----------------------------------------------------------------------
> Replace use of __alignof__(T) with C11 alignof(T) to improve portability between toolchains.
>
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> ---
> lib/reorder/rte_reorder.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
__alignof__ is supported by GCC from C99, but since DPDK 23.11 C11 compiler is required anyway, It should be fine to switch.
Acked-by: Volodymyr Fialko <vfialko@marvell.com>
/Volodymyr
^ permalink raw reply [flat|nested] 40+ messages in thread
* RE: [EXT] [PATCH 7/9] pdcp: use C11 alignof
2024-01-24 23:17 ` [PATCH 7/9] pdcp: " Tyler Retzlaff
@ 2024-01-25 4:36 ` Anoob Joseph
0 siblings, 0 replies; 40+ messages in thread
From: Anoob Joseph @ 2024-01-25 4:36 UTC (permalink / raw)
To: Tyler Retzlaff, dev
Cc: Akhil Goyal, Andrew Rybchenko, Ferruh Yigit,
Honnappa Nagarahalli, Jerin Jacob, Konstantin Ananyev,
Nithin Kumar Dabilpuram, Ori Kam, Pavan Nikhilesh Bhagavatula,
Thomas Monjalon, Volodymyr Fialko
>
> External Email
>
> ----------------------------------------------------------------------
> Replace use of __alignof__(T) with C11 alignof(T) to improve portability
> between toolchains.
>
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
^ permalink raw reply [flat|nested] 40+ messages in thread
* RE: [EXT] [PATCH 9/9] security: use C11 alignof
2024-01-24 23:17 ` [PATCH 9/9] security: " Tyler Retzlaff
@ 2024-01-25 6:28 ` Akhil Goyal
0 siblings, 0 replies; 40+ messages in thread
From: Akhil Goyal @ 2024-01-25 6:28 UTC (permalink / raw)
To: Tyler Retzlaff, dev
Cc: Andrew Rybchenko, Anoob Joseph, Ferruh Yigit,
Honnappa Nagarahalli, Jerin Jacob, Konstantin Ananyev,
Nithin Kumar Dabilpuram, Ori Kam, Pavan Nikhilesh Bhagavatula,
Thomas Monjalon, Volodymyr Fialko
> Replace use of __alignof__(T) with C11 alignof(T) to improve portability
> between toolchains.
>
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
^ permalink raw reply [flat|nested] 40+ messages in thread
* RE: [PATCH 0/9] use C11 alignof
2024-01-24 23:17 [PATCH 0/9] use C11 alignof Tyler Retzlaff
` (8 preceding siblings ...)
2024-01-24 23:17 ` [PATCH 9/9] security: " Tyler Retzlaff
@ 2024-01-25 7:19 ` Morten Brørup
2024-01-25 12:51 ` fengchengwen
` (2 subsequent siblings)
12 siblings, 0 replies; 40+ messages in thread
From: Morten Brørup @ 2024-01-25 7:19 UTC (permalink / raw)
To: Tyler Retzlaff, dev
Cc: Akhil Goyal, Andrew Rybchenko, Anoob Joseph, Ferruh Yigit,
Honnappa Nagarahalli, Jerin Jacob, Konstantin Ananyev,
Nithin Dabilpuram, Ori Kam, Pavan Nikhilesh, Thomas Monjalon,
Volodymyr Fialko
> From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com]
> Sent: Thursday, 25 January 2024 00.18
>
> Replace use of __alignof__(T) and __alignof__(e) with C11 alignof(T)
> and alignof(typeof(e)) respectively to improve portability of the code
> between toolchains.
>
> Tyler Retzlaff (9):
> ring: use C11 alignof
> mbuf: use C11 alignof
> ethdev: use C11 alignof
> eventdev: use C11 alignof
> stack: use C11 alignof
> node: use C11 alignof
> pdcp: use C11 alignof
> reorder: use C11 alignof
> security: use C11 alignof
>
> lib/ethdev/ethdev_driver.c | 3 ++-
> lib/ethdev/rte_flow.c | 3 ++-
> lib/eventdev/rte_eventdev.c | 3 ++-
> lib/mbuf/rte_mbuf_dyn.c | 3 ++-
> lib/node/node_private.h | 4 +++-
> lib/pdcp/rte_pdcp.c | 4 +++-
> lib/reorder/rte_reorder.c | 3 ++-
> lib/ring/rte_ring.c | 3 ++-
> lib/security/rte_security.c | 5 +++--
> lib/stack/rte_stack.c | 3 ++-
> 10 files changed, 23 insertions(+), 11 deletions(-)
>
> --
Series-Acked-by: Morten Brørup <mb@smartsharesystems.com>
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 0/9] use C11 alignof
2024-01-24 23:17 [PATCH 0/9] use C11 alignof Tyler Retzlaff
` (9 preceding siblings ...)
2024-01-25 7:19 ` [PATCH 0/9] " Morten Brørup
@ 2024-01-25 12:51 ` fengchengwen
2024-02-13 11:04 ` David Marchand
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
12 siblings, 0 replies; 40+ messages in thread
From: fengchengwen @ 2024-01-25 12:51 UTC (permalink / raw)
To: Tyler Retzlaff, dev
Cc: Akhil Goyal, Andrew Rybchenko, Anoob Joseph, Ferruh Yigit,
Honnappa Nagarahalli, Jerin Jacob, Konstantin Ananyev,
Nithin Dabilpuram, Ori Kam, Pavan Nikhilesh, Thomas Monjalon,
Volodymyr Fialko
Series-acked-by: Chengwen Feng <fengchengwen@huawei.com>
On 2024/1/25 7:17, Tyler Retzlaff wrote:
> Replace use of __alignof__(T) and __alignof__(e) with C11 alignof(T)
> and alignof(typeof(e)) respectively to improve portability of the code
> between toolchains.
>
> Tyler Retzlaff (9):
> ring: use C11 alignof
> mbuf: use C11 alignof
> ethdev: use C11 alignof
> eventdev: use C11 alignof
> stack: use C11 alignof
> node: use C11 alignof
> pdcp: use C11 alignof
> reorder: use C11 alignof
> security: use C11 alignof
>
> lib/ethdev/ethdev_driver.c | 3 ++-
> lib/ethdev/rte_flow.c | 3 ++-
> lib/eventdev/rte_eventdev.c | 3 ++-
> lib/mbuf/rte_mbuf_dyn.c | 3 ++-
> lib/node/node_private.h | 4 +++-
> lib/pdcp/rte_pdcp.c | 4 +++-
> lib/reorder/rte_reorder.c | 3 ++-
> lib/ring/rte_ring.c | 3 ++-
> lib/security/rte_security.c | 5 +++--
> lib/stack/rte_stack.c | 3 ++-
> 10 files changed, 23 insertions(+), 11 deletions(-)
>
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 0/9] use C11 alignof
2024-01-24 23:17 [PATCH 0/9] use C11 alignof Tyler Retzlaff
` (10 preceding siblings ...)
2024-01-25 12:51 ` fengchengwen
@ 2024-02-13 11:04 ` David Marchand
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
12 siblings, 0 replies; 40+ messages in thread
From: David Marchand @ 2024-02-13 11:04 UTC (permalink / raw)
To: Tyler Retzlaff
Cc: dev, Akhil Goyal, Andrew Rybchenko, Anoob Joseph, Ferruh Yigit,
Honnappa Nagarahalli, Jerin Jacob, Konstantin Ananyev,
Nithin Dabilpuram, Ori Kam, Pavan Nikhilesh, Thomas Monjalon,
Volodymyr Fialko
On Thu, Jan 25, 2024 at 12:18 AM Tyler Retzlaff
<roretzla@linux.microsoft.com> wrote:
>
> Replace use of __alignof__(T) and __alignof__(e) with C11 alignof(T)
> and alignof(typeof(e)) respectively to improve portability of the code
> between toolchains.
>
> Tyler Retzlaff (9):
> ring: use C11 alignof
> mbuf: use C11 alignof
> ethdev: use C11 alignof
> eventdev: use C11 alignof
> stack: use C11 alignof
> node: use C11 alignof
> pdcp: use C11 alignof
> reorder: use C11 alignof
> security: use C11 alignof
>
> lib/ethdev/ethdev_driver.c | 3 ++-
> lib/ethdev/rte_flow.c | 3 ++-
> lib/eventdev/rte_eventdev.c | 3 ++-
> lib/mbuf/rte_mbuf_dyn.c | 3 ++-
> lib/node/node_private.h | 4 +++-
> lib/pdcp/rte_pdcp.c | 4 +++-
> lib/reorder/rte_reorder.c | 3 ++-
> lib/ring/rte_ring.c | 3 ++-
> lib/security/rte_security.c | 5 +++--
> lib/stack/rte_stack.c | 3 ++-
> 10 files changed, 23 insertions(+), 11 deletions(-)
The change is trivial, but without a check in checkpatches.sh, I
imagine new occurence to be introduced in the future.
Btw, as it is trivial, please apply this change to the whole tree.
--
David Marchand
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 00/21] use C11 alignof
2024-01-24 23:17 [PATCH 0/9] use C11 alignof Tyler Retzlaff
` (11 preceding siblings ...)
2024-02-13 11:04 ` David Marchand
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 01/21] ring: " Tyler Retzlaff
` (21 more replies)
12 siblings, 22 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(T) and __alignof__(e) with C11 alignof(T)
and alignof(typeof(e)) respectively to improve portability of the code
between toolchains.
v2:
* expand series to replace use in entire source tree, now
includes app, drivers, examples in addition to lib.
Tyler Retzlaff (21):
ring: use C11 alignof
mbuf: use C11 alignof
ethdev: use C11 alignof
eventdev: use C11 alignof
stack: use C11 alignof
node: use C11 alignof
pdcp: use C11 alignof
reorder: use C11 alignof
security: use C11 alignof
test: use C11 alignof
examples: use C11 alignof
app/eventdev: use C11 alignof
drivers/bus: use C11 alignof
event/sw: use C11 alignof
net/bnxt: use C11 alignof
net/iavf: use C11 alignof
net/nfp: use C11 alignof
net/sfc: use C11 alignof
net/virtio: use C11 alignof
net/vmxnet3: use C11 alignof
devtools: forbid direct use of compiler alignof and typeof
app/test-eventdev/test_order_common.c | 6 ++++--
app/test/test_distributor.c | 3 ++-
app/test/test_graph.c | 3 ++-
app/test/test_mbuf.c | 9 +++++----
app/test/test_ring_stress_impl.h | 6 ++++--
devtools/checkpatches.sh | 16 ++++++++++++++++
drivers/bus/dpaa/dpaa_bus.c | 3 ++-
drivers/bus/fslmc/fslmc_bus.c | 3 ++-
drivers/event/sw/sw_evdev_selftest.c | 3 ++-
drivers/net/bnxt/bnxt_ethdev.c | 3 ++-
drivers/net/iavf/iavf_ethdev.c | 3 ++-
drivers/net/iavf/iavf_ipsec_crypto.c | 4 +++-
drivers/net/iavf/iavf_testpmd.c | 3 ++-
drivers/net/nfp/nfp_ipsec.c | 4 +++-
drivers/net/sfc/sfc_dp.c | 5 +++--
drivers/net/virtio/virtio_rxtx.c | 7 ++++---
drivers/net/vmxnet3/vmxnet3_ethdev.c | 3 ++-
examples/bbdev_app/main.c | 3 ++-
examples/rxtx_callbacks/main.c | 3 ++-
lib/ethdev/ethdev_driver.c | 3 ++-
lib/ethdev/rte_flow.c | 3 ++-
lib/eventdev/rte_eventdev.c | 3 ++-
lib/mbuf/rte_mbuf_dyn.c | 3 ++-
lib/node/node_private.h | 4 +++-
lib/pdcp/rte_pdcp.c | 4 +++-
lib/reorder/rte_reorder.c | 3 ++-
lib/ring/rte_ring.c | 3 ++-
lib/security/rte_security.c | 5 +++--
lib/stack/rte_stack.c | 3 ++-
29 files changed, 87 insertions(+), 37 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 01/21] ring: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 02/21] mbuf: " Tyler Retzlaff
` (20 subsequent siblings)
21 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(e) with C11 alignof(typeof(e)) to improve
portability between toolchains
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
lib/ring/rte_ring.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/ring/rte_ring.c b/lib/ring/rte_ring.c
index c59f626..a783299 100644
--- a/lib/ring/rte_ring.c
+++ b/lib/ring/rte_ring.c
@@ -7,6 +7,7 @@
* Used as BSD-3 Licensed with permission from Kip Macy.
*/
+#include <stdalign.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
@@ -288,7 +289,7 @@ struct rte_ring *
* rte_errno for us appropriately - hence no check in this function
*/
mz = rte_memzone_reserve_aligned(mz_name, ring_size, socket_id,
- mz_flags, __alignof__(*r));
+ mz_flags, alignof(typeof(*r)));
if (mz != NULL) {
r = mz->addr;
/* no need to check return value here, we already checked the
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 02/21] mbuf: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 01/21] ring: " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 03/21] ethdev: " Tyler Retzlaff
` (19 subsequent siblings)
21 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
lib/mbuf/rte_mbuf_dyn.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/mbuf/rte_mbuf_dyn.c b/lib/mbuf/rte_mbuf_dyn.c
index 446018f..1cfb329 100644
--- a/lib/mbuf/rte_mbuf_dyn.c
+++ b/lib/mbuf/rte_mbuf_dyn.c
@@ -2,6 +2,7 @@
* Copyright 2019 6WIND S.A.
*/
+#include <stdalign.h>
#include <sys/queue.h>
#include <stdint.h>
#include <limits.h>
@@ -585,7 +586,7 @@ void rte_mbuf_dyn_dump(FILE *out)
static const struct rte_mbuf_dynfield field_desc = {
.name = RTE_MBUF_DYNFIELD_TIMESTAMP_NAME,
.size = sizeof(rte_mbuf_timestamp_t),
- .align = __alignof__(rte_mbuf_timestamp_t),
+ .align = alignof(rte_mbuf_timestamp_t),
};
struct rte_mbuf_dynflag flag_desc = {};
int offset;
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 03/21] ethdev: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 01/21] ring: " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 02/21] mbuf: " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 04/21] eventdev: " Tyler Retzlaff
` (18 subsequent siblings)
21 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
lib/ethdev/ethdev_driver.c | 3 ++-
lib/ethdev/rte_flow.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/ethdev/ethdev_driver.c b/lib/ethdev/ethdev_driver.c
index bd917a1..4d45fbd 100644
--- a/lib/ethdev/ethdev_driver.c
+++ b/lib/ethdev/ethdev_driver.c
@@ -2,6 +2,7 @@
* Copyright(c) 2022 Intel Corporation
*/
+#include <stdalign.h>
#include <stdlib.h>
#include <pthread.h>
@@ -633,7 +634,7 @@ struct rte_eth_dev *
static const struct rte_mbuf_dynfield field_desc = {
.name = RTE_MBUF_DYNFIELD_IP_REASSEMBLY_NAME,
.size = sizeof(rte_eth_ip_reassembly_dynfield_t),
- .align = __alignof__(rte_eth_ip_reassembly_dynfield_t),
+ .align = alignof(rte_eth_ip_reassembly_dynfield_t),
};
static const struct rte_mbuf_dynflag ip_reassembly_dynflag = {
.name = RTE_MBUF_DYNFLAG_IP_REASSEMBLY_INCOMPLETE_NAME,
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index f49d1d3..2cd30d6 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -3,6 +3,7 @@
* Copyright 2016 Mellanox Technologies, Ltd
*/
+#include <stdalign.h>
#include <errno.h>
#include <stddef.h>
#include <stdint.h>
@@ -281,7 +282,7 @@ struct rte_flow_desc_data {
static const struct rte_mbuf_dynfield desc_offs = {
.name = RTE_MBUF_DYNFIELD_METADATA_NAME,
.size = sizeof(uint32_t),
- .align = __alignof__(uint32_t),
+ .align = alignof(uint32_t),
};
static const struct rte_mbuf_dynflag desc_flag = {
.name = RTE_MBUF_DYNFLAG_METADATA_NAME,
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 04/21] eventdev: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
` (2 preceding siblings ...)
2024-02-13 18:34 ` [PATCH v2 03/21] ethdev: " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 05/21] stack: " Tyler Retzlaff
` (17 subsequent siblings)
21 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
lib/eventdev/rte_eventdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index 94628a6..d494f8f 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -2,6 +2,7 @@
* Copyright(c) 2016 Cavium, Inc
*/
+#include <stdalign.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
@@ -1405,7 +1406,7 @@ int rte_event_dev_selftest(uint8_t dev_id)
static const struct rte_mbuf_dynfield test_seqn_dynfield_desc = {
.name = "rte_event_pmd_selftest_seqn_dynfield",
.size = sizeof(rte_event_pmd_selftest_seqn_t),
- .align = __alignof__(rte_event_pmd_selftest_seqn_t),
+ .align = alignof(rte_event_pmd_selftest_seqn_t),
};
struct rte_eventdev *dev = &rte_eventdevs[dev_id];
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 05/21] stack: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
` (3 preceding siblings ...)
2024-02-13 18:34 ` [PATCH v2 04/21] eventdev: " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 06/21] node: " Tyler Retzlaff
` (16 subsequent siblings)
21 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(e) with C11 alignof(typeof(e)) to improve
portability between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
lib/stack/rte_stack.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/stack/rte_stack.c b/lib/stack/rte_stack.c
index 1dab6d6..7261281 100644
--- a/lib/stack/rte_stack.c
+++ b/lib/stack/rte_stack.c
@@ -2,6 +2,7 @@
* Copyright(c) 2019 Intel Corporation
*/
+#include <stdalign.h>
#include <string.h>
#include <sys/queue.h>
@@ -90,7 +91,7 @@ struct rte_stack *
rte_mcfg_tailq_write_lock();
mz = rte_memzone_reserve_aligned(mz_name, sz, socket_id,
- 0, __alignof__(*s));
+ 0, alignof(typeof(*s)));
if (mz == NULL) {
STACK_LOG_ERR("Cannot reserve stack memzone!");
rte_mcfg_tailq_write_unlock();
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 06/21] node: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
` (4 preceding siblings ...)
2024-02-13 18:34 ` [PATCH v2 05/21] stack: " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 07/21] pdcp: " Tyler Retzlaff
` (15 subsequent siblings)
21 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
lib/node/node_private.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/node/node_private.h b/lib/node/node_private.h
index 73563e4..2b9bad1 100644
--- a/lib/node/node_private.h
+++ b/lib/node/node_private.h
@@ -5,6 +5,8 @@
#ifndef __NODE_PRIVATE_H__
#define __NODE_PRIVATE_H__
+#include <stdalign.h>
+
#include <rte_common.h>
#include <rte_log.h>
#include <rte_mbuf.h>
@@ -42,7 +44,7 @@ struct node_mbuf_priv1 {
static const struct rte_mbuf_dynfield node_mbuf_priv1_dynfield_desc = {
.name = "rte_node_dynfield_priv1",
.size = sizeof(struct node_mbuf_priv1),
- .align = __alignof__(struct node_mbuf_priv1),
+ .align = alignof(struct node_mbuf_priv1),
};
extern int node_mbuf_priv1_dynfield_offset;
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 07/21] pdcp: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
` (5 preceding siblings ...)
2024-02-13 18:34 ` [PATCH v2 06/21] node: " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 08/21] reorder: " Tyler Retzlaff
` (14 subsequent siblings)
21 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
lib/pdcp/rte_pdcp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/pdcp/rte_pdcp.c b/lib/pdcp/rte_pdcp.c
index 1c6d246..1c076fb 100644
--- a/lib/pdcp/rte_pdcp.c
+++ b/lib/pdcp/rte_pdcp.c
@@ -2,6 +2,8 @@
* Copyright(C) 2023 Marvell.
*/
+#include <stdalign.h>
+
#include <rte_errno.h>
#include <rte_pdcp.h>
#include <rte_malloc.h>
@@ -32,7 +34,7 @@ struct entity_layout {
const struct rte_mbuf_dynfield dynfield_desc = {
.name = RTE_PDCP_DYNFIELD_NAME,
.size = sizeof(rte_pdcp_dynfield_t),
- .align = __alignof__(rte_pdcp_dynfield_t),
+ .align = alignof(rte_pdcp_dynfield_t),
};
if (rte_pdcp_dynfield_offset != -1)
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 08/21] reorder: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
` (6 preceding siblings ...)
2024-02-13 18:34 ` [PATCH v2 07/21] pdcp: " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 09/21] security: " Tyler Retzlaff
` (13 subsequent siblings)
21 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
lib/reorder/rte_reorder.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/reorder/rte_reorder.c b/lib/reorder/rte_reorder.c
index ff81544..c080b2c 100644
--- a/lib/reorder/rte_reorder.c
+++ b/lib/reorder/rte_reorder.c
@@ -2,6 +2,7 @@
* Copyright(c) 2010-2014 Intel Corporation
*/
+#include <stdalign.h>
#include <string.h>
#include <sys/queue.h>
@@ -72,7 +73,7 @@ struct rte_reorder_buffer *
static const struct rte_mbuf_dynfield reorder_seqn_dynfield_desc = {
.name = RTE_REORDER_SEQN_DYNFIELD_NAME,
.size = sizeof(rte_reorder_seqn_t),
- .align = __alignof__(rte_reorder_seqn_t),
+ .align = alignof(rte_reorder_seqn_t),
};
if (b == NULL) {
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 09/21] security: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
` (7 preceding siblings ...)
2024-02-13 18:34 ` [PATCH v2 08/21] reorder: " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 10/21] test: " Tyler Retzlaff
` (12 subsequent siblings)
21 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
lib/security/rte_security.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c
index b082a29..e5c862f 100644
--- a/lib/security/rte_security.c
+++ b/lib/security/rte_security.c
@@ -4,6 +4,7 @@
* Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
*/
+#include <stdalign.h>
#include <ctype.h>
#include <stdlib.h>
@@ -38,7 +39,7 @@
static const struct rte_mbuf_dynfield dynfield_desc = {
.name = RTE_SECURITY_DYNFIELD_NAME,
.size = sizeof(rte_security_dynfield_t),
- .align = __alignof__(rte_security_dynfield_t),
+ .align = alignof(rte_security_dynfield_t),
};
rte_security_dynfield_offset =
rte_mbuf_dynfield_register(&dynfield_desc);
@@ -51,7 +52,7 @@
static const struct rte_mbuf_dynfield dynfield_desc = {
.name = RTE_SECURITY_OOP_DYNFIELD_NAME,
.size = sizeof(rte_security_oop_dynfield_t),
- .align = __alignof__(rte_security_oop_dynfield_t),
+ .align = alignof(rte_security_oop_dynfield_t),
};
rte_security_oop_dynfield_offset =
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 10/21] test: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
` (8 preceding siblings ...)
2024-02-13 18:34 ` [PATCH v2 09/21] security: " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 11/21] examples: " Tyler Retzlaff
` (11 subsequent siblings)
21 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Replace use of __alignof__(e) with C11 alignof(typeof(e)) to improve
portability between toolchains
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
app/test/test_distributor.c | 3 ++-
app/test/test_graph.c | 3 ++-
app/test/test_mbuf.c | 9 +++++----
app/test/test_ring_stress_impl.h | 6 ++++--
4 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c
index 6cb27f4..d2037b7 100644
--- a/app/test/test_distributor.c
+++ b/app/test/test_distributor.c
@@ -5,6 +5,7 @@
#include "test.h"
#include <unistd.h>
+#include <stdalign.h>
#include <string.h>
#include <rte_cycles.h>
#include <rte_errno.h>
@@ -831,7 +832,7 @@ int test_error_distributor_create_numworkers(void)
static const struct rte_mbuf_dynfield seq_dynfield_desc = {
.name = "test_distributor_dynfield_seq",
.size = sizeof(seq_dynfield_t),
- .align = __alignof__(seq_dynfield_t),
+ .align = alignof(seq_dynfield_t),
};
seq_dynfield_offset =
rte_mbuf_dynfield_register(&seq_dynfield_desc);
diff --git a/app/test/test_graph.c b/app/test/test_graph.c
index 3dd017e..b8409bc 100644
--- a/app/test/test_graph.c
+++ b/app/test/test_graph.c
@@ -7,6 +7,7 @@
#include <assert.h>
#include <inttypes.h>
#include <signal.h>
+#include <stdalign.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
@@ -935,7 +936,7 @@ struct test_node_register {
static const struct rte_mbuf_dynfield graph_dynfield_desc = {
.name = "test_graph_dynfield",
.size = sizeof(graph_dynfield_t),
- .align = __alignof__(graph_dynfield_t),
+ .align = alignof(graph_dynfield_t),
};
graph_dynfield_offset =
rte_mbuf_dynfield_register(&graph_dynfield_desc);
diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index d7393df..51ea6ef 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -5,6 +5,7 @@
#include "test.h"
#include <string.h>
+#include <stdalign.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
@@ -2534,19 +2535,19 @@ struct test_case {
const struct rte_mbuf_dynfield dynfield = {
.name = "test-dynfield",
.size = sizeof(uint8_t),
- .align = __alignof__(uint8_t),
+ .align = alignof(uint8_t),
.flags = 0,
};
const struct rte_mbuf_dynfield dynfield2 = {
.name = "test-dynfield2",
.size = sizeof(uint16_t),
- .align = __alignof__(uint16_t),
+ .align = alignof(uint16_t),
.flags = 0,
};
const struct rte_mbuf_dynfield dynfield3 = {
.name = "test-dynfield3",
.size = sizeof(uint8_t),
- .align = __alignof__(uint8_t),
+ .align = alignof(uint8_t),
.flags = 0,
};
const struct rte_mbuf_dynfield dynfield_fail_big = {
@@ -2564,7 +2565,7 @@ struct test_case {
const struct rte_mbuf_dynfield dynfield_fail_flag = {
.name = "test-dynfield",
.size = sizeof(uint8_t),
- .align = __alignof__(uint8_t),
+ .align = alignof(uint8_t),
.flags = 1,
};
const struct rte_mbuf_dynflag dynflag_fail_flag = {
diff --git a/app/test/test_ring_stress_impl.h b/app/test/test_ring_stress_impl.h
index 62f046a..2dec897 100644
--- a/app/test/test_ring_stress_impl.h
+++ b/app/test/test_ring_stress_impl.h
@@ -2,6 +2,8 @@
* Copyright(c) 2020 Intel Corporation
*/
+#include <stdalign.h>
+
#include "test_ring_stress.h"
/**
@@ -285,7 +287,7 @@ struct ring_elem {
*data = NULL;
sz = num * sizeof(*elm);
- elm = rte_zmalloc(NULL, sz, __alignof__(*elm));
+ elm = rte_zmalloc(NULL, sz, alignof(typeof(*elm)));
if (elm == NULL) {
printf("%s: alloc(%zu) for %u elems data failed",
__func__, sz, num);
@@ -297,7 +299,7 @@ struct ring_elem {
/* alloc ring */
nr = 2 * num;
sz = rte_ring_get_memsize(nr);
- r = rte_zmalloc(NULL, sz, __alignof__(*r));
+ r = rte_zmalloc(NULL, sz, alignof(typeof(*r)));
if (r == NULL) {
printf("%s: alloc(%zu) for FIFO with %u elems failed",
__func__, sz, nr);
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 11/21] examples: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
` (9 preceding siblings ...)
2024-02-13 18:34 ` [PATCH v2 10/21] test: " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 12/21] app/eventdev: " Tyler Retzlaff
` (10 subsequent siblings)
21 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
examples/bbdev_app/main.c | 3 ++-
examples/rxtx_callbacks/main.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index ef9cd29..16599ae 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -2,6 +2,7 @@
* Copyright(c) 2017 Intel Corporation
*/
+#include <stdalign.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -1051,7 +1052,7 @@ uint16_t bbdev_parse_number(const char *mask)
static const struct rte_mbuf_dynfield input_dynfield_desc = {
.name = "example_bbdev_dynfield_input",
.size = sizeof(struct rte_mbuf *),
- .align = __alignof__(struct rte_mbuf *),
+ .align = alignof(struct rte_mbuf *),
};
__atomic_store_n(&global_exit_flag, 0, __ATOMIC_RELAXED);
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index 59eee49..4682921 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -2,6 +2,7 @@
* Copyright(c) 2010-2015 Intel Corporation
*/
+#include <stdalign.h>
#include <stdint.h>
#include <stdlib.h>
#include <inttypes.h>
@@ -292,7 +293,7 @@
static const struct rte_mbuf_dynfield tsc_dynfield_desc = {
.name = "example_bbdev_dynfield_tsc",
.size = sizeof(tsc_t),
- .align = __alignof__(tsc_t),
+ .align = alignof(tsc_t),
};
/* init EAL */
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 12/21] app/eventdev: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
` (10 preceding siblings ...)
2024-02-13 18:34 ` [PATCH v2 11/21] examples: " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 13/21] drivers/bus: " Tyler Retzlaff
` (9 subsequent siblings)
21 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
app/test-eventdev/test_order_common.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/app/test-eventdev/test_order_common.c b/app/test-eventdev/test_order_common.c
index 6f00f24..a9894c6 100644
--- a/app/test-eventdev/test_order_common.c
+++ b/app/test-eventdev/test_order_common.c
@@ -2,6 +2,8 @@
* Copyright(c) 2017 Cavium, Inc
*/
+#include <stdalign.h>
+
#include "test_order_common.h"
int
@@ -139,12 +141,12 @@
static const struct rte_mbuf_dynfield flow_id_dynfield_desc = {
.name = "test_event_dynfield_flow_id",
.size = sizeof(flow_id_t),
- .align = __alignof__(flow_id_t),
+ .align = alignof(flow_id_t),
};
static const struct rte_mbuf_dynfield seqn_dynfield_desc = {
.name = "test_event_dynfield_seqn",
.size = sizeof(seqn_t),
- .align = __alignof__(seqn_t),
+ .align = alignof(seqn_t),
};
test_order = rte_zmalloc_socket(test->name, sizeof(struct test_order),
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 13/21] drivers/bus: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
` (11 preceding siblings ...)
2024-02-13 18:34 ` [PATCH v2 12/21] app/eventdev: " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 14/21] event/sw: " Tyler Retzlaff
` (8 subsequent siblings)
21 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
drivers/bus/dpaa/dpaa_bus.c | 3 ++-
drivers/bus/fslmc/fslmc_bus.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index e57159f..4647360 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -4,6 +4,7 @@
*
*/
/* System headers */
+#include <stdalign.h>
#include <stdio.h>
#include <inttypes.h>
#include <unistd.h>
@@ -307,7 +308,7 @@ int rte_dpaa_portal_init(void *arg)
static const struct rte_mbuf_dynfield dpaa_seqn_dynfield_desc = {
.name = DPAA_SEQN_DYNFIELD_NAME,
.size = sizeof(dpaa_seqn_t),
- .align = __alignof__(dpaa_seqn_t),
+ .align = alignof(dpaa_seqn_t),
};
unsigned int cpu, lcore = rte_lcore_id();
int ret;
diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index 57bfb51..b1af47c 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -6,6 +6,7 @@
#include <string.h>
#include <dirent.h>
+#include <stdalign.h>
#include <stdbool.h>
#include <rte_log.h>
@@ -395,7 +396,7 @@
static const struct rte_mbuf_dynfield dpaa2_seqn_dynfield_desc = {
.name = DPAA2_SEQN_DYNFIELD_NAME,
.size = sizeof(dpaa2_seqn_t),
- .align = __alignof__(dpaa2_seqn_t),
+ .align = alignof(dpaa2_seqn_t),
};
if (TAILQ_EMPTY(&rte_fslmc_bus.device_list))
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 14/21] event/sw: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
` (12 preceding siblings ...)
2024-02-13 18:34 ` [PATCH v2 13/21] drivers/bus: " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 15/21] net/bnxt: " Tyler Retzlaff
` (7 subsequent siblings)
21 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
drivers/event/sw/sw_evdev_selftest.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/event/sw/sw_evdev_selftest.c b/drivers/event/sw/sw_evdev_selftest.c
index e6646e5..a2ce140 100644
--- a/drivers/event/sw/sw_evdev_selftest.c
+++ b/drivers/event/sw/sw_evdev_selftest.c
@@ -2,6 +2,7 @@
* Copyright(c) 2016-2017 Intel Corporation
*/
+#include <stdalign.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
@@ -3201,7 +3202,7 @@ struct test_event_dev_stats {
static const struct rte_mbuf_dynfield counter_dynfield_desc = {
.name = "rte_event_sw_dynfield_selftest_counter",
.size = sizeof(counter_dynfield_t),
- .align = __alignof__(counter_dynfield_t),
+ .align = alignof(counter_dynfield_t),
};
counter_dynfield_offset =
rte_mbuf_dynfield_register(&counter_dynfield_desc);
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 15/21] net/bnxt: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
` (13 preceding siblings ...)
2024-02-13 18:34 ` [PATCH v2 14/21] event/sw: " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 19:19 ` Ajit Khaparde
2024-02-13 18:34 ` [PATCH v2 16/21] net/iavf: " Tyler Retzlaff
` (6 subsequent siblings)
21 siblings, 1 reply; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index acf7e6e..45d840d 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -4,6 +4,7 @@
*/
#include <inttypes.h>
+#include <stdalign.h>
#include <stdbool.h>
#include <dev_driver.h>
@@ -5920,7 +5921,7 @@ static int bnxt_drv_init(struct rte_eth_dev *eth_dev)
static const struct rte_mbuf_dynfield bnxt_cfa_code_dynfield_desc = {
.name = RTE_PMD_BNXT_CFA_CODE_DYNFIELD_NAME,
.size = sizeof(bnxt_cfa_code_dynfield_t),
- .align = __alignof__(bnxt_cfa_code_dynfield_t),
+ .align = alignof(bnxt_cfa_code_dynfield_t),
};
bnxt_cfa_code_dynfield_offset =
rte_mbuf_dynfield_register(&bnxt_cfa_code_dynfield_desc);
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 16/21] net/iavf: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
` (14 preceding siblings ...)
2024-02-13 18:34 ` [PATCH v2 15/21] net/bnxt: " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 17/21] net/nfp: " Tyler Retzlaff
` (5 subsequent siblings)
21 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
drivers/net/iavf/iavf_ethdev.c | 3 ++-
drivers/net/iavf/iavf_ipsec_crypto.c | 4 +++-
drivers/net/iavf/iavf_testpmd.c | 3 ++-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 1fb876e..0b350e9 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -4,6 +4,7 @@
#include <ctype.h>
#include <sys/queue.h>
+#include <stdalign.h>
#include <stdio.h>
#include <errno.h>
#include <stdint.h>
@@ -55,7 +56,7 @@
static const struct rte_mbuf_dynfield iavf_proto_xtr_metadata_param = {
.name = "intel_pmd_dynfield_proto_xtr_metadata",
.size = sizeof(uint32_t),
- .align = __alignof__(uint32_t),
+ .align = alignof(uint32_t),
.flags = 0,
};
diff --git a/drivers/net/iavf/iavf_ipsec_crypto.c b/drivers/net/iavf/iavf_ipsec_crypto.c
index d6c0180..6fd45ff 100644
--- a/drivers/net/iavf/iavf_ipsec_crypto.c
+++ b/drivers/net/iavf/iavf_ipsec_crypto.c
@@ -2,6 +2,8 @@
* Copyright(c) 2020 Intel Corporation
*/
+#include <stdalign.h>
+
#include <rte_cryptodev.h>
#include <rte_ethdev.h>
#include <rte_security_driver.h>
@@ -1535,7 +1537,7 @@ enum rte_crypto_aead_algorithm aead_maptbl[] = {
struct rte_mbuf_dynfield pkt_md_dynfield = {
.name = "iavf_ipsec_crypto_pkt_metadata",
.size = sizeof(struct iavf_ipsec_crypto_pkt_metadata),
- .align = __alignof__(struct iavf_ipsec_crypto_pkt_metadata)
+ .align = alignof(struct iavf_ipsec_crypto_pkt_metadata)
};
struct virtchnl_ipsec_cap capabilities;
int rc;
diff --git a/drivers/net/iavf/iavf_testpmd.c b/drivers/net/iavf/iavf_testpmd.c
index 07aac07..775179f 100644
--- a/drivers/net/iavf/iavf_testpmd.c
+++ b/drivers/net/iavf/iavf_testpmd.c
@@ -2,6 +2,7 @@
* Copyright(c) 2010-2016 Intel Corporation.
*/
+#include <stdalign.h>
#include <stdlib.h>
#include <rte_pmd_iavf.h>
@@ -41,7 +42,7 @@ struct cmd_enable_tx_lldp_result {
const struct rte_mbuf_dynfield iavf_tx_lldp_dynfield = {
.name = IAVF_TX_LLDP_DYNFIELD,
.size = sizeof(uint8_t),
- .align = __alignof__(uint8_t),
+ .align = alignof(uint8_t),
.flags = 0
};
int offset;
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 17/21] net/nfp: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
` (15 preceding siblings ...)
2024-02-13 18:34 ` [PATCH v2 16/21] net/iavf: " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 18/21] net/sfc: " Tyler Retzlaff
` (4 subsequent siblings)
21 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
drivers/net/nfp/nfp_ipsec.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/nfp/nfp_ipsec.c b/drivers/net/nfp/nfp_ipsec.c
index 4529473..6e9bb06 100644
--- a/drivers/net/nfp/nfp_ipsec.c
+++ b/drivers/net/nfp/nfp_ipsec.c
@@ -3,6 +3,8 @@
* All rights reserved.
*/
+#include <stdalign.h>
+
#include "nfp_ipsec.h"
#include <rte_cryptodev.h>
@@ -1348,7 +1350,7 @@ enum nfp_ipsec_df_type {
static const struct rte_mbuf_dynfield pkt_md_dynfield = {
.name = "nfp_ipsec_crypto_pkt_metadata",
.size = sizeof(struct nfp_tx_ipsec_desc_msg),
- .align = __alignof__(struct nfp_tx_ipsec_desc_msg),
+ .align = alignof(struct nfp_tx_ipsec_desc_msg),
};
ctx = rte_zmalloc("security_ctx",
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 18/21] net/sfc: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
` (16 preceding siblings ...)
2024-02-13 18:34 ` [PATCH v2 17/21] net/nfp: " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 19/21] net/virtio: " Tyler Retzlaff
` (3 subsequent siblings)
21 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
drivers/net/sfc/sfc_dp.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/sfc/sfc_dp.c b/drivers/net/sfc/sfc_dp.c
index 2b0a1d7..7e2a20e 100644
--- a/drivers/net/sfc/sfc_dp.c
+++ b/drivers/net/sfc/sfc_dp.c
@@ -8,6 +8,7 @@
*/
#include <sys/queue.h>
+#include <stdalign.h>
#include <string.h>
#include <errno.h>
@@ -91,7 +92,7 @@ struct sfc_dp *
static const struct rte_mbuf_dynfield mport = {
.name = "rte_net_sfc_dynfield_mport",
.size = sizeof(efx_mport_id_t),
- .align = __alignof__(efx_mport_id_t),
+ .align = alignof(efx_mport_id_t),
};
static const struct rte_mbuf_dynflag mport_override = {
.name = "rte_net_sfc_dynflag_mport_override",
@@ -134,7 +135,7 @@ struct sfc_dp *
static const struct rte_mbuf_dynfield ft_ctx_id = {
.name = "rte_net_sfc_dynfield_ft_ctx_id",
.size = sizeof(uint8_t),
- .align = __alignof__(uint8_t),
+ .align = alignof(uint8_t),
};
int field_offset;
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 19/21] net/virtio: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
` (17 preceding siblings ...)
2024-02-13 18:34 ` [PATCH v2 18/21] net/sfc: " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 20/21] net/vmxnet3: " Tyler Retzlaff
` (2 subsequent siblings)
21 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
drivers/net/virtio/virtio_rxtx.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 99b9519..f69b945 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -2,6 +2,7 @@
* Copyright(c) 2010-2014 Intel Corporation
*/
+#include <stdalign.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@@ -1797,7 +1798,7 @@
txm->nb_segs == 1 &&
rte_pktmbuf_headroom(txm) >= hdr_size &&
rte_is_aligned(rte_pktmbuf_mtod(txm, char *),
- __alignof__(struct virtio_net_hdr_mrg_rxbuf)))
+ alignof(struct virtio_net_hdr_mrg_rxbuf)))
can_push = 1;
else if (virtio_with_feature(hw, VIRTIO_RING_F_INDIRECT_DESC) &&
txm->nb_segs < VIRTIO_MAX_TX_INDIRECT)
@@ -1878,7 +1879,7 @@
txm->nb_segs == 1 &&
rte_pktmbuf_headroom(txm) >= hdr_size &&
rte_is_aligned(rte_pktmbuf_mtod(txm, char *),
- __alignof__(struct virtio_net_hdr_mrg_rxbuf)))
+ alignof(struct virtio_net_hdr_mrg_rxbuf)))
can_push = 1;
else if (virtio_with_feature(hw, VIRTIO_RING_F_INDIRECT_DESC) &&
txm->nb_segs < VIRTIO_MAX_TX_INDIRECT)
@@ -1980,7 +1981,7 @@
txm->nb_segs == 1 &&
rte_pktmbuf_headroom(txm) >= hdr_size &&
rte_is_aligned(rte_pktmbuf_mtod(txm, char *),
- __alignof__(struct virtio_net_hdr_mrg_rxbuf))) {
+ alignof(struct virtio_net_hdr_mrg_rxbuf))) {
inorder_pkts[nb_inorder_pkts] = txm;
nb_inorder_pkts++;
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 20/21] net/vmxnet3: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
` (18 preceding siblings ...)
2024-02-13 18:34 ` [PATCH v2 19/21] net/virtio: " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 21/21] devtools: forbid direct use of compiler alignof and typeof Tyler Retzlaff
2024-02-14 12:19 ` [PATCH v2 00/21] use C11 alignof David Marchand
21 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
drivers/net/vmxnet3/vmxnet3_ethdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 4fd7040..b239ea3 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -3,6 +3,7 @@
*/
#include <sys/queue.h>
+#include <stdalign.h>
#include <stdio.h>
#include <errno.h>
#include <stdint.h>
@@ -367,7 +368,7 @@ struct vmxnet3_xstats_name_off {
static const struct rte_mbuf_dynfield vmxnet3_segs_dynfield_desc = {
.name = VMXNET3_SEGS_DYNFIELD_NAME,
.size = sizeof(vmxnet3_segs_dynfield_t),
- .align = __alignof__(vmxnet3_segs_dynfield_t),
+ .align = alignof(vmxnet3_segs_dynfield_t),
};
PMD_INIT_FUNC_TRACE();
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH v2 21/21] devtools: forbid direct use of compiler alignof and typeof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
` (19 preceding siblings ...)
2024-02-13 18:34 ` [PATCH v2 20/21] net/vmxnet3: " Tyler Retzlaff
@ 2024-02-13 18:34 ` Tyler Retzlaff
2024-02-14 12:19 ` [PATCH v2 00/21] use C11 alignof David Marchand
21 siblings, 0 replies; 40+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 18:34 UTC (permalink / raw)
To: dev
Cc: Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand, Tyler Retzlaff
Add 2 checks forbidding direct use of __alignof__ and __typeof__ instead
C11 alignof and rte_common.h typeof macros should be used.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
devtools/checkpatches.sh | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index c9e466f..e379700 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -151,6 +151,22 @@ check_forbidden_additions() { # <patch>
-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
"$1" || res=1
+ # forbid use of __alignof__
+ awk -v FOLDERS="lib drivers app examples" \
+ -v EXPRESSIONS='\\<__alignof__\\>' \
+ -v RET_ON_FAIL=1 \
+ -v MESSAGE='Using __alignof__, prefer C11 alignof' \
+ -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
+ "$1" || res=1
+
+ # forbid use of __typeof__
+ awk -v FOLDERS="lib drivers app examples" \
+ -v EXPRESSIONS='\\<__typeof__\\>' \
+ -v RET_ON_FAIL=1 \
+ -v MESSAGE='Using __typeof__, prefer typeof' \
+ -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
+ "$1" || res=1
+
# forbid use of non abstracted bit count operations
awk -v FOLDERS="lib drivers app examples" \
-v EXPRESSIONS='\\<__builtin_(clz|clzll|ctz|ctzll|popcount|popcountll)\\>' \
--
1.8.3.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH v2 15/21] net/bnxt: use C11 alignof
2024-02-13 18:34 ` [PATCH v2 15/21] net/bnxt: " Tyler Retzlaff
@ 2024-02-13 19:19 ` Ajit Khaparde
0 siblings, 0 replies; 40+ messages in thread
From: Ajit Khaparde @ 2024-02-13 19:19 UTC (permalink / raw)
To: Tyler Retzlaff
Cc: dev, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan, david.marchand
[-- Attachment #1: Type: text/plain, Size: 1383 bytes --]
On Tue, Feb 13, 2024 at 10:34 AM Tyler Retzlaff
<roretzla@linux.microsoft.com> wrote:
>
> Replace use of __alignof__(T) with C11 alignof(T) to improve portability
> between toolchains.
>
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
> drivers/net/bnxt/bnxt_ethdev.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index acf7e6e..45d840d 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -4,6 +4,7 @@
> */
>
> #include <inttypes.h>
> +#include <stdalign.h>
> #include <stdbool.h>
>
> #include <dev_driver.h>
> @@ -5920,7 +5921,7 @@ static int bnxt_drv_init(struct rte_eth_dev *eth_dev)
> static const struct rte_mbuf_dynfield bnxt_cfa_code_dynfield_desc = {
> .name = RTE_PMD_BNXT_CFA_CODE_DYNFIELD_NAME,
> .size = sizeof(bnxt_cfa_code_dynfield_t),
> - .align = __alignof__(bnxt_cfa_code_dynfield_t),
> + .align = alignof(bnxt_cfa_code_dynfield_t),
> };
> bnxt_cfa_code_dynfield_offset =
> rte_mbuf_dynfield_register(&bnxt_cfa_code_dynfield_desc);
> --
> 1.8.3.1
>
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH v2 00/21] use C11 alignof
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
` (20 preceding siblings ...)
2024-02-13 18:34 ` [PATCH v2 21/21] devtools: forbid direct use of compiler alignof and typeof Tyler Retzlaff
@ 2024-02-14 12:19 ` David Marchand
21 siblings, 0 replies; 40+ messages in thread
From: David Marchand @ 2024-02-14 12:19 UTC (permalink / raw)
To: Tyler Retzlaff
Cc: dev, Ajit Khaparde, Akhil Goyal, Andrew Rybchenko, Anoob Joseph,
Bruce Richardson, Chaoyong He, Chenbo Xia, David Hunt,
Ferruh Yigit, Harry van Haaren, Hemant Agrawal,
Honnappa Nagarahalli, Jerin Jacob, Jingjing Wu, Jochen Behrens,
John McNamara, Kiran Kumar K, Konstantin Ananyev,
Maxime Coquelin, Nicolas Chautru, Nithin Dabilpuram, Ori Kam,
Pavan Nikhilesh, Sachin Saxena, Somnath Kotur, Thomas Monjalon,
Volodymyr Fialko, Zhirun Yan
On Tue, Feb 13, 2024 at 7:35 PM Tyler Retzlaff
<roretzla@linux.microsoft.com> wrote:
>
> Replace use of __alignof__(T) and __alignof__(e) with C11 alignof(T)
> and alignof(typeof(e)) respectively to improve portability of the code
> between toolchains.
>
> v2:
> * expand series to replace use in entire source tree, now
> includes app, drivers, examples in addition to lib.
>
> Tyler Retzlaff (21):
> ring: use C11 alignof
> mbuf: use C11 alignof
> ethdev: use C11 alignof
> eventdev: use C11 alignof
> stack: use C11 alignof
> node: use C11 alignof
> pdcp: use C11 alignof
> reorder: use C11 alignof
> security: use C11 alignof
> test: use C11 alignof
> examples: use C11 alignof
> app/eventdev: use C11 alignof
> drivers/bus: use C11 alignof
> event/sw: use C11 alignof
> net/bnxt: use C11 alignof
> net/iavf: use C11 alignof
> net/nfp: use C11 alignof
> net/sfc: use C11 alignof
> net/virtio: use C11 alignof
> net/vmxnet3: use C11 alignof
> devtools: forbid direct use of compiler alignof and typeof
>
> app/test-eventdev/test_order_common.c | 6 ++++--
> app/test/test_distributor.c | 3 ++-
> app/test/test_graph.c | 3 ++-
> app/test/test_mbuf.c | 9 +++++----
> app/test/test_ring_stress_impl.h | 6 ++++--
> devtools/checkpatches.sh | 16 ++++++++++++++++
> drivers/bus/dpaa/dpaa_bus.c | 3 ++-
> drivers/bus/fslmc/fslmc_bus.c | 3 ++-
> drivers/event/sw/sw_evdev_selftest.c | 3 ++-
> drivers/net/bnxt/bnxt_ethdev.c | 3 ++-
> drivers/net/iavf/iavf_ethdev.c | 3 ++-
> drivers/net/iavf/iavf_ipsec_crypto.c | 4 +++-
> drivers/net/iavf/iavf_testpmd.c | 3 ++-
> drivers/net/nfp/nfp_ipsec.c | 4 +++-
> drivers/net/sfc/sfc_dp.c | 5 +++--
> drivers/net/virtio/virtio_rxtx.c | 7 ++++---
> drivers/net/vmxnet3/vmxnet3_ethdev.c | 3 ++-
> examples/bbdev_app/main.c | 3 ++-
> examples/rxtx_callbacks/main.c | 3 ++-
> lib/ethdev/ethdev_driver.c | 3 ++-
> lib/ethdev/rte_flow.c | 3 ++-
> lib/eventdev/rte_eventdev.c | 3 ++-
> lib/mbuf/rte_mbuf_dyn.c | 3 ++-
> lib/node/node_private.h | 4 +++-
> lib/pdcp/rte_pdcp.c | 4 +++-
> lib/reorder/rte_reorder.c | 3 ++-
> lib/ring/rte_ring.c | 3 ++-
> lib/security/rte_security.c | 5 +++--
> lib/stack/rte_stack.c | 3 ++-
> 29 files changed, 87 insertions(+), 37 deletions(-)
Thanks Tyler.
Series applied.
--
David Marchand
^ permalink raw reply [flat|nested] 40+ messages in thread
end of thread, other threads:[~2024-02-14 12:19 UTC | newest]
Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-24 23:17 [PATCH 0/9] use C11 alignof Tyler Retzlaff
2024-01-24 23:17 ` [PATCH 1/9] ring: " Tyler Retzlaff
2024-01-24 23:17 ` [PATCH 2/9] mbuf: " Tyler Retzlaff
2024-01-24 23:17 ` [PATCH 3/9] ethdev: " Tyler Retzlaff
2024-01-24 23:17 ` [PATCH 4/9] eventdev: " Tyler Retzlaff
2024-01-24 23:17 ` [PATCH 5/9] stack: " Tyler Retzlaff
2024-01-24 23:17 ` [PATCH 6/9] node: " Tyler Retzlaff
2024-01-24 23:17 ` [PATCH 7/9] pdcp: " Tyler Retzlaff
2024-01-25 4:36 ` [EXT] " Anoob Joseph
2024-01-24 23:17 ` [PATCH 8/9] reorder: " Tyler Retzlaff
2024-01-25 0:36 ` [EXT] " Volodymyr Fialko
2024-01-24 23:17 ` [PATCH 9/9] security: " Tyler Retzlaff
2024-01-25 6:28 ` [EXT] " Akhil Goyal
2024-01-25 7:19 ` [PATCH 0/9] " Morten Brørup
2024-01-25 12:51 ` fengchengwen
2024-02-13 11:04 ` David Marchand
2024-02-13 18:34 ` [PATCH v2 00/21] " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 01/21] ring: " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 02/21] mbuf: " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 03/21] ethdev: " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 04/21] eventdev: " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 05/21] stack: " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 06/21] node: " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 07/21] pdcp: " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 08/21] reorder: " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 09/21] security: " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 10/21] test: " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 11/21] examples: " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 12/21] app/eventdev: " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 13/21] drivers/bus: " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 14/21] event/sw: " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 15/21] net/bnxt: " Tyler Retzlaff
2024-02-13 19:19 ` Ajit Khaparde
2024-02-13 18:34 ` [PATCH v2 16/21] net/iavf: " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 17/21] net/nfp: " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 18/21] net/sfc: " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 19/21] net/virtio: " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 20/21] net/vmxnet3: " Tyler Retzlaff
2024-02-13 18:34 ` [PATCH v2 21/21] devtools: forbid direct use of compiler alignof and typeof Tyler Retzlaff
2024-02-14 12:19 ` [PATCH v2 00/21] use C11 alignof David Marchand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).