DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: dev@dpdk.org, jianfeng.tan@intel.com, tiwei.bie@intel.com,
	john.mcnamara@intel.com
Cc: stable@dpdk.org, Maxime Coquelin <maxime.coquelin@redhat.com>
Subject: [dpdk-dev] [PATCH 2/2] vhost: fix header copy to discontiguous desc buffer
Date: Mon, 30 Apr 2018 11:35:23 +0200	[thread overview]
Message-ID: <20180430093523.12495-3-maxime.coquelin@redhat.com> (raw)
In-Reply-To: <20180430093523.12495-1-maxime.coquelin@redhat.com>

In the loop to copy virtio-net header to the descriptor buffer,
destination pointer was incremented instead of the source
pointer.

Fixes: fb3815cc614d ("vhost: handle virtually non-contiguous buffers in Rx-mrg")
Fixes: 6727f5a739b6 ("vhost: handle virtually non-contiguous buffers in Rx")

Cc: stable@dpdk.org

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/librte_vhost/virtio_net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index 5fdd4172b..eed6b0227 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -277,7 +277,7 @@ copy_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq,
 			vhost_log_write(dev, guest_addr, len);
 			remain -= len;
 			guest_addr += len;
-			dst += len;
+			src += len;
 		}
 	}
 
@@ -771,7 +771,7 @@ copy_mbuf_to_desc_mergeable(struct virtio_net *dev, struct vhost_virtqueue *vq,
 
 					remain -= len;
 					guest_addr += len;
-					dst += len;
+					src += len;
 				}
 			} else {
 				PRINT_PACKET(dev, (uintptr_t)hdr_addr,
-- 
2.14.3

  parent reply	other threads:[~2018-04-30  9:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-30  9:35 [dpdk-dev] [PATCH 0/2] Fix enqueueing vnet header in discontiguous decs buffer Maxime Coquelin
2018-04-30  9:35 ` [dpdk-dev] [PATCH 1/2] examples/vhost: fix header copy to discontiguous desc buffer Maxime Coquelin
2018-04-30  9:35 ` Maxime Coquelin [this message]
2018-05-04 15:14 ` [dpdk-dev] [PATCH 0/2] Fix enqueueing vnet header in discontiguous decs buffer Maxime Coquelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180430093523.12495-3-maxime.coquelin@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.com \
    --cc=john.mcnamara@intel.com \
    --cc=stable@dpdk.org \
    --cc=tiwei.bie@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).