On Wed, Jul 29, 2026 at 4:12 PM Dragos Tarcatu <[email protected]> wrote: > > port_stats is declared as struct l2fwd_port_statistics[RTE_MAX_ETHPORTS], > but the memset passed sizeof(struct l2fwd_port_statistics) -- the size > of a single element -- leaving ports 1 through RTE_MAX_ETHPORTS-1 with > uninitialized stats. Use sizeof(rsrc->port_stats) to clear the whole > array regardless of RTE_MAX_ETHPORTS. > > Surfaced as a -Wmemset-elt-size warning when building with > -Dmax_ethports=64 -Dexamples=all. > > Fixes: 4ff457986f76 ("examples/l2fwd-event: add default poll mode routines") > Cc: [email protected] > > Signed-off-by: Dragos Tarcatu <[email protected]>
Added the following $ git diff diff --git a/.mailmap b/.mailmap index 9b7713b6df..52d19bde6b 100644 --- a/.mailmap +++ b/.mailmap @@ -428,6 +428,7 @@ Doug Dziggel <[email protected]> Doug Foster <[email protected]> Douglas Flint <[email protected]> Dr. David Alan Gilbert <[email protected]> +Dragos Tarcatu <[email protected]> Drocula Lambda <[email protected]> Dror Birkman <[email protected]> Dukai Yuan <[email protected]> and Applied to dpdk-next-eventdev/for-main. Thanks > --- > examples/l2fwd-event/main.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c > index 2d31d4c6ad..eff2bee503 100644 > --- a/examples/l2fwd-event/main.c > +++ b/examples/l2fwd-event/main.c > @@ -696,8 +696,7 @@ main(int argc, char **argv) > l2fwd_poll_resource_setup(rsrc); > > /* initialize port stats */ > - memset(&rsrc->port_stats, 0, > - sizeof(struct l2fwd_port_statistics)); > + memset(rsrc->port_stats, 0, sizeof(rsrc->port_stats)); > > /* All settings are done. Now enable eth devices */ > RTE_ETH_FOREACH_DEV(port_id) { > -- > 2.34.1 >

