Skip to content

Commit

Permalink
net/memif: fix overwriting of head segment
Browse files Browse the repository at this point in the history
[ upstream commit 10c4c4d ]

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: 09c7e63 ("net/memif: introduce memory interface PMD")

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>
  • Loading branch information
JoyceKong-Arm authored and steevenlee committed Jun 20, 2022
1 parent 711575c commit 89f5496
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/memif/rte_eth_memif.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,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 {
Expand Down

0 comments on commit 89f5496

Please sign in to comment.