Skip to contentSkip to conversation

net/sxe2: fix 32-bit SSE build

PATCH In review Thomas Monjalon 2 participants 5 messages May 28 – May 29 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/sxe2: fix 32-bit SSE build

Seen in OBS on i586 Debian:

from ../drivers/net/sxe2/sxe2_txrx_vec_sse.c:5:
In function ‘_mm_loadu_si128’,
inlined from ‘rte_memcpy’
inlined from ‘sxe2_rx_pkts_refactor’
at ../drivers/net/sxe2/sxe2_txrx_vec_common.h:233:2:
/usr/lib/gcc/i686-linux-gnu/12/include/emmintrin.h:703:10: error:
array subscript 8 is outside array bounds of ‘struct rte_mbuf *[32]’

The important options to reproduce are "-m32 -O2 -march=corei7".

In 32-bit build the pointer array done_pkts[32] is smaller:

	32 * 4 = 128 bytes

so an SSE access would be outside the bound.

The libc memcpy does not trigger such warning and is a good choice to copy an array of pointers.

---
 drivers/net/sxe2/sxe2_txrx_vec_common.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/sxe2/sxe2_txrx_vec_common.h +2 -1
index 99e1663f03..6b1649c390 100644
@@ -230,7 +230,8 @@ sxe2_rx_pkts_refactor(struct sxe2_rx_queue *rxq,
 	}
 	rxq->pkt_first_seg = first_seg;
 	rxq->pkt_last_seg  = last_seg;
-	rte_memcpy(mbuf_bufs, done_pkts, done_num * (sizeof(struct rte_mbuf *)));
+	memcpy(mbuf_bufs, done_pkts, done_num * sizeof(*done_pkts));
 	return done_num;
 }
+
 #endif /* SXE2_TXRX_VEC_COMMON_H */
Signature · 1 line
2.54.0
Tested-by on v1 1/1
#1 lore raw
Quoted 13 lines · Thomas Monjalon

Seen in OBS on i586 Debian:

from ../drivers/net/sxe2/sxe2_txrx_vec_sse.c:5:
In function ‘_mm_loadu_si128’,
inlined from ‘rte_memcpy’
inlined from ‘sxe2_rx_pkts_refactor’
at ../drivers/net/sxe2/sxe2_txrx_vec_common.h:233:2:
/usr/lib/gcc/i686-linux-gnu/12/include/emmintrin.h:703:10: error:
array subscript 8 is outside array bounds of ‘struct rte_mbuf *[32]’

The important options to reproduce are "-m32 -O2 -march=corei7".

Quoted 8 lines

In 32-bit build the pointer array done_pkts[32] is smaller:

        32 * 4 = 128 bytes

so an SSE access would be outside the bound.

The libc memcpy does not trigger such warning and is a good choice to copy an array of pointers.

I reproduced and checked Debian 13 32 bits build with OBS.

Signature · 1 line
David Marchand
#2 lore raw

28/05/2026 11:47, David Marchand:

Quoted 18 lines · Thomas Monjalon
Quoted 17 lines

Seen in OBS on i586 Debian:

from ../drivers/net/sxe2/sxe2_txrx_vec_sse.c:5:
In function ‘_mm_loadu_si128’,
inlined from ‘rte_memcpy’
inlined from ‘sxe2_rx_pkts_refactor’
at ../drivers/net/sxe2/sxe2_txrx_vec_common.h:233:2:
/usr/lib/gcc/i686-linux-gnu/12/include/emmintrin.h:703:10: error:
array subscript 8 is outside array bounds of ‘struct rte_mbuf *[32]’

The important options to reproduce are "-m32 -O2 -march=corei7".

In 32-bit build the pointer array done_pkts[32] is smaller:

        32 * 4 = 128 bytes

so an SSE access would be outside the bound.

Quoted 7 lines
Quoted 4 lines

The libc memcpy does not trigger such warning and is a good choice to copy an array of pointers.

I reproduced and checked Debian 13 32 bits build with OBS.

Thanks for testing.

I forgot this:

Fixes 885647d31504 ("net/sxe2: fix 32-bit SSE build")
#3 lore raw

28/05/2026 12:58, Thomas Monjalon:

Quoted 24 lines

28/05/2026 11:47, David Marchand:

Quoted 23 lines · Thomas Monjalon
Quoted 21 lines

Seen in OBS on i586 Debian:

from ../drivers/net/sxe2/sxe2_txrx_vec_sse.c:5:
In function ‘_mm_loadu_si128’,
inlined from ‘rte_memcpy’
inlined from ‘sxe2_rx_pkts_refactor’
at ../drivers/net/sxe2/sxe2_txrx_vec_common.h:233:2:
/usr/lib/gcc/i686-linux-gnu/12/include/emmintrin.h:703:10: error:
array subscript 8 is outside array bounds of ‘struct rte_mbuf *[32]’

The important options to reproduce are "-m32 -O2 -march=corei7".

In 32-bit build the pointer array done_pkts[32] is smaller:

        32 * 4 = 128 bytes

so an SSE access would be outside the bound.

The libc memcpy does not trigger such warning and is a good choice to copy an array of pointers.

Quoted 8 lines
Quoted 2 lines

I reproduced and checked Debian 13 32 bits build with OBS.

Thanks for testing.

I forgot this:

Fixes 885647d31504 ("net/sxe2: fix 32-bit SSE build")

Of course I meant

Fixes ac60f302cbef ("net/sxe2: add vectorized Rx and Tx")
author Applied
#4 lore raw
In reply to David Marchand

28/05/2026 11:47, David Marchand:

Quoted 18 lines · Thomas Monjalon
Quoted 17 lines

Seen in OBS on i586 Debian:

from ../drivers/net/sxe2/sxe2_txrx_vec_sse.c:5:
In function ‘_mm_loadu_si128’,
inlined from ‘rte_memcpy’
inlined from ‘sxe2_rx_pkts_refactor’
at ../drivers/net/sxe2/sxe2_txrx_vec_common.h:233:2:
/usr/lib/gcc/i686-linux-gnu/12/include/emmintrin.h:703:10: error:
array subscript 8 is outside array bounds of ‘struct rte_mbuf *[32]’

The important options to reproduce are "-m32 -O2 -march=corei7".

In 32-bit build the pointer array done_pkts[32] is smaller:

        32 * 4 = 128 bytes

so an SSE access would be outside the bound.

Quoted 7 lines
Quoted 4 lines

The libc memcpy does not trigger such warning and is a good choice to copy an array of pointers.

I reproduced and checked Debian 13 32 bits build with OBS.

Fixes ac60f302cbef ("net/sxe2: add vectorized Rx and Tx")

Applied