From: "Michael S. Tsirkin" <mst@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
qemu-devel <qemu-devel@nongnu.org>,
Qemu-block <qemu-block@nongnu.org>,
yc-core@yandex-team.ru,
"Daniil Tatianin" <d-tatianin@yandex-team.ru>,
"Denis Plotnikov" <den-plotnikov@yandex-team.ru>,
"Kevin Wolf" <kwolf@redhat.com>
Subject: Re: vhost-user question about VHOST_USER_F_PROTOCOL_FEATURES
Date: Thu, 12 Oct 2023 15:33:49 -0400 [thread overview]
Message-ID: <20231012152854-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <06ea0a74-f10e-4625-bdf1-0caa805b2af7@yandex-team.ru>
On Thu, Oct 12, 2023 at 09:20:28PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> Hi all!
>
> We now have a problem in downstream:
>
> We have a vhost-user server, which doesn't support VHOST_USER_SET_VRING_ENABLE. As I understand, vhost-user specification allows it. So the server behaves as follows:
>
> 1. in GET_FEATURES, it sets VHOST_USER_F_PROTOCOL_FEATURES, to report support for protocol features.
>
> 2. if this flag VHOST_USER_F_PROTOCOL_FEATURES is set in SET_FEATURES, it reports an error
>
> In my opinion, this doesn't violate the specification, maybe I'm wrong.
well it doesn't but it's a quality of implementation issue.
if you set a feature bit in GET_FEATURES you should fully expect clients
to set this bit.
> Newer QEMU, after commits
>
> 02b61f38d357490 "hw/virtio: incorporate backend features in features"
> and
> 4daa5054c599c8a
> "vhost: enable vrings in vhost_dev_start() for vhost-user devices"
>
> actually doesn't support such behavior, as QEMU assumes that if we have the flag in GET_FEATURES, it is supported by SET_FEATURES.
>
>
> I don't see any possibility to clearly support in QEMU both servers which supports vring enable/disable and older servers that doesn't.
>
> =====
>
> I also want to clarify,
>
> 1. is "feature negotiated" means set both in GET_FEATURES and SET_FEATURES, as this term is not directly defined.
generally both but yes, it is unfortunately vague in virtio spec too.
> 2. What VHOST_USER_SET_VRING_ENABLE should do for vhost-user-blk? What meant by "side effects" in this case? All IO requests should just fail, not touching the actual storage?
we discussed this recently upstream.
I think most devices should just not process the ring.
network is one of exceptions where you can harmlessly discard packets and
guest does not care much.
> 3. Except for VHOST_USER_SET_VRING_ENABLE, there is another command require not just VHOST_USER_F_PROTOCOL_FEATURES being present in GET_FEATURES, but "negotiated" i.e., as I understand being then set in SET_OPTIONS by client. That's VHOST_USER_SET_SLAVE_REQ_FD. Why? Is it a mistake?
generally frontend must set a bit before using it.
this way backend knows what is going to be used.
> 4. Also, in VHOST_USER_SET_FEATURES definition:
>
> Feature bit ``VHOST_USER_F_PROTOCOL_FEATURES`` signals
> back-end support for ``VHOST_USER_GET_PROTOCOL_FEATURES`` and
> ``VHOST_USER_SET_PROTOCOL_FEATURES``.
>
>
> That seems wrong, as the flag in SET command is about vring enable/disable related behavior.
I think we meant frontend use not backend support.
> --
> Best regards,
> Vladimir
prev parent reply other threads:[~2023-10-12 19:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-12 18:20 vhost-user question about VHOST_USER_F_PROTOCOL_FEATURES Vladimir Sementsov-Ogievskiy
2023-10-12 19:33 ` Michael S. Tsirkin [this message]
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=20231012152854-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=d-tatianin@yandex-team.ru \
--cc=den-plotnikov@yandex-team.ru \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@yandex-team.ru \
--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;
as well as URLs for NNTP newsgroup(s).