From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from m50-135.163.com (m50-135.163.com [123.125.50.135]) by dpdk.org (Postfix) with ESMTP id E5238160 for ; Wed, 20 Dec 2017 06:58:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Message-ID:Date:MIME-Version; bh=9BoqA fMqr1WOvSp2MNVMJLOH/KE5+rAEwYHxtxKL4Fs=; b=JTUCYxfW6kFKIMnDEfB1B XtX+dIBdoaxNyxBF2skv9y7i9r5gRjrRbk2iEHdEkMATm1kjGXpfMAAbnHC8Mksm Nwip1F4Ru9m5UjvGE3kGC8DYHLxG54VgBuHNWTudWSMSeBcSOaIaa176P7MQjcQU Enef9v/p/ZY4lKSwJkhfHU= Received: from [10.65.21.24] (unknown [116.231.15.193]) by smtp5 (Coremail) with SMTP id D9GowADHxlr8+zlaatMCAA--.19S2; Wed, 20 Dec 2017 13:58:26 +0800 (CST) From: "Zhao, Bing" To: Yuanhan Liu Cc: "Chen, Junjie J" , "dev@dpdk.org" , Maxime Coquelin , "Loftus, Ciara" References: <1513183856-5639-1-git-send-email-junjie.j.chen@intel.com> <90d47113-c379-8523-2eab-671a15e59de2@redhat.com> <74F120C019F4A64C9B78E802F6AD4CC278E577C9@IRSMSX106.ger.corp.intel.com> <20171215124804.GB2439@yliu-mob> Message-ID: <7304a91b-468c-ccaf-83ab-e1d74bb37500@163.com> Date: Wed, 20 Dec 2017 13:58:22 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171215124804.GB2439@yliu-mob> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID: D9GowADHxlr8+zlaatMCAA--.19S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7tr1kJFyftr4DCFWfuryDJrb_yoW8Aw4Dpr Z8JFyUAF47XF17CFZ2q3WFgryFyF4vkrnrWr48WF1j9390qr1IgFWxZryYg3Z7Zr1kCa1U Zry0qa47urWvvaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07benYwUUUUU= X-Originating-IP: [116.231.15.193] X-CM-SenderInfo: xlor4vhwkxzzi6rwjhhfrp/1tbiQwK0t1c6-0S-OwAAsQ 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, 20 Dec 2017 05:58:30 -0000 On 2017/12/15 20:48, Yuanhan Liu wrote: > On Fri, Dec 15, 2017 at 10:33:41AM +0000, Loftus, Ciara wrote: > >> > >> 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 > > > > Thanks for the fix. Can this be considered for the stable branch? > > Yes, I think so. Applied to dpdk-next-virtio, with > > Fixes: b0a985d1f340 ("vhost: add dequeue zero copy") > Cc: stable@dpdk.org > > Thanks. > >     --yliu > @Yuanhan & Maxime, sorry to interrupt here. I meet the same issue recently. Could the "cur->data_off" field be used here with the value "desc_offset"? (I don't go through all the code and am a little confused about the "0". Is there any detail description about the "data_off" field?) Thanks