Skip to contentSkip to conversation

net/memif: fix overwriting of head segment

PATCH Applied Joyce Kong 2 participants 2 messages May 25, 2022 Network drivers

lore
Share & tools
lore

Joyce Kong

author
#0 lore raw

PATCH 1/1 net/memif: fix overwriting of head segment

The 'dst_off' was reset in multi segment case. This caused memif buffer segment to write to beginning of mbuf, overwriting previous data. Fix it with this patch.

Fixes 09c7e63a71f9 ("net/memif: introduce memory interface PMD")
---
 drivers/net/memif/rte_eth_memif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/memif/rte_eth_memif.c +1 -1
index 587ad45576..dd951b8296 100644
@@ -348,13 +348,13 @@ eth_memif_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 			goto no_free_bufs;
 		mbuf = mbuf_head;
 		mbuf->port = mq->in_port;
+		dst_off = 0;
 
 next_slot:
 		s0 = cur_slot & mask;
 		d0 = &ring->desc[s0];
 
 		src_len = d0->length;
-		dst_off = 0;
 		src_off = 0;
 
 		do {
Signature · 1 line
2.25.1
Applied
#1 lore raw
Quoted 11 lines · Joyce Kong

The 'dst_off' was reset in multi segment case. This caused memif buffer segment to write to beginning of mbuf, overwriting previous data. Fix it with this patch.

Fixes 09c7e63a71f9 ("net/memif: introduce memory interface PMD")

Applied to dpdk-next-net/main, thanks.