From: Junjie Chen Date: Wed, 13 Dec 2017 16:50:56 +0000 (-0500) Subject: vhost: fix dequeue zero copy with virtio1 X-Git-Tag: spdx-start~527 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=803aeecef123877764aac56270180e920aea8863;p=dpdk.git 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 --- 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; /*