From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id BFE121D90 for ; Wed, 13 Dec 2017 12:12:05 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C04435D68B; Wed, 13 Dec 2017 11:12:04 +0000 (UTC) Received: from [10.36.112.48] (ovpn-112-48.ams2.redhat.com [10.36.112.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D73077BA55; Wed, 13 Dec 2017 11:12:03 +0000 (UTC) To: Junjie Chen , dev@dpdk.org, yliu@fridaylinux.org References: <1513183856-5639-1-git-send-email-junjie.j.chen@intel.com> From: Maxime Coquelin Message-ID: <90d47113-c379-8523-2eab-671a15e59de2@redhat.com> Date: Wed, 13 Dec 2017 12:12:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1513183856-5639-1-git-send-email-junjie.j.chen@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 13 Dec 2017 11:12:04 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH] vhost: fix dequeue zero copy not work with virtio1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Dec 2017 11:12:06 -0000 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 > --- > 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