From: Hanna Czenczek <hreitz@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>, qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Fam Zheng" <fam@euphon.net>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Raphael Norwitz" <raphael.norwitz@nutanix.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
eperezma@redhat.com, "Daniel P. Berrangé" <berrange@redhat.com>
Subject: Re: [PATCH v2 3/3] virtio: call ->vhost_reset_device() during reset
Date: Wed, 4 Oct 2023 13:04:31 +0200 [thread overview]
Message-ID: <b616b5ec-8739-d069-ae62-09a3d8cfbcf4@redhat.com> (raw)
In-Reply-To: <20231004014532.1228637-4-stefanha@redhat.com>
On 04.10.23 03:45, Stefan Hajnoczi wrote:
> vhost-user-scsi has a VirtioDeviceClass->reset() function that calls
> ->vhost_reset_device(). The other vhost devices don't notify the vhost
> device upon reset.
>
> Stateful vhost devices may need to handle device reset in order to free
> resources or prevent stale device state from interfering after reset.
>
> Call ->vhost_device_reset() from virtio_reset() so that that vhost
> devices are notified of device reset.
>
> This patch affects behavior as follows:
> - vhost-kernel: No change in behavior since ->vhost_reset_device() is
> not implemented.
> - vhost-user: back-ends that negotiate
> VHOST_USER_PROTOCOL_F_RESET_DEVICE now receive a
> VHOST_USER_DEVICE_RESET message upon device reset. Otherwise there is
> no change in behavior. DPDK, SPDK, libvhost-user, and the
> vhost-user-backend crate do not negotiate
> VHOST_USER_PROTOCOL_F_RESET_DEVICE automatically.
> - vhost-vdpa: an extra SET_STATUS 0 call is made during device reset.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> meson.build | 1 +
> include/hw/virtio/vhost.h | 10 ++++++++++
> hw/scsi/vhost-user-scsi.c | 11 -----------
> hw/virtio/vhost.c | 9 +++++++++
> hw/virtio/virtio.c | 4 ++++
> 5 files changed, 24 insertions(+), 11 deletions(-)
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
next prev parent reply other threads:[~2023-10-04 11:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-04 1:45 [PATCH v2 0/3] vhost: clean up device reset Stefan Hajnoczi
2023-10-04 1:45 ` [PATCH v2 1/3] vhost-user: do not send RESET_OWNER on " Stefan Hajnoczi
2023-10-04 10:44 ` Hanna Czenczek
2023-10-04 11:15 ` Stefan Hajnoczi
2023-10-04 12:23 ` Hanna Czenczek
2023-10-04 1:45 ` [PATCH v2 2/3] vhost-backend: remove vhost_kernel_reset_device() Stefan Hajnoczi
2023-10-04 10:48 ` Hanna Czenczek
2023-10-04 1:45 ` [PATCH v2 3/3] virtio: call ->vhost_reset_device() during reset Stefan Hajnoczi
2023-10-04 11:04 ` Hanna Czenczek [this message]
2023-10-04 2:07 ` [PATCH v2 0/3] vhost: clean up device reset Raphael Norwitz
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=b616b5ec-8739-d069-ae62-09a3d8cfbcf4@redhat.com \
--to=hreitz@redhat.com \
--cc=berrange@redhat.com \
--cc=eperezma@redhat.com \
--cc=fam@euphon.net \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=raphael.norwitz@nutanix.com \
--cc=stefanha@redhat.com \
--cc=thuth@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).