diff mbox series

[v2,2/2] virtio_net: just purge tx when dev/queue reset

Message ID 20230206032105.35831-3-xuanzhuo@linux.alibaba.com (mailing list archive)
State New, archived
Headers show
Series virtio: fix for assertion failure: virtio_net_get_subqueue(nc)->async_tx.elem failed | expand

Commit Message

Xuan Zhuo Feb. 6, 2023, 3:21 a.m. UTC
When dev/queue reset, we should just purge all packet, not try to flush
the async packets. When flush these async packets, the
callback(virtio_net_tx_complete) will try to flush new packets from tx
queue.

Fixes: 7dc6be52 ("virtio-net: support queue reset")
Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1451
Reported-by: Alexander Bulekov <alxndr@bu.edu>
Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
---
 hw/net/virtio-net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 6daa1e5ac1..2ac6d3dad9 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -570,7 +570,7 @@  static void virtio_net_queue_reset(VirtIODevice *vdev, uint32_t queue_index)
         vhost_net_virtqueue_reset(vdev, nc, queue_index);
     }
 
-    flush_or_purge_queued_packets(nc);
+    qemu_purge_queued_packets(nc);
 }
 
 static void virtio_net_queue_enable(VirtIODevice *vdev, uint32_t queue_index)