[dpdk-dev] [PATCH] vhost: fix dequeue zero copy not work with virtio1

Maxime Coquelin maxime.coquelin at redhat.com
Wed Dec 13 12:12:02 CET 2017


Hi Junjie,

On 12/13/2017 05:50 PM, Junjie Chen wrote:
> 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.
> 
> Signed-off-by: Junjie Chen <junjie.j.chen at intel.com>
> ---
>   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 6fee16e..79d80f7 100644
> --- a/lib/librte_vhost/virtio_net.c
> +++ b/lib/librte_vhost/virtio_net.c
> @@ -977,7 +977,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;
>   
>   			/*
> 

Thanks for fixing this.

Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>

Maxime


More information about the dev mailing list