From: Maxime Coquelin Date: Mon, 30 Apr 2018 09:35:23 +0000 (+0200) Subject: vhost: fix header copy to discontiguous desc buffer X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8eac207d49b326ffaac7451ad3050d9cf2c0b361;p=dpdk.git vhost: fix header copy to discontiguous desc buffer In the loop to copy virtio-net header to the descriptor buffer, destination pointer was incremented instead of the source pointer. Fixes: fb3815cc614d ("vhost: handle virtually non-contiguous buffers in Rx-mrg") Fixes: 6727f5a739b6 ("vhost: handle virtually non-contiguous buffers in Rx") Cc: stable@dpdk.org Signed-off-by: Maxime Coquelin --- diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 5fdd4172b6..eed6b02272 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -277,7 +277,7 @@ copy_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq, vhost_log_write(dev, guest_addr, len); remain -= len; guest_addr += len; - dst += len; + src += len; } } @@ -771,7 +771,7 @@ copy_mbuf_to_desc_mergeable(struct virtio_net *dev, struct vhost_virtqueue *vq, remain -= len; guest_addr += len; - dst += len; + src += len; } } else { PRINT_PACKET(dev, (uintptr_t)hdr_addr,