Fix enqueueing vnet header in discontiguous decs buffer
cover Fix enqueueing vnet header in discontiguous decs buffer
This series fixes copying virtio net header to discontiguous descriptor buffer in VA space.
The issue was spotted by Coverity for examples/vhost, but same issue was present in vhost-user library.
Maxime Coquelin (2):
examples/vhost: fix header copy to discontiguous desc buffer
vhost: fix header copy to discontiguous desc buffer
examples/vhost/virtio_net.c | 2 +- lib/librte_vhost/virtio_net.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.14.3
PATCH 1/2 examples/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.
Coverity issue: 277240
--- examples/vhost/virtio_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
examples/vhost/virtio_net.c +1 -1
@@ -103,7 +103,7 @@ enqueue_pkt(struct vhost_dev *dev, struct rte_vhost_vring *vr, remain -= len; guest_addr += len; - dst += len; + src += len; } desc_chunck_len = desc->len - dev->hdr_len;
Signature · 1 line
2.14.3
PATCH 2/2 vhost: fix header copy to discontiguous desc buffer
In reply to Maxime CoquelinIn the loop to copy virtio-net header to the descriptor buffer, destination pointer was incremented instead of the source pointer.
--- lib/librte_vhost/virtio_net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/librte_vhost/virtio_net.c +2 -2
@@ -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,
Signature · 1 line
2.14.3
Maxime Coquelin
AppliedQuoted 6 lines · Maxime Coquelin
This series fixes copying virtio net header to discontiguous descriptor buffer in VA space.
The issue was spotted by Coverity for examples/vhost, but same issue was present in vhost-user library.
Quoted 8 lines
Maxime Coquelin (2):
examples/vhost: fix header copy to discontiguous desc buffer
vhost: fix header copy to discontiguous desc bufferexamples/vhost/virtio_net.c | 2 +- lib/librte_vhost/virtio_net.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Applied to dpdk-next-virtio/master.