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 <[email protected]> > --- > 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.)
signature.asc
Description: PGP signature
