Message ID | CAFO3S41gS1KpMyLDW+eEvdSq7HV9NYNM8FkGiPVajtdQxtGa4g@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
hello, On Mon, Oct 28, 2013 at 04:28:57PM +0800, Asias He wrote: > > Hello Milan, > > Does the attached patch fix your problem? > > -- > Asias > From b48eaeff7250bf7476c771e82cdbf20c3e85c4c9 Mon Sep 17 00:00:00 2001 > From: Asias He <asias.hejun@gmail.com> > Date: Mon, 28 Oct 2013 15:02:54 +0800 > Subject: [PATCH 1/1] kvm-tools: Fix virtio-net iov memcpy > > We should skip copied bytes from the buffer not from the iov itself > which memcpy_toiovecend does. > > Signed-off-by: Asias He <asias.hejun@gmail.com> > --- > tools/kvm/virtio/net.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/kvm/virtio/net.c b/tools/kvm/virtio/net.c > index 2c34996..3715aaf 100644 > --- a/tools/kvm/virtio/net.c > +++ b/tools/kvm/virtio/net.c > @@ -114,7 +114,7 @@ static void *virtio_net_rx_thread(void *p) > while (copied < len) { > size_t iovsize = min(len - copied, iov_size(iov, in)); > > - memcpy_toiovecend(iov, buffer, copied, iovsize); > + memcpy_toiovec(iov, buffer + copied, iovsize); > copied += iovsize; > if (has_virtio_feature(ndev, VIRTIO_NET_F_MRG_RXBUF)) > hdr->num_buffers++; > -- > 1.8.3.1 > Excellent, this patch fixes the problem. Feel free to add: Tested-by: Milan Kocian <milon@wq.cz> Many thanks.
From b48eaeff7250bf7476c771e82cdbf20c3e85c4c9 Mon Sep 17 00:00:00 2001 From: Asias He <asias.hejun@gmail.com> Date: Mon, 28 Oct 2013 15:02:54 +0800 Subject: [PATCH 1/1] kvm-tools: Fix virtio-net iov memcpy We should skip copied bytes from the buffer not from the iov itself which memcpy_toiovecend does. Signed-off-by: Asias He <asias.hejun@gmail.com> --- tools/kvm/virtio/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/kvm/virtio/net.c b/tools/kvm/virtio/net.c index 2c34996..3715aaf 100644 --- a/tools/kvm/virtio/net.c +++ b/tools/kvm/virtio/net.c @@ -114,7 +114,7 @@ static void *virtio_net_rx_thread(void *p) while (copied < len) { size_t iovsize = min(len - copied, iov_size(iov, in)); - memcpy_toiovecend(iov, buffer, copied, iovsize); + memcpy_toiovec(iov, buffer + copied, iovsize); copied += iovsize; if (has_virtio_feature(ndev, VIRTIO_NET_F_MRG_RXBUF)) hdr->num_buffers++; -- 1.8.3.1