qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* VHOST_USER_PROTOCOL_F_VDPA
@ 2020-08-21 11:08 Stefan Hajnoczi
  2020-09-02  7:42 ` VHOST_USER_PROTOCOL_F_VDPA Jason Wang
  2020-09-10  8:55 ` VHOST_USER_PROTOCOL_F_VDPA Maxime Coquelin
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2020-08-21 11:08 UTC (permalink / raw)
  To: Maxime Coquelin
  Cc: Tiwei Bie, Cindy Lu, Michael S. Tsirkin, jasowang, qemu-devel,
	Raphael Norwitz, kraxel, Marc-André Lureau, Changpeng Liu

[-- Attachment #1: Type: text/plain, Size: 2510 bytes --]

The first vDPA ioctls have been added to the vhost-user protocol and I
wonder if it's time to fully change the vhost-user protocol's focus to
providing a full VIRTIO device model like vDPA does.

Initially vhost-user was just used for vhost-net. As a result it didn't
need the full VIRTIO device model including the configuration space and
device status register.

Over the years device-specific messages were added to extend vhost-user
to cover more of the VIRTIO device model. vhost-user-blk needed
configuration space support, for example.

The problem for VMMs and device backend implementors is that the
protocol is currently positioned halfway between the original vhost-net
approach and the full VIRTIO device model. Even if a VMM implements
VHOST_USER_GET_CONFIG, it can only expect it to work with
vhost-user-blk, not vhost-user-net. Similarly, a vhost-user-net device
backend cannot implement VHOST_USER_GET_CONFIG and expect all VMMs to
allow it to participate in configuration space emulation because
existing VMMs won't send that message.

The current approach where each device type uses a undocumented subset
of vhost-user messages is really messy. VMM and device backend
implementors have to look at existing implementations to know what is
expected for a given device type. It would be nice to switch to the
VIRTIO device model so that the VIRTIO specification can be used as the
reference for how device types work.

Now that vDPA is here and extends the kernel vhost ioctls with a full
VIRTIO device model, it might be a good time to revise the vhost-user
protocol.

A vdpa-user protocol (or vhost-user 2.0) would replace the current mess
with a full VIRTIO device model. Both VMMs and device backends would
require changes to support this, but it would be a cleaner path forward
for the vhost-user protocol.

One way of doing this would be a new VHOST_USER_PROTOCOL_F_VDPA feature
bit that indicates all the currently existing Linux vDPA ioctl messages
are available. Legacy vhost-user messages with overlapping functionality
must not be used when this bit is set. Most importantly, device backends
need to implement the full VIRTIO device model, regardless of device
type (net, blk, scsi, etc).

The device type most affected by this change would be virtio-net. The
other device types are already closer to the full VIRTIO device model.

I wanted to share this idea in case someone is currently trying to
figure out how to add more VIRTIO device model functionality to
vhost-user.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-11 12:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-21 11:08 VHOST_USER_PROTOCOL_F_VDPA Stefan Hajnoczi
2020-09-02  7:42 ` VHOST_USER_PROTOCOL_F_VDPA Jason Wang
2020-09-10  8:55 ` VHOST_USER_PROTOCOL_F_VDPA Maxime Coquelin
2020-09-11 12:54   ` VHOST_USER_PROTOCOL_F_VDPA Stefan Hajnoczi

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).