Skip to contentSkip to conversation

vdpa: fix not using CVQ buffer in case of error

PATCH In review Eugenio Pérez 4 participants 6 messages Jun 2, 2023 – Jun 7, 2023 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vdpa: fix not using CVQ buffer in case of error

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")
---
 net/vhost-vdpa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/vhost-vdpa.c +1 -1
index 16d47f7b3c..5360924ba0 100644
@@ -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;
Signature · 1 line
2.31.1
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Eugenio Pérez

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")

Thanks

Quoted 20 lines
---
 net/vhost-vdpa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/vhost-vdpa.c +1 -2
index 16d47f7b3c..5360924ba0 100644
@@ -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

Tested-by
#2 lore raw

QE tested sanity testing for this patch on the vhost_vdpa device, everything works fine.

Quoted 34 lines · Jason Wang
Quoted 6 lines · Eugenio Pérez

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")

Thanks

Quoted 20 lines
---
 net/vhost-vdpa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/vhost-vdpa.c +1 -2
index 16d47f7b3c..5360924ba0 100644
@@ -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

#3 lore raw
In reply to Eugenio Pérez
Quoted 8 lines · Eugenio Pérez

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")
---
  net/vhost-vdpa.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

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

Please Cc: [email protected] for other changes you think should be applied to stable qemu series.

Thanks,

/mjt

#4 lore raw
Quoted 11 lines · Michael Tokarev
Quoted 8 lines · Eugenio Pérez

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")
---
  net/vhost-vdpa.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 5 lines

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

Please Cc: [email protected] for other changes you think should be applied to stable qemu series.

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

Thanks!

#5 lore raw
Quoted 1 line · Eugenio Perez Martin

On Wed, Jun 7, 2023 at 12:11 PM Michael Tokarev <[email protected]> wrote:

..

Quoted 6 lines
Quoted 4 lines

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

Please Cc: [email protected] 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