Skip to contentSkip to conversation

ixgbe: Make vector stores unaligned

PATCH In review Bruce Richardson 2 participants 2 messages Aug 27, 2014 – Aug 28, 2014 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ixgbe: Make vector stores unaligned

When writing to the mbuf array for receiving packets, do not assume 16-byte alignment by using aligned stores. If the pointers are only 8-byte aligned, the program will crash due to incorrect alignment. Changing "store" to "storeu" fixes this.

---
 lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c +2 -2
index 826e085..bafb215 100644
@@ -256,7 +256,7 @@ ixgbe_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
 		descs[3] = _mm_loadu_si128((__m128i *)(rxdp + 3));
 
 		/* B.2 copy 2 mbuf point into rx_pkts  */
-		_mm_store_si128((__m128i *)&rx_pkts[pos], mbp1);
+		_mm_storeu_si128((__m128i *)&rx_pkts[pos], mbp1);
 
 		/* B.1 load 1 mbuf point */
 		mbp2 = _mm_loadu_si128((__m128i *)&sw_ring[pos+2]);
@@ -267,7 +267,7 @@ ixgbe_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
 		descs[0] = _mm_loadu_si128((__m128i *)(rxdp));
 
 		/* B.2 copy 2 mbuf point into rx_pkts  */
-		_mm_store_si128((__m128i *)&rx_pkts[pos+2], mbp2);
+		_mm_storeu_si128((__m128i *)&rx_pkts[pos+2], mbp2);
 
 		/* avoid compiler reorder optimization */
 		rte_compiler_barrier();
Signature · 1 line
1.9.3

A message that is not in the archive (sent off-list or not yet received): 1409154677-32059-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org