DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vhost: fix dequeue zero copy not work with virtio1
@ 2017-12-13 16:50 Junjie Chen
  2017-12-13 11:12 ` Maxime Coquelin
  0 siblings, 1 reply; 5+ messages in thread
From: Junjie Chen @ 2017-12-13 16:50 UTC (permalink / raw)
  To: dev, yliu, maxime.coquelin; +Cc: Junjie Chen

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@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;
 
 			/*
-- 
2.0.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-12-20  5:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-13 16:50 [dpdk-dev] [PATCH] vhost: fix dequeue zero copy not work with virtio1 Junjie Chen
2017-12-13 11:12 ` Maxime Coquelin
2017-12-15 10:33   ` Loftus, Ciara
2017-12-15 12:48     ` Yuanhan Liu
2017-12-20  5:58       ` Zhao, Bing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).