* [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
* Re: [dpdk-dev] [PATCH] vhost: fix dequeue zero copy not work with virtio1
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
0 siblings, 1 reply; 5+ messages in thread
From: Maxime Coquelin @ 2017-12-13 11:12 UTC (permalink / raw)
To: Junjie Chen, dev, yliu
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 <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;
>
> /*
>
Thanks for fixing this.
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Maxime
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost: fix dequeue zero copy not work with virtio1
2017-12-13 11:12 ` Maxime Coquelin
@ 2017-12-15 10:33 ` Loftus, Ciara
2017-12-15 12:48 ` Yuanhan Liu
0 siblings, 1 reply; 5+ messages in thread
From: Loftus, Ciara @ 2017-12-15 10:33 UTC (permalink / raw)
To: Chen, Junjie J, yliu; +Cc: dev, Maxime Coquelin
>
> 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 <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;
> >
> > /*
> >
>
> Thanks for fixing this.
>
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>
> Maxime
Thanks for the fix. Can this be considered for the stable branch?
Thanks,
Ciara
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost: fix dequeue zero copy not work with virtio1
2017-12-15 10:33 ` Loftus, Ciara
@ 2017-12-15 12:48 ` Yuanhan Liu
2017-12-20 5:58 ` Zhao, Bing
0 siblings, 1 reply; 5+ messages in thread
From: Yuanhan Liu @ 2017-12-15 12:48 UTC (permalink / raw)
To: Loftus, Ciara; +Cc: Chen, Junjie J, dev, Maxime Coquelin
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 <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;
> > >
> > > /*
> > >
> >
> > Thanks for fixing this.
> >
> > Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> >
> > 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost: fix dequeue zero copy not work with virtio1
2017-12-15 12:48 ` Yuanhan Liu
@ 2017-12-20 5:58 ` Zhao, Bing
0 siblings, 0 replies; 5+ messages in thread
From: Zhao, Bing @ 2017-12-20 5:58 UTC (permalink / raw)
To: Yuanhan Liu; +Cc: Chen, Junjie J, dev, Maxime Coquelin, Loftus, Ciara
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 <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;
> >>>
> >>> /*
> >>>
> >>
> >> Thanks for fixing this.
> >>
> >> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> >>
> >> 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
^ 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).