[PATCH] vdpa: fix not using CVQ buffer in case of error

Eugenio Pérez posted 1 patch 10 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230602173451.1917999-1-eperezma@redhat.com
Maintainers: Jason Wang <jasowang@redhat.com>
net/vhost-vdpa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] vdpa: fix not using CVQ buffer in case of error
Posted by Eugenio Pérez 10 months, 3 weeks ago
Bug introducing when refactoring.  Otherway, the guest never received
the used buffer.

Fixes: be4278b65fc1 ("vdpa: extract vhost_vdpa_net_cvq_add from vhost_vdpa_net_handle_ctrl_avail")
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
 net/vhost-vdpa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 16d47f7b3c..5360924ba0 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -807,7 +807,7 @@ static int vhost_vdpa_net_handle_ctrl_avail(VhostShadowVirtqueue *svq,
     }
 
     if (*s->status != VIRTIO_NET_OK) {
-        return VIRTIO_NET_ERR;
+        goto out;
     }
 
     status = VIRTIO_NET_ERR;
-- 
2.31.1


Re: [PATCH] vdpa: fix not using CVQ buffer in case of error
Posted by Michael Tokarev 10 months, 2 weeks ago
02.06.2023 20:34, Eugenio Pérez wrote:
> Bug introducing when refactoring.  Otherway, the guest never received
> the used buffer.
> 
> Fixes: be4278b65fc1 ("vdpa: extract vhost_vdpa_net_cvq_add from vhost_vdpa_net_handle_ctrl_avail")
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> ---
>   net/vhost-vdpa.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Again, smells like a stable material, is it not?

Please Cc: qemu-stable@nongnu.org for other changes you think should be
applied to stable qemu series.

Thanks,

/mjt


Re: [PATCH] vdpa: fix not using CVQ buffer in case of error
Posted by Eugenio Perez Martin 10 months, 2 weeks ago
On Wed, Jun 7, 2023 at 12:11 PM Michael Tokarev <mjt@tls.msk.ru> wrote:
>
> 02.06.2023 20:34, Eugenio Pérez wrote:
> > Bug introducing when refactoring.  Otherway, the guest never received
> > the used buffer.
> >
> > Fixes: be4278b65fc1 ("vdpa: extract vhost_vdpa_net_cvq_add from vhost_vdpa_net_handle_ctrl_avail")
> > Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> > ---
> >   net/vhost-vdpa.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
>
> Again, smells like a stable material, is it not?
>
> Please Cc: qemu-stable@nongnu.org for other changes you think should be
> applied to stable qemu series.
>

Sorry, I totally forgot. This one should go to stable, yes.

Thanks!
Re: [PATCH] vdpa: fix not using CVQ buffer in case of error
Posted by Michael Tokarev 10 months, 2 weeks ago
07.06.2023 16:52, Eugenio Perez Martin wrote:
> On Wed, Jun 7, 2023 at 12:11 PM Michael Tokarev <mjt@tls.msk.ru> wrote:
..
>> Again, smells like a stable material, is it not?
>>
>> Please Cc: qemu-stable@nongnu.org for other changes you think should be
>> applied to stable qemu series.
> 
> Sorry, I totally forgot. This one should go to stable, yes.

That's okay, nothing to be sorry about. You did a good job
already fixing the issues.

Queued up.

Thank you!

/mjt

Re: [PATCH] vdpa: fix not using CVQ buffer in case of error
Posted by Jason Wang 10 months, 2 weeks ago
On Sat, Jun 3, 2023 at 1:35 AM Eugenio Pérez <eperezma@redhat.com> wrote:
>
> Bug introducing when refactoring.  Otherway, the guest never received
> the used buffer.
>
> Fixes: be4278b65fc1 ("vdpa: extract vhost_vdpa_net_cvq_add from vhost_vdpa_net_handle_ctrl_avail")
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>

Acked-by: Jason Wang <jasowang@redhat.com>

Thanks

> ---
>  net/vhost-vdpa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
> index 16d47f7b3c..5360924ba0 100644
> --- a/net/vhost-vdpa.c
> +++ b/net/vhost-vdpa.c
> @@ -807,7 +807,7 @@ static int vhost_vdpa_net_handle_ctrl_avail(VhostShadowVirtqueue *svq,
>      }
>
>      if (*s->status != VIRTIO_NET_OK) {
> -        return VIRTIO_NET_ERR;
> +        goto out;
>      }
>
>      status = VIRTIO_NET_ERR;
> --
> 2.31.1
>
Re: [PATCH] vdpa: fix not using CVQ buffer in case of error
Posted by Lei Yang 10 months, 2 weeks ago
QE tested sanity testing for this patch on the vhost_vdpa device,
everything works fine.

Tested-by: Lei Yang <leiyang@redhat.com>


On Tue, Jun 6, 2023 at 9:32 AM Jason Wang <jasowang@redhat.com> wrote:
>
> On Sat, Jun 3, 2023 at 1:35 AM Eugenio Pérez <eperezma@redhat.com> wrote:
> >
> > Bug introducing when refactoring.  Otherway, the guest never received
> > the used buffer.
> >
> > Fixes: be4278b65fc1 ("vdpa: extract vhost_vdpa_net_cvq_add from vhost_vdpa_net_handle_ctrl_avail")
> > Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
>
> Acked-by: Jason Wang <jasowang@redhat.com>
>
> Thanks
>
> > ---
> >  net/vhost-vdpa.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
> > index 16d47f7b3c..5360924ba0 100644
> > --- a/net/vhost-vdpa.c
> > +++ b/net/vhost-vdpa.c
> > @@ -807,7 +807,7 @@ static int vhost_vdpa_net_handle_ctrl_avail(VhostShadowVirtqueue *svq,
> >      }
> >
> >      if (*s->status != VIRTIO_NET_OK) {
> > -        return VIRTIO_NET_ERR;
> > +        goto out;
> >      }
> >
> >      status = VIRTIO_NET_ERR;
> > --
> > 2.31.1
> >
>