All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
To: qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>, Jason Wang <jasowang@redhat.com>
Subject: [PATCH 0/3] virtio: fix for assertion failure: virtio_net_get_subqueue(nc)->async_tx.elem failed
Date: Sat, 28 Jan 2023 15:17:21 +0800	[thread overview]
Message-ID: <20230128071724.33677-1-xuanzhuo@linux.alibaba.com> (raw)

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.

Xuan Zhuo (3):
  virtio: move struct VirtQueue to include file
  virtio: struct VirtQueue introduce reset
  virtio-net: virtio_net_flush_tx() check for per-queue reset

 hw/net/virtio-net.c        |  2 +-
 hw/virtio/virtio.c         | 57 ++++++--------------------------------
 include/hw/virtio/virtio.h | 55 ++++++++++++++++++++++++++++++++++--
 3 files changed, 62 insertions(+), 52 deletions(-)

--
2.32.0.3.g01195cf9f



             reply	other threads:[~2023-01-28  7:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-28  7:17 Xuan Zhuo [this message]
2023-01-28  7:17 ` [PATCH 1/3] virtio: move struct VirtQueue to include file Xuan Zhuo
2023-01-28 10:23   ` Michael S. Tsirkin
2023-01-28 10:37     ` Xuan Zhuo
2023-01-28  7:17 ` [PATCH 2/3] virtio: struct VirtQueue introduce reset Xuan Zhuo
2023-01-28 10:22   ` Michael S. Tsirkin
2023-01-28 10:41     ` Xuan Zhuo
2023-01-28 11:19       ` Michael S. Tsirkin
2023-01-28  7:17 ` [PATCH 3/3] virtio-net: virtio_net_flush_tx() check for per-queue reset Xuan Zhuo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230128071724.33677-1-xuanzhuo@linux.alibaba.com \
    --to=xuanzhuo@linux.alibaba.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.