more replacement of zero length array
cover more replacement of zero length array
Replace some missed zero length arrays not captured in the original series.
https://patchwork.dpdk.org/project/dpdk/list/?series=30410&state=*
Zero length arrays are a GNU extension that has been superseded by flex arrays.
https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
Tyler Retzlaff (2):
hash: replace zero length array with flex array
rcu: replace zero length array with flex array
lib/hash/rte_thash.c | 4 ++-- lib/rcu/rcu_qsbr_pvt.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
1.8.3.1
PATCH 1/2 hash: replace zero length array with flex array
Zero length arrays are GNU extension. Replace with standard flex array.
--- lib/hash/rte_thash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/hash/rte_thash.c +2 -2
@@ -80,7 +80,7 @@ struct rte_thash_subtuple_helper {uint32_t tuple_offset;/** < Offset in bits of the subtuple */ uint32_t tuple_len;/** < Length in bits of the subtuple */ uint32_t lsb_msk;/** < (1 << reta_sz_log) - 1 */ - __extension__ uint32_t compl_table[0] __rte_cache_aligned; + uint32_t compl_table[] __rte_cache_aligned;/** < Complementary table */ };
@@ -93,7 +93,7 @@ struct rte_thash_ctx {uint32_t flags;uint64_t *matrices;/**< matrices used with rte_thash_gfni implementation */ -uint8_t hash_key[0 ]; +uint8_t hash_key[]; };int
Signature · 1 line
1.8.3.1
RE: [PATCH 1/2] hash: replace zero length array with flex array
Quoted 14 lines
-----Original Message-----
From: Tyler Retzlaff <[email protected]>
Sent: Wednesday, January 24, 2024 4:18 PM
To: [email protected]
Cc: Bruce Richardson <[email protected]>; Honnappa Nagarahalli <[email protected]>; Sameh Gobriel <[email protected]>; Vladimir Medvedkin <[email protected]>; Yipeng Wang <[email protected]>; Stephen Hemminger <[email protected]>; Tyler Retzlaff <[email protected]>
Subject: [PATCH 1/2] hash: replace zero length array with flex array
Quoted 3 lines
Zero length arrays are GNU extension. Replace with standard flex array.
Signed-off-by Tyler Retzlaff <[email protected]>
Quoted 28 lines
--- lib/hash/rte_thash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)lib/hash/rte_thash.c index e8de071..1982051 renamed from lib/hash/rte_thash.c +0
-0100644
lib/hash/rte_thash.c +2
-3@@ -80,7 +80,7 @@ struct rte_thash_subtuple_helper {uint32_t tuple_offset;/** < Offset in bits of the subtuple */ uint32_t tuple_len;/** < Length in bits of the subtuple */ uint32_t lsb_msk;/** < (1 << reta_sz_log) - 1 */ - __extension__ uint32_t compl_table[0] __rte_cache_aligned; + uint32_t compl_table[] __rte_cache_aligned;/** < Complementary table */ };@@ -93,7 +93,7 @@ struct rte_thash_ctx {uint32_t flags;uint64_t *matrices;/**< matrices used with rte_thash_gfni implementation */ -uint8_t hash_key[0 ]; +uint8_t hash_key[]; };int --1.8.3.1
RE: [PATCH 1/2] hash: replace zero length array with flex array
In reply to Tyler RetzlaffQuoted 2 lines
From: Tyler Retzlaff [mailto:[email protected]]
Sent: Wednesday, 24 January 2024 23.18
flex array
Quoted 6 lines
Zero length arrays are GNU extension. Replace with standard flex array.
Signed-off-by Tyler Retzlaff <[email protected]>---
PATCH 2/2 rcu: replace zero length array with flex array
In reply to Tyler RetzlaffZero length arrays are GNU extension. Replace with standard flex array.
--- lib/rcu/rcu_qsbr_pvt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/rcu/rcu_qsbr_pvt.h +1 -1
@@ -52,7 +52,7 @@ struct rte_rcu_qsbr_dq {*/ typedef struct {uint64_t token;/**< Token */ -uint8_t elem[0 ];/**< Pointer to user element */ +uint8_t elem[];/**< Pointer to user element */ } __attribute__((__may_alias__))__rte_rcu_qsbr_dq_elem_t ;#endif /* _RTE_RCU_QSBR_PVT_H_ */
Signature · 1 line
1.8.3.1
RE: [PATCH 2/2] rcu: replace zero length array with flex array
Quoted 14 lines
-----Original Message-----
From: Tyler Retzlaff <[email protected]>
Sent: Wednesday, January 24, 2024 4:18 PM
To: [email protected]
Cc: Bruce Richardson <[email protected]>; Honnappa Nagarahalli <[email protected]>; Sameh Gobriel <[email protected]>; Vladimir Medvedkin <[email protected]>; Yipeng Wang <[email protected]>; Stephen Hemminger <[email protected]>; Tyler Retzlaff <[email protected]>
Subject: [PATCH 2/2] rcu: replace zero length array with flex array
Quoted 3 lines
Zero length arrays are GNU extension. Replace with standard flex array.
Signed-off-by Tyler Retzlaff <[email protected]>
Quoted 19 lines
--- lib/rcu/rcu_qsbr_pvt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/rcu/rcu_qsbr_pvt.h index renamed from lib/rcu/rcu_qsbr_pvt.h +0
-05fd7ca2..96d05e6 100644
lib/rcu/rcu_qsbr_pvt.h +1
-2@@ -52,7 +52,7 @@ struct rte_rcu_qsbr_dq {*/ typedef struct {uint64_t token;/**< Token */ -uint8_t elem[0 ];/**< Pointer to user element */ +uint8_t elem[];/**< Pointer to user element */ } __attribute__((__may_alias__))__rte_rcu_qsbr_dq_elem_t ;#endif /* _RTE_RCU_QSBR_PVT_H_ */ --1.8.3.1
RE: [PATCH 2/2] rcu: replace zero length array with flex array
In reply to Tyler RetzlaffQuoted 2 lines
From: Tyler Retzlaff [mailto:[email protected]]
Sent: Wednesday, 24 January 2024 23.18
lex array
Quoted 6 lines
Zero length arrays are GNU extension. Replace with standard flex array.
Signed-off-by Tyler Retzlaff <[email protected]>---
Quoted 17 lines · Tyler Retzlaff
Replace some missed zero length arrays not captured in the original series.
https://patchwork.dpdk.org/project/dpdk/list/?series=30410&state=*Zero length arrays are a GNU extension that has been superseded by flex arrays.
https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
Tyler Retzlaff (2):
hash: replace zero length array with flex array
rcu: replace zero length array with flex arraylib/hash/rte_thash.c | 4 ++-- lib/rcu/rcu_qsbr_pvt.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
v2 cover more replacement of zero length array
In reply to Tyler RetzlaffReplace some missed zero length arrays not captured in the original series.
https://patchwork.dpdk.org/project/dpdk/list/?series=30410&state=*
Zero length arrays are a GNU extension that has been superseded by flex arrays.
https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
v2:
* added additional patches for fib & pipeline libs. series-acks have been placed only against original hash and rcu patches.
Tyler Retzlaff (4):
hash: replace zero length array with flex array
rcu: replace zero length array with flex array
fib: replace zero length array with flex array
pipeline: replace zero length array with flex array
lib/fib/dir24_8.h | 2 +- lib/fib/trie.h | 2 +- lib/hash/rte_thash.c | 4 ++-- lib/pipeline/rte_pipeline.h | 2 +- lib/rcu/rcu_qsbr_pvt.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
1.8.3.1
PATCH v2 1/4 hash: replace zero length array with flex array
Zero length arrays are GNU extension. Replace with standard flex array.
--- lib/hash/rte_thash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/hash/rte_thash.c +2 -2
@@ -80,7 +80,7 @@ struct rte_thash_subtuple_helper {uint32_t tuple_offset;/** < Offset in bits of the subtuple */ uint32_t tuple_len;/** < Length in bits of the subtuple */ uint32_t lsb_msk;/** < (1 << reta_sz_log) - 1 */ - __extension__ uint32_t compl_table[0] __rte_cache_aligned; + uint32_t compl_table[] __rte_cache_aligned;/** < Complementary table */ };
@@ -93,7 +93,7 @@ struct rte_thash_ctx {uint32_t flags;uint64_t *matrices;/**< matrices used with rte_thash_gfni implementation */ -uint8_t hash_key[0 ]; +uint8_t hash_key[]; };int
Signature · 1 line
1.8.3.1
PATCH v2 2/4 rcu: replace zero length array with flex array
In reply to Tyler RetzlaffZero length arrays are GNU extension. Replace with standard flex array.
--- lib/rcu/rcu_qsbr_pvt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/rcu/rcu_qsbr_pvt.h +1 -1
@@ -52,7 +52,7 @@ struct rte_rcu_qsbr_dq {*/ typedef struct {uint64_t token;/**< Token */ -uint8_t elem[0 ];/**< Pointer to user element */ +uint8_t elem[];/**< Pointer to user element */ } __attribute__((__may_alias__))__rte_rcu_qsbr_dq_elem_t ;#endif /* _RTE_RCU_QSBR_PVT_H_ */
Signature · 1 line
1.8.3.1
PATCH v2 3/4 fib: replace zero length array with flex array
In reply to Tyler RetzlaffZero length arrays are GNU extension. Replace with standard flex array.
--- lib/fib/dir24_8.h | 2 +- lib/fib/trie.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
lib/fib/dir24_8.h +1 -1
@@ -32,7 +32,7 @@ struct dir24_8_tbl {uint64_t *tbl8;/**< tbl8 table. */ uint64_t *tbl8_idxes;/**< bitmap containing free tbl8 idxes*/ /* tbl24 table. */ - __extension__ uint64_t tbl24[0] __rte_cache_aligned; + uint64_t tbl24[] __rte_cache_aligned; }; static inline void *
lib/fib/trie.h +1 -1
@@ -36,7 +36,7 @@ struct rte_trie_tbl {uint32_t *tbl8_pool;/**< bitmap containing free tbl8 idxes*/ uint32_t tbl8_pool_pos;/* tbl24 table. */ - __extension__ uint64_t tbl24[0] __rte_cache_aligned; + uint64_t tbl24[] __rte_cache_aligned; }; static inline uint32_t
Signature · 1 line
1.8.3.1
PATCH v2 4/4 pipeline: replace zero length array with flex array
In reply to Tyler RetzlaffZero length arrays are GNU extension. Replace with standard flex array.
--- lib/pipeline/rte_pipeline.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/pipeline/rte_pipeline.h +1 -1
@@ -220,7 +220,7 @@ struct rte_pipeline_table_entry {uint32_t table_id; };/** Start of table entry area for user defined actions and meta-data */ - __extension__uint8_t action_data[0 ]; +uint8_t action_data[]; };/**
Signature · 1 line
1.8.3.1
Quoted 20 lines · On Mon, 12 Feb 2024 14:36:02 -0800 Tyler Retzlaff…
Replace some missed zero length arrays not captured in the original series.
https://patchwork.dpdk.org/project/dpdk/list/?series=30410&state=*Zero length arrays are a GNU extension that has been superseded by flex arrays.
https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
v2:
* added additional patches for fib & pipeline libs. series-acks have been placed only against original hash and rcu patches.Tyler Retzlaff (4):
hash: replace zero length array with flex array
rcu: replace zero length array with flex array
fib: replace zero length array with flex array
pipeline: replace zero length array with flex array
Quoted 7 lines
lib/fib/dir24_8.h | 2 +- lib/fib/trie.h | 2 +- lib/hash/rte_thash.c | 4 ++-- lib/pipeline/rte_pipeline.h | 2 +- lib/rcu/rcu_qsbr_pvt.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-)
Quoted 34 lines
From: Stephen Hemminger [mailto:[email protected]]
Sent: Monday, 12 February 2024 23.57Quoted 20 lines · On Mon, 12 Feb 2024 14:36:02 -0800 Tyler Retzlaff…
Replace some missed zero length arrays not captured in the original series.
https://patchwork.dpdk.org/project/dpdk/list/?series=30410&state=*Zero length arrays are a GNU extension that has been superseded by flex arrays.
https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
v2:
* added additional patches for fib & pipeline libs. series-acks have been placed only against original hash and rcu patches.Tyler Retzlaff (4):
hash: replace zero length array with flex array
rcu: replace zero length array with flex array
fib: replace zero length array with flex array
pipeline: replace zero length array with flex arrayQuoted 7 lines
lib/fib/dir24_8.h | 2 +- lib/fib/trie.h | 2 +- lib/hash/rte_thash.c | 4 ++-- lib/pipeline/rte_pipeline.h | 2 +- lib/rcu/rcu_qsbr_pvt.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-)
Quoted 1 line
Series-acked-by Stephen Hemminger <[email protected]>
Quoted 8 lines · Tyler Retzlaff
Replace some missed zero length arrays not captured in the original series.
https://patchwork.dpdk.org/project/dpdk/list/?series=30410&state=*Zero length arrays are a GNU extension that has been superseded by flex arrays.
Quoted 6 lines
https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
v2:
* added additional patches for fib & pipeline libs. series-acks have been placed only against original hash and rcu patches.
There seems to be an issue with the ABI check on those changes. After a quick chat with Dodji, I opened a bug for libabigail.
https://sourceware.org/bugzilla/show_bug.cgi?id=31377
Signature · 1 line
David Marchand
Quoted 17 lines · David Marchand
Quoted 8 lines · Tyler Retzlaff
Replace some missed zero length arrays not captured in the original series.
https://patchwork.dpdk.org/project/dpdk/list/?series=30410&state=*Zero length arrays are a GNU extension that has been superseded by flex arrays.
Quoted 6 lines
https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
v2:
* added additional patches for fib & pipeline libs. series-acks have been placed only against original hash and rcu patches.
Quoted 4 lines
There seems to be an issue with the ABI check on those changes. After a quick chat with Dodji, I opened a bug for libabigail.
I double checked again and I don't see the struct in question being embedded as a field of another struct/union. So I don't think there should be an ABI change here.
I'm okay with the change being merged but if there is concern I can drop this patch from the series.
Quoted 4 lines
Signature · 2 lines
-- David Marchand
Quoted 19 lines · Tyler Retzlaff
Quoted 17 lines · David Marchand
Quoted 14 lines · Tyler Retzlaff
Replace some missed zero length arrays not captured in the original series.
https://patchwork.dpdk.org/project/dpdk/list/?series=30410&state=*Zero length arrays are a GNU extension that has been superseded by flex arrays.
https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
v2:
* added additional patches for fib & pipeline libs. series-acks have been placed only against original hash and rcu patches.
Quoted 8 lines
Quoted 4 lines
There seems to be an issue with the ABI check on those changes. After a quick chat with Dodji, I opened a bug for libabigail.
I double checked again and I don't see the struct in question being embedded as a field of another struct/union. So I don't think there should be an ABI change here.
That was and is still my understanding too.
The message we get when testing this series is:
type size hasn't changed
1 data member change:
'uint8_t action_data[]' has *some* difference
- please report as a bug
which is why I reached out to Dodji (libabigail maintainer).
Dodji explained me that zero length / flex arrays conversion is something he has been working on, and there are still some rough edges.
This message is there so that libabigail community gets more input on real life cases to handle.
Quoted 3 lines
I'm okay with the change being merged but if there is concern I can drop this patch from the series.
At least, we can't merge it in the current form.
If libabigail gets a fix quickly, DPDK CI will still need a released version. So for this patch to be merged now, we need a libabigail suppression rule. I don't see a way to precisely waive this issue, so my suggestion is to silence any change on the concerned structure here (which should be ok, as the pipeline library data struct have been super stable for a couple of years).
Something like:
$ git diff
devtools/libabigail.abignore +2 -0
@@ -33,3 +33,5 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Temporary exceptions till next major ABI version ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +[suppress_type] + name = rte_pipeline_table_entry
Signature · 1 line
David Marchand
Quoted 19 lines · David Marchand
Quoted 2 lines
I'm okay with the change being merged but if there is concern I can drop this patch from the series.
At least, we can't merge it in the current form.
If libabigail gets a fix quickly, DPDK CI will still need a released version. So for this patch to be merged now, we need a libabigail suppression rule. I don't see a way to precisely waive this issue, so my suggestion is to silence any change on the concerned structure here (which should be ok, as the pipeline library data struct have been super stable for a couple of years).
Something like:$ git diffdevtools/libabigail.abignore +0
-0
devtools/libabigail.abignore line 37
Quoted 5 lines
devtools/libabigail.abignore +2
-0@@ -33,3 +33,5 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Temporary exceptions till next major ABI version ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +[suppress_type] + name = rte_pipeline_table_entry
Dodji confirmed the issue in libabigail and prepared a fix.
DPDK still needs a suppression rule (like the one proposed above) if we want to merge this change before the libabigail fix makes it to all distribs.
Please resubmit this series with my proposal and a comment pointing at libabigail bz squashed in patch 4.
Signature · 1 line
David Marchand
Quoted 29 lines · David Marchand
Quoted 19 lines · David Marchand
Quoted 2 lines
I'm okay with the change being merged but if there is concern I can drop this patch from the series.
At least, we can't merge it in the current form.
If libabigail gets a fix quickly, DPDK CI will still need a released version. So for this patch to be merged now, we need a libabigail suppression rule. I don't see a way to precisely waive this issue, so my suggestion is to silence any change on the concerned structure here (which should be ok, as the pipeline library data struct have been super stable for a couple of years).
Something like:$ git diffdevtools/libabigail.abignore +0
-0devtools/libabigail.abignore line 37
Quoted 5 lines
devtools/libabigail.abignore +2
-0@@ -33,3 +33,5 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Temporary exceptions till next major ABI version ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +[suppress_type] + name = rte_pipeline_table_entryDodji confirmed the issue in libabigail and prepared a fix.
Quoted 5 lines
DPDK still needs a suppression rule (like the one proposed above) if we want to merge this change before the libabigail fix makes it to all distribs.
Please resubmit this series with my proposal and a comment pointing at libabigail bz squashed in patch 4.
this works out conveniently, i noticed there are a few more instances that i'll try to add to this series so i'll come back with a new rev.
i've marked the series changes requested in patchwork for now.
Quoted 4 lines
Signature · 2 lines
-- David Marchand
Hello,
Quoted 1 line · David Marchand
Dodji confirmed the issue in libabigail and prepared a fix.
Yes, that is correct. Sorry for the inconvenience.
The patch fixing this issue in libabigail has been applied to the mainline and is
https://sourceware.org/git/?p=libabigail.git;a=commit;h=3cc1c3423c89c2cfd9d451ab99b71f3a74b35127.
Quoted 3 lines
DPDK still needs a suppression rule (like the one proposed above) if we want to merge this change before the libabigail fix makes it to all distribs.
We can discuss further if you need a "quick" 2.4.1 release as a vehicle to consume the fix or if you can wait for a 2.5 one that might come later.
I agree however that in the mean time, a temporary suppression specification might be warranted.
[...]
Cheers,
Signature · 1 line
Dodji
v3 cover more replacement of zero length array
In reply to Tyler RetzlaffReplace some missed zero length arrays not captured in the original series.
https://patchwork.dpdk.org/project/dpdk/list/?series=30410&state=*
Zero length arrays are a GNU extension that has been superseded by flex arrays.
https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
v3:
* add temporary suppression of libabigail bug
https://sourceware.org/bugzilla/show_bug.cgi?id=31377
* add 2 more patches covering lpm and table (series ack has not been extended)
* add another zero length array missed in rcu and pipeline
v2:
* added additional patches for fib & pipeline libs. series-acks have been placed only against original hash and rcu patches.
Tyler Retzlaff (6):
hash: replace zero length array with flex array
rcu: replace zero length array with flex array
fib: replace zero length array with flex array
pipeline: replace zero length array with flex array
lpm: replace zero length array with flex array
table: replace zero length array with flex array
devtools/libabigail.abignore | 2 ++ lib/fib/dir24_8.h | 2 +- lib/fib/trie.h | 2 +- lib/hash/rte_thash.c | 4 ++-- lib/lpm/rte_lpm6.c | 2 +- lib/pipeline/rte_pipeline.h | 2 +- lib/pipeline/rte_port_in_action.c | 2 +- lib/rcu/rcu_qsbr_pvt.h | 2 +- lib/rcu/rte_rcu_qsbr.h | 2 +- lib/table/rte_table_acl.c | 2 +- lib/table/rte_table_array.c | 2 +- lib/table/rte_table_hash_cuckoo.c | 2 +- lib/table/rte_table_hash_ext.c | 2 +- lib/table/rte_table_hash_key16.c | 2 +- lib/table/rte_table_hash_key32.c | 2 +- lib/table/rte_table_hash_key8.c | 2 +- lib/table/rte_table_hash_lru.c | 2 +- lib/table/rte_table_lpm.c | 2 +- lib/table/rte_table_lpm_ipv6.c | 2 +- 19 files changed, 21 insertions(+), 19 deletions(-)
Signature · 1 line
1.8.3.1
PATCH v3 1/6 hash: replace zero length array with flex array
Zero length arrays are GNU extension. Replace with standard flex array.
--- lib/hash/rte_thash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/hash/rte_thash.c +2 -2
@@ -80,7 +80,7 @@ struct rte_thash_subtuple_helper {uint32_t tuple_offset;/** < Offset in bits of the subtuple */ uint32_t tuple_len;/** < Length in bits of the subtuple */ uint32_t lsb_msk;/** < (1 << reta_sz_log) - 1 */ - __extension__ uint32_t compl_table[0] __rte_cache_aligned; + uint32_t compl_table[] __rte_cache_aligned;/** < Complementary table */ };
@@ -93,7 +93,7 @@ struct rte_thash_ctx {uint32_t flags;uint64_t *matrices;/**< matrices used with rte_thash_gfni implementation */ -uint8_t hash_key[0 ]; +uint8_t hash_key[]; };int
Signature · 1 line
1.8.3.1
PATCH v3 2/6 rcu: replace zero length array with flex array
In reply to Tyler RetzlaffZero length arrays are GNU extension. Replace with standard flex array.
--- lib/rcu/rcu_qsbr_pvt.h | 2 +- lib/rcu/rte_rcu_qsbr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
lib/rcu/rcu_qsbr_pvt.h +1 -1
@@ -52,7 +52,7 @@ struct rte_rcu_qsbr_dq {*/ typedef struct {uint64_t token;/**< Token */ -uint8_t elem[0 ];/**< Pointer to user element */ +uint8_t elem[];/**< Pointer to user element */ } __attribute__((__may_alias__))__rte_rcu_qsbr_dq_elem_t ;#endif /* _RTE_RCU_QSBR_PVT_H_ */
lib/rcu/rte_rcu_qsbr.h +1 -1
@@ -106,7 +106,7 @@ struct rte_rcu_qsbr {uint32_t max_threads;/**< Maximum number of threads using this QS variable */ - struct rte_rcu_qsbr_cnt qsbr_cnt[0] __rte_cache_aligned; + struct rte_rcu_qsbr_cnt qsbr_cnt[] __rte_cache_aligned;/**< Quiescent state counter array of 'max_threads' elements */ /**< Registered thread IDs are stored in a bitmap array,
Signature · 1 line
1.8.3.1
PATCH v3 3/6 fib: replace zero length array with flex array
In reply to Tyler RetzlaffZero length arrays are GNU extension. Replace with standard flex array.
--- lib/fib/dir24_8.h | 2 +- lib/fib/trie.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
lib/fib/dir24_8.h +1 -1
@@ -32,7 +32,7 @@ struct dir24_8_tbl {uint64_t *tbl8;/**< tbl8 table. */ uint64_t *tbl8_idxes;/**< bitmap containing free tbl8 idxes*/ /* tbl24 table. */ - __extension__ uint64_t tbl24[0] __rte_cache_aligned; + uint64_t tbl24[] __rte_cache_aligned; }; static inline void *
lib/fib/trie.h +1 -1
@@ -36,7 +36,7 @@ struct rte_trie_tbl {uint32_t *tbl8_pool;/**< bitmap containing free tbl8 idxes*/ uint32_t tbl8_pool_pos;/* tbl24 table. */ - __extension__ uint64_t tbl24[0] __rte_cache_aligned; + uint64_t tbl24[] __rte_cache_aligned; }; static inline uint32_t
Signature · 1 line
1.8.3.1
PATCH v3 4/6 pipeline: replace zero length array with flex array
In reply to Tyler RetzlaffZero length arrays are GNU extension. Replace with standard flex array.
Add a temporary suppression for rte_pipeline_table_entry libabigail bug:
Bugzilla ID: https://sourceware.org/bugzilla/show_bug.cgi?id=31377
--- devtools/libabigail.abignore | 2 ++ lib/pipeline/rte_pipeline.h | 2 +- lib/pipeline/rte_port_in_action.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-)
devtools/libabigail.abignore +2 -0
@@ -33,6 +33,8 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Temporary exceptions till next major ABI version ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +[suppress_type] + name = rte_pipeline_table_entry [suppress_type] name = rte_eth_fp_ops
lib/pipeline/rte_pipeline.h +1 -1
@@ -220,7 +220,7 @@ struct rte_pipeline_table_entry {uint32_t table_id; };/** Start of table entry area for user defined actions and meta-data */ - __extension__uint8_t action_data[0 ]; +uint8_t action_data[]; };/**
lib/pipeline/rte_port_in_action.c +1 -1
@@ -282,7 +282,7 @@ struct rte_port_in_action_profile *struct rte_port_in_action {struct ap_config cfg;struct ap_data data; - uint8_t memory[0] __rte_cache_aligned; + uint8_t memory[] __rte_cache_aligned; }; static __rte_always_inline void *
Signature · 1 line
1.8.3.1
PATCH v3 5/6 lpm: replace zero length array with flex array
In reply to Tyler RetzlaffZero length arrays are GNU extension. Replace with standard flex array.
--- lib/lpm/rte_lpm6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/lpm/rte_lpm6.c +1 -1
@@ -106,7 +106,7 @@ struct rte_lpm6 {struct rte_lpm_tbl8_hdr *tbl8_hdrs;/* array of tbl8 headers */ - struct rte_lpm6_tbl_entry tbl8[0] + struct rte_lpm6_tbl_entry tbl8[] __rte_cache_aligned;/**< LPM tbl8 table. */ };
Signature · 1 line
1.8.3.1
RE: [PATCH v3 5/6] lpm: replace zero length array with flex array
Quoted 8 lines
From: Tyler Retzlaff [mailto:[email protected]]
Sent: Wednesday, 28 February 2024 00.57Zero length arrays are GNU extension. Replace with standard flex array.
Signed-off-by Tyler Retzlaff <[email protected]>---
PATCH v3 6/6 table: replace zero length array with flex array
In reply to Tyler RetzlaffZero length arrays are GNU extension. Replace with standard flex array.
--- lib/table/rte_table_acl.c | 2 +- lib/table/rte_table_array.c | 2 +- lib/table/rte_table_hash_cuckoo.c | 2 +- lib/table/rte_table_hash_ext.c | 2 +- lib/table/rte_table_hash_key16.c | 2 +- lib/table/rte_table_hash_key32.c | 2 +- lib/table/rte_table_hash_key8.c | 2 +- lib/table/rte_table_hash_lru.c | 2 +- lib/table/rte_table_lpm.c | 2 +- lib/table/rte_table_lpm_ipv6.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-)
lib/table/rte_table_acl.c +1 -1
@@ -47,7 +47,7 @@ struct rte_table_acl {uint8_t *acl_rule_memory;/* Memory to store the rules */ /* Memory to store the action table and stack of free entries */ - uint8_t memory[0] __rte_cache_aligned; + uint8_t memory[] __rte_cache_aligned; };
lib/table/rte_table_array.c +1 -1
@@ -39,7 +39,7 @@ struct rte_table_array {uint32_t entry_pos_mask;/* Internal table */ - uint8_t array[0] __rte_cache_aligned; + uint8_t array[] __rte_cache_aligned; } __rte_cache_aligned; static void *
lib/table/rte_table_hash_cuckoo.c +1 -1
@@ -42,7 +42,7 @@ struct rte_table_hash {struct rte_hash *h_table;/* Lookup table */ - uint8_t memory[0] __rte_cache_aligned; + uint8_t memory[] __rte_cache_aligned; }; static int
lib/table/rte_table_hash_ext.c +1 -1
@@ -99,7 +99,7 @@ struct rte_table_hash {uint32_t *bkt_ext_stack;/* Table memory */ - uint8_t memory[0] __rte_cache_aligned; + uint8_t memory[] __rte_cache_aligned; }; static int
lib/table/rte_table_hash_key16.c +1 -1
@@ -83,7 +83,7 @@ struct rte_table_hash {uint32_t *stack;/* Lookup table */ - uint8_t memory[0] __rte_cache_aligned; + uint8_t memory[] __rte_cache_aligned; }; static int
lib/table/rte_table_hash_key32.c +1 -1
@@ -83,7 +83,7 @@ struct rte_table_hash {uint32_t *stack;/* Lookup table */ - uint8_t memory[0] __rte_cache_aligned; + uint8_t memory[] __rte_cache_aligned; }; static int
lib/table/rte_table_hash_key8.c +1 -1
@@ -79,7 +79,7 @@ struct rte_table_hash {uint32_t *stack;/* Lookup table */ - uint8_t memory[0] __rte_cache_aligned; + uint8_t memory[] __rte_cache_aligned; }; static int
lib/table/rte_table_hash_lru.c +1 -1
@@ -76,7 +76,7 @@ struct rte_table_hash {uint32_t *key_stack;/* Table memory */ - uint8_t memory[0] __rte_cache_aligned; + uint8_t memory[] __rte_cache_aligned; }; static int
lib/table/rte_table_lpm.c +1 -1
@@ -47,7 +47,7 @@ struct rte_table_lpm {/* Next Hop Table (NHT) */ uint32_t nht_users[RTE_TABLE_LPM_MAX_NEXT_HOPS ]; - uint8_t nht[0] __rte_cache_aligned; + uint8_t nht[] __rte_cache_aligned; }; static void *
lib/table/rte_table_lpm_ipv6.c +1 -1
@@ -44,7 +44,7 @@ struct rte_table_lpm_ipv6 {/* Next Hop Table (NHT) */ uint32_t nht_users[RTE_TABLE_LPM_MAX_NEXT_HOPS ]; - uint8_t nht[0] __rte_cache_aligned; + uint8_t nht[] __rte_cache_aligned; }; static void *
Signature · 1 line
1.8.3.1
RE: [PATCH v3 6/6] table: replace zero length array with flex array
Quoted 8 lines
From: Tyler Retzlaff [mailto:[email protected]]
Sent: Wednesday, 28 February 2024 00.57Zero length arrays are GNU extension. Replace with standard flex array.
Signed-off-by Tyler Retzlaff <[email protected]>---
v4 cover more replacement of zero length array
In reply to Tyler RetzlaffReplace some missed zero length arrays not captured in the original series.
https://patchwork.dpdk.org/project/dpdk/list/?series=30410&state=*
Zero length arrays are a GNU extension that has been superseded by flex arrays.
https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
v4:
* add another temporary suppression of libabigail bug for rte_rcu_qsbr. As with pipeline i cannot see that rte_rcu_qsbr is nested in any other struct.
v3:
* add temporary suppression of libabigail bug
https://sourceware.org/bugzilla/show_bug.cgi?id=31377
* add 2 more patches covering lpm and table (series ack has not been extended)
* add another zero length array missed in rcu and pipeline
v2:
* added additional patches for fib & pipeline libs. series-acks have been placed only against original hash and rcu patches.
Tyler Retzlaff (6):
hash: replace zero length array with flex array
rcu: replace zero length array with flex array
fib: replace zero length array with flex array
pipeline: replace zero length array with flex array
lpm: replace zero length array with flex array
table: replace zero length array with flex array
devtools/libabigail.abignore | 5 +++++ lib/fib/dir24_8.h | 2 +- lib/fib/trie.h | 2 +- lib/hash/rte_thash.c | 4 ++-- lib/lpm/rte_lpm6.c | 2 +- lib/pipeline/rte_pipeline.h | 2 +- lib/pipeline/rte_port_in_action.c | 2 +- lib/rcu/rcu_qsbr_pvt.h | 2 +- lib/rcu/rte_rcu_qsbr.h | 2 +- lib/table/rte_table_acl.c | 2 +- lib/table/rte_table_array.c | 2 +- lib/table/rte_table_hash_cuckoo.c | 2 +- lib/table/rte_table_hash_ext.c | 2 +- lib/table/rte_table_hash_key16.c | 2 +- lib/table/rte_table_hash_key32.c | 2 +- lib/table/rte_table_hash_key8.c | 2 +- lib/table/rte_table_hash_lru.c | 2 +- lib/table/rte_table_lpm.c | 2 +- lib/table/rte_table_lpm_ipv6.c | 2 +- 19 files changed, 24 insertions(+), 19 deletions(-)
Signature · 1 line
1.8.3.1
PATCH v4 1/6 hash: replace zero length array with flex array
Zero length arrays are GNU extension. Replace with standard flex array.
--- lib/hash/rte_thash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/hash/rte_thash.c +2 -2
@@ -80,7 +80,7 @@ struct rte_thash_subtuple_helper {uint32_t tuple_offset;/** < Offset in bits of the subtuple */ uint32_t tuple_len;/** < Length in bits of the subtuple */ uint32_t lsb_msk;/** < (1 << reta_sz_log) - 1 */ - __extension__ uint32_t compl_table[0] __rte_cache_aligned; + uint32_t compl_table[] __rte_cache_aligned;/** < Complementary table */ };
@@ -93,7 +93,7 @@ struct rte_thash_ctx {uint32_t flags;uint64_t *matrices;/**< matrices used with rte_thash_gfni implementation */ -uint8_t hash_key[0 ]; +uint8_t hash_key[]; };int
Signature · 1 line
1.8.3.1
PATCH v4 2/6 rcu: replace zero length array with flex array
In reply to Tyler RetzlaffZero length arrays are GNU extension. Replace with standard flex array.
Add a temporary suppression for rte_pipeline_table_entry libabigail bug:
Bugzilla ID: https://sourceware.org/bugzilla/show_bug.cgi?id=31377
--- devtools/libabigail.abignore | 3 +++ lib/rcu/rcu_qsbr_pvt.h | 2 +- lib/rcu/rte_rcu_qsbr.h | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-)
devtools/libabigail.abignore +3 -0
@@ -35,5 +35,8 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [suppress_type] + name = rte_rcu_qsbr + +[suppress_type] name = rte_eth_fp_ops has_data_member_inserted_between = {offset_of(reserved2), end}
lib/rcu/rcu_qsbr_pvt.h +1 -1
@@ -52,7 +52,7 @@ struct rte_rcu_qsbr_dq {*/ typedef struct {uint64_t token;/**< Token */ -uint8_t elem[0 ];/**< Pointer to user element */ +uint8_t elem[];/**< Pointer to user element */ } __attribute__((__may_alias__))__rte_rcu_qsbr_dq_elem_t ;#endif /* _RTE_RCU_QSBR_PVT_H_ */
lib/rcu/rte_rcu_qsbr.h +1 -1
@@ -106,7 +106,7 @@ struct rte_rcu_qsbr {uint32_t max_threads;/**< Maximum number of threads using this QS variable */ - struct rte_rcu_qsbr_cnt qsbr_cnt[0] __rte_cache_aligned; + struct rte_rcu_qsbr_cnt qsbr_cnt[] __rte_cache_aligned;/**< Quiescent state counter array of 'max_threads' elements */ /**< Registered thread IDs are stored in a bitmap array,
Signature · 1 line
1.8.3.1
PATCH v4 3/6 fib: replace zero length array with flex array
In reply to Tyler RetzlaffZero length arrays are GNU extension. Replace with standard flex array.
--- lib/fib/dir24_8.h | 2 +- lib/fib/trie.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
lib/fib/dir24_8.h +1 -1
@@ -32,7 +32,7 @@ struct dir24_8_tbl {uint64_t *tbl8;/**< tbl8 table. */ uint64_t *tbl8_idxes;/**< bitmap containing free tbl8 idxes*/ /* tbl24 table. */ - __extension__ uint64_t tbl24[0] __rte_cache_aligned; + uint64_t tbl24[] __rte_cache_aligned; }; static inline void *
lib/fib/trie.h +1 -1
@@ -36,7 +36,7 @@ struct rte_trie_tbl {uint32_t *tbl8_pool;/**< bitmap containing free tbl8 idxes*/ uint32_t tbl8_pool_pos;/* tbl24 table. */ - __extension__ uint64_t tbl24[0] __rte_cache_aligned; + uint64_t tbl24[] __rte_cache_aligned; }; static inline uint32_t
Signature · 1 line
1.8.3.1
PATCH v4 4/6 pipeline: replace zero length array with flex array
In reply to Tyler RetzlaffZero length arrays are GNU extension. Replace with standard flex array.
Add a temporary suppression for rte_pipeline_table_entry libabigail bug:
Bugzilla ID: https://sourceware.org/bugzilla/show_bug.cgi?id=31377
--- devtools/libabigail.abignore | 2 ++ lib/pipeline/rte_pipeline.h | 2 +- lib/pipeline/rte_port_in_action.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-)
devtools/libabigail.abignore +2 -0
@@ -33,6 +33,8 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Temporary exceptions till next major ABI version ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +[suppress_type] + name = rte_pipeline_table_entry [suppress_type] name = rte_rcu_qsbr
lib/pipeline/rte_pipeline.h +1 -1
@@ -220,7 +220,7 @@ struct rte_pipeline_table_entry {uint32_t table_id; };/** Start of table entry area for user defined actions and meta-data */ - __extension__uint8_t action_data[0 ]; +uint8_t action_data[]; };/**
lib/pipeline/rte_port_in_action.c +1 -1
@@ -282,7 +282,7 @@ struct rte_port_in_action_profile *struct rte_port_in_action {struct ap_config cfg;struct ap_data data; - uint8_t memory[0] __rte_cache_aligned; + uint8_t memory[] __rte_cache_aligned; }; static __rte_always_inline void *
Signature · 1 line
1.8.3.1
PATCH v4 5/6 lpm: replace zero length array with flex array
In reply to Tyler RetzlaffZero length arrays are GNU extension. Replace with standard flex array.
--- lib/lpm/rte_lpm6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/lpm/rte_lpm6.c +1 -1
@@ -106,7 +106,7 @@ struct rte_lpm6 {struct rte_lpm_tbl8_hdr *tbl8_hdrs;/* array of tbl8 headers */ - struct rte_lpm6_tbl_entry tbl8[0] + struct rte_lpm6_tbl_entry tbl8[] __rte_cache_aligned;/**< LPM tbl8 table. */ };
Signature · 1 line
1.8.3.1
RE: [PATCH v4 5/6] lpm: replace zero length array with flex array
Quoted 8 lines
From: Tyler Retzlaff [mailto:[email protected]]
Sent: Thursday, 29 February 2024 23.59Zero length arrays are GNU extension. Replace with standard flex array.
Signed-off-by Tyler Retzlaff <[email protected]>---
PATCH v4 6/6 table: replace zero length array with flex array
In reply to Tyler RetzlaffZero length arrays are GNU extension. Replace with standard flex array.
--- lib/table/rte_table_acl.c | 2 +- lib/table/rte_table_array.c | 2 +- lib/table/rte_table_hash_cuckoo.c | 2 +- lib/table/rte_table_hash_ext.c | 2 +- lib/table/rte_table_hash_key16.c | 2 +- lib/table/rte_table_hash_key32.c | 2 +- lib/table/rte_table_hash_key8.c | 2 +- lib/table/rte_table_hash_lru.c | 2 +- lib/table/rte_table_lpm.c | 2 +- lib/table/rte_table_lpm_ipv6.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-)
lib/table/rte_table_acl.c +1 -1
@@ -47,7 +47,7 @@ struct rte_table_acl {uint8_t *acl_rule_memory;/* Memory to store the rules */ /* Memory to store the action table and stack of free entries */ - uint8_t memory[0] __rte_cache_aligned; + uint8_t memory[] __rte_cache_aligned; };
lib/table/rte_table_array.c +1 -1
@@ -39,7 +39,7 @@ struct rte_table_array {uint32_t entry_pos_mask;/* Internal table */ - uint8_t array[0] __rte_cache_aligned; + uint8_t array[] __rte_cache_aligned; } __rte_cache_aligned; static void *
lib/table/rte_table_hash_cuckoo.c +1 -1
@@ -42,7 +42,7 @@ struct rte_table_hash {struct rte_hash *h_table;/* Lookup table */ - uint8_t memory[0] __rte_cache_aligned; + uint8_t memory[] __rte_cache_aligned; }; static int
lib/table/rte_table_hash_ext.c +1 -1
@@ -99,7 +99,7 @@ struct rte_table_hash {uint32_t *bkt_ext_stack;/* Table memory */ - uint8_t memory[0] __rte_cache_aligned; + uint8_t memory[] __rte_cache_aligned; }; static int
lib/table/rte_table_hash_key16.c +1 -1
@@ -83,7 +83,7 @@ struct rte_table_hash {uint32_t *stack;/* Lookup table */ - uint8_t memory[0] __rte_cache_aligned; + uint8_t memory[] __rte_cache_aligned; }; static int
lib/table/rte_table_hash_key32.c +1 -1
@@ -83,7 +83,7 @@ struct rte_table_hash {uint32_t *stack;/* Lookup table */ - uint8_t memory[0] __rte_cache_aligned; + uint8_t memory[] __rte_cache_aligned; }; static int
lib/table/rte_table_hash_key8.c +1 -1
@@ -79,7 +79,7 @@ struct rte_table_hash {uint32_t *stack;/* Lookup table */ - uint8_t memory[0] __rte_cache_aligned; + uint8_t memory[] __rte_cache_aligned; }; static int
lib/table/rte_table_hash_lru.c +1 -1
@@ -76,7 +76,7 @@ struct rte_table_hash {uint32_t *key_stack;/* Table memory */ - uint8_t memory[0] __rte_cache_aligned; + uint8_t memory[] __rte_cache_aligned; }; static int
lib/table/rte_table_lpm.c +1 -1
@@ -47,7 +47,7 @@ struct rte_table_lpm {/* Next Hop Table (NHT) */ uint32_t nht_users[RTE_TABLE_LPM_MAX_NEXT_HOPS ]; - uint8_t nht[0] __rte_cache_aligned; + uint8_t nht[] __rte_cache_aligned; }; static void *
lib/table/rte_table_lpm_ipv6.c +1 -1
@@ -44,7 +44,7 @@ struct rte_table_lpm_ipv6 {/* Next Hop Table (NHT) */ uint32_t nht_users[RTE_TABLE_LPM_MAX_NEXT_HOPS ]; - uint8_t nht[0] __rte_cache_aligned; + uint8_t nht[] __rte_cache_aligned; }; static void *
Signature · 1 line
1.8.3.1
RE: [PATCH v4 6/6] table: replace zero length array with flex array
Quoted 8 lines
From: Tyler Retzlaff [mailto:[email protected]]
Sent: Thursday, 29 February 2024 23.59Zero length arrays are GNU extension. Replace with standard flex array.
Signed-off-by Tyler Retzlaff <[email protected]>---
ping
Is this one worth closing out as a part of rc2 so it is done?
not sure if it's a priority to have lib ~complete.
Quoted 57 lines · Tyler Retzlaff
Replace some missed zero length arrays not captured in the original series.
https://patchwork.dpdk.org/project/dpdk/list/?series=30410&state=*Zero length arrays are a GNU extension that has been superseded by flex arrays.
https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
v4:
* add another temporary suppression of libabigail bug forrte_rcu_qsbr. As with pipeline i cannot see thatrte_rcu_qsbris nested in any other struct.v3:
* add temporary suppression of libabigail bughttps://sourceware.org/bugzilla/show_bug.cgi?id=31377* add 2 more patches covering lpm and table (series ack has not been extended)
* add another zero length array missed in rcu and pipelinev2:
* added additional patches for fib & pipeline libs. series-acks have been placed only against original hash and rcu patches.Tyler Retzlaff (6):
hash: replace zero length array with flex array
rcu: replace zero length array with flex array
fib: replace zero length array with flex array
pipeline: replace zero length array with flex array
lpm: replace zero length array with flex array
table: replace zero length array with flex arraydevtools/libabigail.abignore | 5 +++++ lib/fib/dir24_8.h | 2 +- lib/fib/trie.h | 2 +- lib/hash/rte_thash.c | 4 ++-- lib/lpm/rte_lpm6.c | 2 +- lib/pipeline/rte_pipeline.h | 2 +- lib/pipeline/rte_port_in_action.c | 2 +- lib/rcu/rcu_qsbr_pvt.h | 2 +- lib/rcu/rte_rcu_qsbr.h | 2 +- lib/table/rte_table_acl.c | 2 +- lib/table/rte_table_array.c | 2 +- lib/table/rte_table_hash_cuckoo.c | 2 +- lib/table/rte_table_hash_ext.c | 2 +- lib/table/rte_table_hash_key16.c | 2 +- lib/table/rte_table_hash_key32.c | 2 +- lib/table/rte_table_hash_key8.c | 2 +- lib/table/rte_table_hash_lru.c | 2 +- lib/table/rte_table_lpm.c | 2 +- lib/table/rte_table_lpm_ipv6.c | 2 +- 19 files changed, 24 insertions(+), 19 deletions(-)Signature · 1 line
1.8.3.1
v5 cover more replacement of zero length array
In reply to Tyler RetzlaffReplace some missed zero length arrays not captured in the original series.
https://patchwork.dpdk.org/project/dpdk/list/?series=30410&state=*
Zero length arrays are a GNU extension that has been superseded by flex arrays.
https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
v5:
* no changes, rebase for upstream merge / conflicts.
v4:
* add another temporary suppression of libabigail bug for rte_rcu_qsbr. As with pipeline i cannot see that rte_rcu_qsbr is nested in any other struct.
v3:
* add temporary suppression of libabigail bug
https://sourceware.org/bugzilla/show_bug.cgi?id=31377
* add 2 more patches covering lpm and table (series ack has not been extended)
* add another zero length array missed in rcu and pipeline
v2:
* added additional patches for fib & pipeline libs. series-acks have been placed only against original hash and rcu patches.
Tyler Retzlaff (6):
hash: replace zero length array with flex array
rcu: replace zero length array with flex array
fib: replace zero length array with flex array
pipeline: replace zero length array with flex array
lpm: replace zero length array with flex array
table: replace zero length array with flex array
devtools/libabigail.abignore | 5 +++++ lib/fib/dir24_8.h | 2 +- lib/fib/trie.h | 2 +- lib/hash/rte_thash.c | 4 ++-- lib/lpm/rte_lpm6.c | 2 +- lib/pipeline/rte_pipeline.h | 2 +- lib/pipeline/rte_port_in_action.c | 2 +- lib/rcu/rcu_qsbr_pvt.h | 2 +- lib/rcu/rte_rcu_qsbr.h | 2 +- lib/table/rte_table_acl.c | 2 +- lib/table/rte_table_array.c | 2 +- lib/table/rte_table_hash_cuckoo.c | 2 +- lib/table/rte_table_hash_ext.c | 2 +- lib/table/rte_table_hash_key16.c | 2 +- lib/table/rte_table_hash_key32.c | 2 +- lib/table/rte_table_hash_key8.c | 2 +- lib/table/rte_table_hash_lru.c | 2 +- lib/table/rte_table_lpm.c | 2 +- lib/table/rte_table_lpm_ipv6.c | 2 +- 19 files changed, 24 insertions(+), 19 deletions(-)
Signature · 1 line
1.8.3.1
PATCH v5 1/6 hash: replace zero length array with flex array
Zero length arrays are GNU extension. Replace with standard flex array.
--- lib/hash/rte_thash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/hash/rte_thash.c +2 -2
@@ -81,7 +81,7 @@ struct rte_thash_subtuple_helper {uint32_t tuple_offset;/** < Offset in bits of the subtuple */ uint32_t tuple_len;/** < Length in bits of the subtuple */ uint32_t lsb_msk;/** < (1 << reta_sz_log) - 1 */ - __extension__ alignas(RTE_CACHE_LINE_SIZE )uint32_t compl_table[0 ]; + alignas(RTE_CACHE_LINE_SIZE )uint32_t compl_table[];/** < Complementary table */ };
@@ -94,7 +94,7 @@ struct rte_thash_ctx {uint32_t flags;uint64_t *matrices;/**< matrices used with rte_thash_gfni implementation */ -uint8_t hash_key[0 ]; +uint8_t hash_key[]; };int
Signature · 1 line
1.8.3.1
Re: [PATCH v5 1/6] hash: replace zero length array with flex array
Quoted 34 lines · Tyler Retzlaff
Zero length arrays are GNU extension. Replace with standard flex array.
Signed-off-by Tyler Retzlaff <[email protected]>Reviewed-by Honnappa Nagarahalli <[email protected]>Reviewed-by Morten Brørup <[email protected]>Acked-by Chengwen Feng <[email protected]>--- lib/hash/rte_thash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)lib/hash/rte_thash.c +2
-2@@ -81,7 +81,7 @@ struct rte_thash_subtuple_helper {uint32_t tuple_offset;/** < Offset in bits of the subtuple */ uint32_t tuple_len;/** < Length in bits of the subtuple */ uint32_t lsb_msk;/** < (1 << reta_sz_log) - 1 */ - __extension__ alignas(RTE_CACHE_LINE_SIZE )uint32_t compl_table[0 ]; + alignas(RTE_CACHE_LINE_SIZE )uint32_t compl_table[];/** < Complementary table */ };@@ -94,7 +94,7 @@ struct rte_thash_ctx {uint32_t flags;uint64_t *matrices;/**< matrices used with rte_thash_gfni implementation */ -uint8_t hash_key[0 ]; +uint8_t hash_key[]; };int
Signature · 2 lines
Regards, Vladimir
PATCH v5 2/6 rcu: replace zero length array with flex array
In reply to Tyler RetzlaffZero length arrays are GNU extension. Replace with standard flex array.
Add a temporary suppression for rte_pipeline_table_entry libabigail bug:
Bugzilla ID: https://sourceware.org/bugzilla/show_bug.cgi?id=31377
--- devtools/libabigail.abignore | 3 +++ lib/rcu/rcu_qsbr_pvt.h | 2 +- lib/rcu/rte_rcu_qsbr.h | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-)
devtools/libabigail.abignore +3 -0
@@ -35,5 +35,8 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [suppress_type] + name = rte_rcu_qsbr + +[suppress_type] name = rte_eth_fp_ops has_data_member_inserted_between = {offset_of(reserved2), end}
lib/rcu/rcu_qsbr_pvt.h +1 -1
@@ -52,7 +52,7 @@ struct rte_rcu_qsbr_dq {*/ typedef struct {uint64_t token;/**< Token */ -uint8_t elem[0 ];/**< Pointer to user element */ +uint8_t elem[];/**< Pointer to user element */ } __attribute__((__may_alias__))__rte_rcu_qsbr_dq_elem_t ;#endif /* _RTE_RCU_QSBR_PVT_H_ */
lib/rcu/rte_rcu_qsbr.h +1 -1
@@ -107,7 +107,7 @@ struct __rte_cache_aligned rte_rcu_qsbr {uint32_t max_threads;/**< Maximum number of threads using this QS variable */ - alignas(RTE_CACHE_LINE_SIZE )struct rte_rcu_qsbr_cnt qsbr_cnt[0 ]; + alignas(RTE_CACHE_LINE_SIZE )struct rte_rcu_qsbr_cnt qsbr_cnt[];/**< Quiescent state counter array of 'max_threads' elements */ /**< Registered thread IDs are stored in a bitmap array,
Signature · 1 line
1.8.3.1
PATCH v5 3/6 fib: replace zero length array with flex array
In reply to Tyler RetzlaffZero length arrays are GNU extension. Replace with standard flex array.
--- lib/fib/dir24_8.h | 2 +- lib/fib/trie.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
lib/fib/dir24_8.h +1 -1
@@ -34,7 +34,7 @@ struct dir24_8_tbl {uint64_t *tbl8;/**< tbl8 table. */ uint64_t *tbl8_idxes;/**< bitmap containing free tbl8 idxes*/ /* tbl24 table. */ - __extension__ alignas(RTE_CACHE_LINE_SIZE )uint64_t tbl24[0 ]; + alignas(RTE_CACHE_LINE_SIZE )uint64_t tbl24[]; }; static inline void *
lib/fib/trie.h +1 -1
@@ -38,7 +38,7 @@ struct rte_trie_tbl {uint32_t *tbl8_pool;/**< bitmap containing free tbl8 idxes*/ uint32_t tbl8_pool_pos;/* tbl24 table. */ - __extension__ alignas(RTE_CACHE_LINE_SIZE )uint64_t tbl24[0 ]; + alignas(RTE_CACHE_LINE_SIZE )uint64_t tbl24[]; }; static inline uint32_t
Signature · 1 line
1.8.3.1
Re: [PATCH v5 3/6] fib: replace zero length array with flex array
Quoted 37 lines · Tyler Retzlaff
Zero length arrays are GNU extension. Replace with standard flex array.
Signed-off-by Tyler Retzlaff <[email protected]>Reviewed-by Morten Brørup <[email protected]>--- lib/fib/dir24_8.h | 2 +- lib/fib/trie.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)lib/fib/dir24_8.h +1
-1@@ -34,7 +34,7 @@ struct dir24_8_tbl {uint64_t *tbl8;/**< tbl8 table. */ uint64_t *tbl8_idxes;/**< bitmap containing free tbl8 idxes*/ /* tbl24 table. */ - __extension__ alignas(RTE_CACHE_LINE_SIZE )uint64_t tbl24[0 ]; + alignas(RTE_CACHE_LINE_SIZE )uint64_t tbl24[]; }; static inline void *lib/fib/trie.h +1
-1@@ -38,7 +38,7 @@ struct rte_trie_tbl {uint32_t *tbl8_pool;/**< bitmap containing free tbl8 idxes*/ uint32_t tbl8_pool_pos;/* tbl24 table. */ - __extension__ alignas(RTE_CACHE_LINE_SIZE )uint64_t tbl24[0 ]; + alignas(RTE_CACHE_LINE_SIZE )uint64_t tbl24[]; }; static inline uint32_t
Signature · 2 lines
Regards, Vladimir
PATCH v5 4/6 pipeline: replace zero length array with flex array
In reply to Tyler RetzlaffZero length arrays are GNU extension. Replace with standard flex array.
Add a temporary suppression for rte_pipeline_table_entry libabigail bug:
Bugzilla ID: https://sourceware.org/bugzilla/show_bug.cgi?id=31377
--- devtools/libabigail.abignore | 2 ++ lib/pipeline/rte_pipeline.h | 2 +- lib/pipeline/rte_port_in_action.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-)
devtools/libabigail.abignore +2 -0
@@ -33,6 +33,8 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Temporary exceptions till next major ABI version ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +[suppress_type] + name = rte_pipeline_table_entry [suppress_type] name = rte_rcu_qsbr
lib/pipeline/rte_pipeline.h +1 -1
@@ -220,7 +220,7 @@ struct rte_pipeline_table_entry {uint32_t table_id; };/** Start of table entry area for user defined actions and meta-data */ - __extension__uint8_t action_data[0 ]; +uint8_t action_data[]; };/**
lib/pipeline/rte_port_in_action.c +1 -1
@@ -283,7 +283,7 @@ struct rte_port_in_action_profile *struct rte_port_in_action {struct ap_config cfg;struct ap_data data; - alignas(RTE_CACHE_LINE_SIZE )uint8_t memory[0 ]; + alignas(RTE_CACHE_LINE_SIZE )uint8_t memory[]; }; static __rte_always_inline void *
Signature · 1 line
1.8.3.1
PATCH v5 5/6 lpm: replace zero length array with flex array
In reply to Tyler RetzlaffZero length arrays are GNU extension. Replace with standard flex array.
--- lib/lpm/rte_lpm6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/lpm/rte_lpm6.c +1 -1
@@ -107,7 +107,7 @@ struct rte_lpm6 {struct rte_lpm_tbl8_hdr *tbl8_hdrs;/* array of tbl8 headers */ - alignas(RTE_CACHE_LINE_SIZE )struct rte_lpm6_tbl_entry tbl8[0 ]; + alignas(RTE_CACHE_LINE_SIZE )struct rte_lpm6_tbl_entry tbl8[];/**< LPM tbl8 table. */ };
Signature · 1 line
1.8.3.1
Re: [PATCH v5 5/6] lpm: replace zero length array with flex array
Quoted 22 lines · Tyler Retzlaff
Zero length arrays are GNU extension. Replace with standard flex array.
Signed-off-by Tyler Retzlaff <[email protected]>Reviewed-by Morten Brørup <[email protected]>--- lib/lpm/rte_lpm6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/lpm/rte_lpm6.c +1
-1@@ -107,7 +107,7 @@ struct rte_lpm6 {struct rte_lpm_tbl8_hdr *tbl8_hdrs;/* array of tbl8 headers */ - alignas(RTE_CACHE_LINE_SIZE )struct rte_lpm6_tbl_entry tbl8[0 ]; + alignas(RTE_CACHE_LINE_SIZE )struct rte_lpm6_tbl_entry tbl8[];/**< LPM tbl8 table. */ };
Signature · 2 lines
Regards, Vladimir
PATCH v5 6/6 table: replace zero length array with flex array
In reply to Tyler RetzlaffZero length arrays are GNU extension. Replace with standard flex array.
--- lib/table/rte_table_acl.c | 2 +- lib/table/rte_table_array.c | 2 +- lib/table/rte_table_hash_cuckoo.c | 2 +- lib/table/rte_table_hash_ext.c | 2 +- lib/table/rte_table_hash_key16.c | 2 +- lib/table/rte_table_hash_key32.c | 2 +- lib/table/rte_table_hash_key8.c | 2 +- lib/table/rte_table_hash_lru.c | 2 +- lib/table/rte_table_lpm.c | 2 +- lib/table/rte_table_lpm_ipv6.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-)
lib/table/rte_table_acl.c +1 -1
@@ -48,7 +48,7 @@ struct rte_table_acl {uint8_t *acl_rule_memory;/* Memory to store the rules */ /* Memory to store the action table and stack of free entries */ - alignas(RTE_CACHE_LINE_SIZE )uint8_t memory[0 ]; + alignas(RTE_CACHE_LINE_SIZE )uint8_t memory[]; };
lib/table/rte_table_array.c +1 -1
@@ -40,7 +40,7 @@ struct __rte_cache_aligned rte_table_array {uint32_t entry_pos_mask;/* Internal table */ - alignas(RTE_CACHE_LINE_SIZE )uint8_t array[0 ]; + alignas(RTE_CACHE_LINE_SIZE )uint8_t array[]; }; static void *
lib/table/rte_table_hash_cuckoo.c +1 -1
@@ -44,7 +44,7 @@ struct rte_table_hash {struct rte_hash *h_table;/* Lookup table */ - alignas(RTE_CACHE_LINE_SIZE )uint8_t memory[0 ]; + alignas(RTE_CACHE_LINE_SIZE )uint8_t memory[]; }; static int
lib/table/rte_table_hash_ext.c +1 -1
@@ -100,7 +100,7 @@ struct rte_table_hash {uint32_t *bkt_ext_stack;/* Table memory */ - alignas(RTE_CACHE_LINE_SIZE )uint8_t memory[0 ]; + alignas(RTE_CACHE_LINE_SIZE )uint8_t memory[]; }; static int
lib/table/rte_table_hash_key16.c +1 -1
@@ -85,7 +85,7 @@ struct rte_table_hash {uint32_t *stack;/* Lookup table */ - alignas(RTE_CACHE_LINE_SIZE )uint8_t memory[0 ]; + alignas(RTE_CACHE_LINE_SIZE )uint8_t memory[]; }; static int
lib/table/rte_table_hash_key32.c +1 -1
@@ -85,7 +85,7 @@ struct rte_table_hash {uint32_t *stack;/* Lookup table */ - alignas(RTE_CACHE_LINE_SIZE )uint8_t memory[0 ]; + alignas(RTE_CACHE_LINE_SIZE )uint8_t memory[]; }; static int
lib/table/rte_table_hash_key8.c +1 -1
@@ -81,7 +81,7 @@ struct rte_table_hash {uint32_t *stack;/* Lookup table */ - alignas(RTE_CACHE_LINE_SIZE )uint8_t memory[0 ]; + alignas(RTE_CACHE_LINE_SIZE )uint8_t memory[]; }; static int
lib/table/rte_table_hash_lru.c +1 -1
@@ -77,7 +77,7 @@ struct rte_table_hash {uint32_t *key_stack;/* Table memory */ - alignas(RTE_CACHE_LINE_SIZE )uint8_t memory[0 ]; + alignas(RTE_CACHE_LINE_SIZE )uint8_t memory[]; }; static int
lib/table/rte_table_lpm.c +1 -1
@@ -48,7 +48,7 @@ struct rte_table_lpm {/* Next Hop Table (NHT) */ uint32_t nht_users[RTE_TABLE_LPM_MAX_NEXT_HOPS ]; - alignas(RTE_CACHE_LINE_SIZE )uint8_t nht[0 ]; + alignas(RTE_CACHE_LINE_SIZE )uint8_t nht[]; }; static void *
lib/table/rte_table_lpm_ipv6.c +1 -1
@@ -45,7 +45,7 @@ struct rte_table_lpm_ipv6 {/* Next Hop Table (NHT) */ uint32_t nht_users[RTE_TABLE_LPM_MAX_NEXT_HOPS ]; - alignas(RTE_CACHE_LINE_SIZE )uint8_t nht[0 ]; + alignas(RTE_CACHE_LINE_SIZE )uint8_t nht[]; }; static void *
Signature · 1 line
1.8.3.1
Quoted 50 lines · Tyler Retzlaff
Replace some missed zero length arrays not captured in the original series.
https://patchwork.dpdk.org/project/dpdk/list/?series=30410&state=*Zero length arrays are a GNU extension that has been superseded by flex arrays.
https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
v5:
* no changes, rebase for upstream merge / conflicts.v4:
* add another temporary suppression of libabigail bug forrte_rcu_qsbr. As with pipeline i cannot see thatrte_rcu_qsbris nested in any other struct.v3:
* add temporary suppression of libabigail bughttps://sourceware.org/bugzilla/show_bug.cgi?id=31377* add 2 more patches covering lpm and table (series ack has not been extended)
* add another zero length array missed in rcu and pipelinev2:
* added additional patches for fib & pipeline libs. series-acks have been placed only against original hash and rcu patches.Tyler Retzlaff (6):
hash: replace zero length array with flex array
rcu: replace zero length array with flex array
fib: replace zero length array with flex array
pipeline: replace zero length array with flex array
lpm: replace zero length array with flex array
table: replace zero length array with flex arraydevtools/libabigail.abignore | 5 +++++ lib/fib/dir24_8.h | 2 +- lib/fib/trie.h | 2 +- lib/hash/rte_thash.c | 4 ++-- lib/lpm/rte_lpm6.c | 2 +- lib/pipeline/rte_pipeline.h | 2 +- lib/pipeline/rte_port_in_action.c | 2 +- lib/rcu/rcu_qsbr_pvt.h | 2 +- lib/rcu/rte_rcu_qsbr.h | 2 +- lib/table/rte_table_acl.c | 2 +- lib/table/rte_table_array.c | 2 +- lib/table/rte_table_hash_cuckoo.c | 2 +-
Quoted 8 lines
lib/table/rte_table_hash_ext.c | 2 +- lib/table/rte_table_hash_key16.c | 2 +- lib/table/rte_table_hash_key32.c | 2 +- lib/table/rte_table_hash_key8.c | 2 +- lib/table/rte_table_hash_lru.c | 2 +- lib/table/rte_table_lpm.c | 2 +- lib/table/rte_table_lpm_ipv6.c | 2 +- 19 files changed, 24 insertions(+), 19 deletions(-)
libabigail 2.5 got released.
I had a try with it in GHA, and the false positive errors around lib/pipeline and lib/rcu are gone.
Yet there may still be people using older version, so let's take this series as is with the temporary exceptions.
Series applied, thanks.
Signature · 1 line
David Marchand