From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id C95102030 for ; Wed, 13 Dec 2017 10:10:05 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Dec 2017 01:10:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,397,1508828400"; d="scan'208";a="17837680" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.67.111.147]) by orsmga002.jf.intel.com with ESMTP; 13 Dec 2017 01:10:03 -0800 From: Junjie Chen To: dev@dpdk.org, yliu@fridaylinux.org, maxime.coquelin@redhat.com Cc: Junjie Chen Date: Wed, 13 Dec 2017 11:50:56 -0500 Message-Id: <1513183856-5639-1-git-send-email-junjie.j.chen@intel.com> X-Mailer: git-send-email 2.0.1 Subject: [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 09:10:06 -0000 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; /* -- 2.0.1