From: Stefan Hajnoczi <stefanha@redhat.com>
To: Alexandr Moshkov <dtalexundeer@yandex-team.ru>
Cc: qemu-devel@nongnu.org, "Gonglei (Arei)" <arei.gonglei@huawei.com>,
"Zhenwei Pi" <pizhenwei@bytedance.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Stefano Garzarella" <sgarzare@redhat.com>,
"Raphael Norwitz" <raphael@enfabrica.net>,
"Kevin Wolf" <kwolf@redhat.com>,
"Hanna Reitz" <hreitz@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Fam Zheng" <fam@euphon.net>,
"Alex Bennée" <alex.bennee@linaro.org>,
mzamazal@redhat.com, "Peter Xu" <peterx@redhat.com>,
"Fabiano Rosas" <farosas@suse.de>,
qemu-block@nongnu.org, virtio-fs@lists.linux.dev,
"yc-core@yandex-team.ru" <yc-core@yandex-team.ru>,
"Eric Blake" <eblake@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>
Subject: Re: [PATCH v5 2/5] vhost-user: introduce protocol feature for skip drain on GET_VRING_BASE
Date: Mon, 12 Jan 2026 13:08:07 -0500 [thread overview]
Message-ID: <20260112180807.GD462084@fedora> (raw)
In-Reply-To: <20260112114503.1174330-3-dtalexundeer@yandex-team.ru>
[-- Attachment #1: Type: text/plain, Size: 5268 bytes --]
On Mon, Jan 12, 2026 at 04:45:00PM +0500, Alexandr Moshkov wrote:
> Add vhost-user protocol feature
> VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIGHT
>
> Now on GET_VRING_BASE this feature can control whether to wait for
> in-flight requests to complete or not.
>
> It will be helpfull in future for in-flight requests migration in
> vhost-user devices.
>
> Signed-off-by: Alexandr Moshkov <dtalexundeer@yandex-team.ru>
> ---
> docs/interop/vhost-user.rst | 52 ++++++++++++++++++----------------
> include/hw/virtio/vhost-user.h | 1 +
> 2 files changed, 29 insertions(+), 24 deletions(-)
>
> diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst
> index 02908b48fa..80c80aada5 100644
> --- a/docs/interop/vhost-user.rst
> +++ b/docs/interop/vhost-user.rst
> @@ -1033,26 +1033,27 @@ Protocol features
>
> .. code:: c
>
> - #define VHOST_USER_PROTOCOL_F_MQ 0
> - #define VHOST_USER_PROTOCOL_F_LOG_SHMFD 1
> - #define VHOST_USER_PROTOCOL_F_RARP 2
> - #define VHOST_USER_PROTOCOL_F_REPLY_ACK 3
> - #define VHOST_USER_PROTOCOL_F_MTU 4
> - #define VHOST_USER_PROTOCOL_F_BACKEND_REQ 5
> - #define VHOST_USER_PROTOCOL_F_CROSS_ENDIAN 6
> - #define VHOST_USER_PROTOCOL_F_CRYPTO_SESSION 7
> - #define VHOST_USER_PROTOCOL_F_PAGEFAULT 8
> - #define VHOST_USER_PROTOCOL_F_CONFIG 9
> - #define VHOST_USER_PROTOCOL_F_BACKEND_SEND_FD 10
> - #define VHOST_USER_PROTOCOL_F_HOST_NOTIFIER 11
> - #define VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD 12
> - #define VHOST_USER_PROTOCOL_F_RESET_DEVICE 13
> - #define VHOST_USER_PROTOCOL_F_INBAND_NOTIFICATIONS 14
> - #define VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS 15
> - #define VHOST_USER_PROTOCOL_F_STATUS 16
> - #define VHOST_USER_PROTOCOL_F_XEN_MMAP 17
> - #define VHOST_USER_PROTOCOL_F_SHARED_OBJECT 18
> - #define VHOST_USER_PROTOCOL_F_DEVICE_STATE 19
> + #define VHOST_USER_PROTOCOL_F_MQ 0
> + #define VHOST_USER_PROTOCOL_F_LOG_SHMFD 1
> + #define VHOST_USER_PROTOCOL_F_RARP 2
> + #define VHOST_USER_PROTOCOL_F_REPLY_ACK 3
> + #define VHOST_USER_PROTOCOL_F_MTU 4
> + #define VHOST_USER_PROTOCOL_F_BACKEND_REQ 5
> + #define VHOST_USER_PROTOCOL_F_CROSS_ENDIAN 6
> + #define VHOST_USER_PROTOCOL_F_CRYPTO_SESSION 7
> + #define VHOST_USER_PROTOCOL_F_PAGEFAULT 8
> + #define VHOST_USER_PROTOCOL_F_CONFIG 9
> + #define VHOST_USER_PROTOCOL_F_BACKEND_SEND_FD 10
> + #define VHOST_USER_PROTOCOL_F_HOST_NOTIFIER 11
> + #define VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD 12
> + #define VHOST_USER_PROTOCOL_F_RESET_DEVICE 13
> + #define VHOST_USER_PROTOCOL_F_INBAND_NOTIFICATIONS 14
> + #define VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS 15
> + #define VHOST_USER_PROTOCOL_F_STATUS 16
> + #define VHOST_USER_PROTOCOL_F_XEN_MMAP 17
> + #define VHOST_USER_PROTOCOL_F_SHARED_OBJECT 18
> + #define VHOST_USER_PROTOCOL_F_DEVICE_STATE 19
> + #define VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIGHT 20
>
> Front-end message types
> -----------------------
> @@ -1243,11 +1244,14 @@ Front-end message types
>
> When and as long as all of a device's vrings are stopped, it is
> *suspended*, see :ref:`Suspended device state
> - <suspended_device_state>`. The back-end must complete all inflight I/O
> - requests for the specified vring before stopping it.
> + <suspended_device_state>`.
>
> - The request payload's *num* field is currently reserved and must be
> - set to 0.
> + By default, the back-end must complete all inflight I/O requests for the
> + specified vring before stopping it.
> +
> + If the ``VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIGHT`` protocol feature
> + has been negotiated, the back-end may stop the vring immediately without
> + waiting for inflight I/O requests to complete.
This paragraph is not specific enough. It gives the impression that I/O
requests can be left running, but that's not the case. They need to be
quiesced and recorded in the Inflight I/O Tracking
(VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD) shared memory data structure.
I suggest rewording it as follows:
If the ``VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIGHT`` protocol
feature has been negotiated, the back-end may suspend in-flight I/O
requests and record them as described in :ref:`inflight-io-tracking`
instead of completing them before stopping the vring. How to suspend
an in-flight request depends on the implementation of the back-end but
it typically can be done by aborting or cancelling the underlying I/O
request. The ``VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIGHT``
protocol feature must only be neogotiated if
``VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD`` is also negotiated.
(A _inflight-io-tracking label needs to be added in order to reference
the "Inflight I/O tracking" section.)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2026-01-12 18:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-12 11:44 [PATCH v5 0/5] support inflight migration Alexandr Moshkov
2026-01-12 11:44 ` [PATCH v5 1/5] vhost-user.rst: specify vhost-user back-end action on GET_VRING_BASE Alexandr Moshkov
2026-01-12 11:45 ` [PATCH v5 2/5] vhost-user: introduce protocol feature for skip drain " Alexandr Moshkov
2026-01-12 18:08 ` Stefan Hajnoczi [this message]
2026-01-12 11:45 ` [PATCH v5 3/5] vmstate: introduce VMSTATE_VBUFFER_UINT64 Alexandr Moshkov
2026-01-12 11:45 ` [PATCH v5 4/5] vhost: add vmstate for inflight region with inner buffer Alexandr Moshkov
2026-01-12 18:22 ` Stefan Hajnoczi
2026-01-12 11:45 ` [PATCH v5 5/5] vhost-user-blk: support inter-host inflight migration Alexandr Moshkov
2026-01-12 18:19 ` Stefan Hajnoczi
2026-01-13 6:49 ` Alexandr Moshkov
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=20260112180807.GD462084@fedora \
--to=stefanha@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=arei.gonglei@huawei.com \
--cc=armbru@redhat.com \
--cc=dtalexundeer@yandex-team.ru \
--cc=eblake@redhat.com \
--cc=fam@euphon.net \
--cc=farosas@suse.de \
--cc=hreitz@redhat.com \
--cc=jasowang@redhat.com \
--cc=kwolf@redhat.com \
--cc=mst@redhat.com \
--cc=mzamazal@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=pizhenwei@bytedance.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=raphael@enfabrica.net \
--cc=sgarzare@redhat.com \
--cc=virtio-fs@lists.linux.dev \
--cc=yc-core@yandex-team.ru \
/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