All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/2] virtio: fix for assertion failure: virtio_net_get_subqueue(nc)->async_tx.elem failed
@ 2023-01-29  2:51 Xuan Zhuo
  2023-01-29  2:51 ` [PATCH v1 1/2] virtio: struct VirtQueue introduce reset Xuan Zhuo
                   ` (2 more replies)
  0 siblings, 3 replies; 32+ messages in thread
From: Xuan Zhuo @ 2023-01-29  2:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael S. Tsirkin, Jason Wang

In the current design, we stop the device from operating on the vring
during per-queue reset by resetting the structure VirtQueue.

But before the reset operation, when recycling some resources, we should
stop referencing new vring resources.

This bug is caused by this reason.

    https://gitlab.com/qemu-project/qemu/-/issues/1451

Before we reset the structure, we called the ->queue_reset callback to let the
device reclaim resources. Here virtio-net tries to release the packets sent
asynchronously, but during this process virtio_net_flush_tx() will be called,
and new data will be sent again. This leads to asserted.

     assert(!virtio_net_get_subqueue(nc)->async_tx.elem);

This patch set introduce new item "reset" into struct VirtQueue, then device can
know this virtqueue is per-queue reset state.

v1:
    1. rename "reset" to disabled_by_reset
    2. add api: virtio_queue_reset_state()

Xuan Zhuo (2):
  virtio: struct VirtQueue introduce reset
  virtio-net: virtio_net_flush_tx() check for per-queue reset

 hw/net/virtio-net.c        |  3 ++-
 hw/virtio/virtio.c         | 15 +++++++++++++++
 include/hw/virtio/virtio.h |  1 +
 3 files changed, 18 insertions(+), 1 deletion(-)

--
2.32.0.3.g01195cf9f



^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2023-01-31  7:39 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-29  2:51 [PATCH v1 0/2] virtio: fix for assertion failure: virtio_net_get_subqueue(nc)->async_tx.elem failed Xuan Zhuo
2023-01-29  2:51 ` [PATCH v1 1/2] virtio: struct VirtQueue introduce reset Xuan Zhuo
2023-01-29  7:12   ` Michael S. Tsirkin
2023-01-29  7:15     ` Xuan Zhuo
2023-01-29  7:37       ` Michael S. Tsirkin
2023-01-29  7:39         ` Xuan Zhuo
2023-01-29  2:51 ` [PATCH v1 2/2] virtio-net: virtio_net_flush_tx() check for per-queue reset Xuan Zhuo
2023-01-29  6:23   ` Jason Wang
2023-01-29  7:43     ` Xuan Zhuo
2023-01-30  3:01       ` Jason Wang
2023-01-30  3:38         ` Xuan Zhuo
2023-01-30  3:53           ` Jason Wang
2023-01-30  5:50             ` Michael S. Tsirkin
2023-01-30  8:41               ` Jason Wang
2023-01-29  7:25   ` Michael S. Tsirkin
2023-01-29  7:28     ` Xuan Zhuo
2023-01-29  8:12       ` Michael S. Tsirkin
2023-01-29  8:23         ` Xuan Zhuo
2023-01-29 11:57           ` Michael S. Tsirkin
2023-01-29 12:03             ` Xuan Zhuo
2023-01-29 12:15               ` Michael S. Tsirkin
2023-01-29 12:28                 ` Xuan Zhuo
2023-01-30  2:15                 ` Xuan Zhuo
2023-01-30  5:32                   ` Michael S. Tsirkin
2023-01-30  7:49                     ` Jason Wang
2023-01-30  7:53                       ` Xuan Zhuo
2023-01-30  8:40                         ` Jason Wang
2023-01-30 10:24                           ` Xuan Zhuo
2023-01-31  3:27                             ` Jason Wang
2023-01-31  7:17                               ` Xuan Zhuo
2023-01-31  7:38                       ` Xuan Zhuo
2023-01-29  7:26 ` [PATCH v1 0/2] virtio: fix for assertion failure: virtio_net_get_subqueue(nc)->async_tx.elem failed Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.