Skip to contentSkip to conversation

lib/distributor: fix unaligned 128-bit write

PATCH Applied David Hunt 2 participants 3 messages Jul 16, 2021 – Jul 20, 2021

lore
Share & tools
lore

David Hunt

author
#0 lore raw

PATCH 1/1 lib/distributor: fix unaligned 128-bit write

When the distributor sample app is built as a 32-bit app, the data buffer passed to find_match_vec can be unaligned, causing a segmentation fault due to writing a 128-bit value using _mm_store_si128(). 128-bit align the data being passed in so this does not happen.

Fixes 775003ad2f96 ("distributor: add new burst-capable library")
---
 lib/distributor/rte_distributor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/distributor/rte_distributor.c +1 -1
index 07e385a259..c210cf86bd 100644
@@ -478,7 +478,7 @@ rte_distributor_process(struct rte_distributor *d,
 		return 0;
 
 	while (next_idx < num_mbufs) {
-		uint16_t matches[RTE_DIST_BURST_SIZE];
+		uint16_t matches[RTE_DIST_BURST_SIZE] __rte_aligned(128);
 		unsigned int pkts;
 
 		if ((num_mbufs - next_idx) < RTE_DIST_BURST_SIZE)
Signature · 1 line
2.17.1
#1 lore raw

16/07/2021 15:32, David Hunt:

Quoted 11 lines

When the distributor sample app is built as a 32-bit app, the data buffer passed to find_match_vec can be unaligned, causing a segmentation fault due to writing a 128-bit value using _mm_store_si128(). 128-bit align the data being passed in so this does not happen.

Fixes 775003ad2f96 ("distributor: add new burst-capable library")

Applied, thanks

#2 lore raw
In reply to David Hunt

16/07/2021 15:32, David Hunt:

Quoted 11 lines

When the distributor sample app is built as a 32-bit app, the data buffer passed to find_match_vec can be unaligned, causing a segmentation fault due to writing a 128-bit value using _mm_store_si128(). 128-bit align the data being passed in so this does not happen.

Fixes 775003ad2f96 ("distributor: add new burst-capable library")

Applied, thanks