DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/memif: fix overwriting of head segment
@ 2022-05-25  5:56 Joyce Kong
  2022-05-25 21:14 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Joyce Kong @ 2022-05-25  5:56 UTC (permalink / raw)
  To: Jakub Grajciar, Ferruh Yigit
  Cc: dev, nd, Joyce Kong, stable, Ferruh Yigit, Ruifeng Wang

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")
Cc: stable@dpdk.org

Reported-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 drivers/net/memif/rte_eth_memif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index 587ad45576..dd951b8296 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -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 {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] net/memif: fix overwriting of head segment
  2022-05-25  5:56 [PATCH] net/memif: fix overwriting of head segment Joyce Kong
@ 2022-05-25 21:14 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2022-05-25 21:14 UTC (permalink / raw)
  To: Joyce Kong, Jakub Grajciar; +Cc: dev, nd, stable, Ruifeng Wang

On 5/25/2022 6:56 AM, Joyce Kong wrote:
> 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")
> Cc:stable@dpdk.org
> 
> Reported-by: Ferruh Yigit<ferruh.yigit@xilinx.com>
> Signed-off-by: Joyce Kong<joyce.kong@arm.com>
> Reviewed-by: Ruifeng Wang<ruifeng.wang@arm.com>

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-25 21:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25  5:56 [PATCH] net/memif: fix overwriting of head segment Joyce Kong
2022-05-25 21:14 ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).