From 803aeecef123877764aac56270180e920aea8863 Mon Sep 17 00:00:00 2001 From: Junjie Chen Date: Wed, 13 Dec 2017 11:50:56 -0500 Subject: [PATCH] vhost: fix dequeue zero copy with virtio1 This fix dequeue zero copy can not work with Qemu version >= 2.7. Since from Qemu 2.7 virtio device use virtio-1 protocol, the zero copy code path forget to add offset to buffer address. Fixes: b0a985d1f340 ("vhost: add dequeue zero copy") Cc: stable@dpdk.org Signed-off-by: Junjie Chen Reviewed-by: Maxime Coquelin Acked-by: Yuanhan Liu --- lib/librte_vhost/virtio_net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 2227ced885..38796b3389 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -948,7 +948,8 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq, desc->addr + desc_offset, cpy_len)))) { cur->data_len = cpy_len; cur->data_off = 0; - cur->buf_addr = (void *)(uintptr_t)desc_addr; + cur->buf_addr = (void *)(uintptr_t)(desc_addr + + desc_offset); cur->buf_iova = hpa; /* -- 2.20.1