vhost: fix header copy to discontiguous desc buffer
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Mon, 30 Apr 2018 09:35:23 +0000 (11:35 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 14 May 2018 21:31:03 +0000 (22:31 +0100)
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 <maxime.coquelin@redhat.com>
lib/librte_vhost/virtio_net.c

index 5fdd417..eed6b02 100644 (file)
@@ -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,