Re: [PATCH v7] virtio-vsock: Add support for multi devices
Xuewei Niu <[email protected]>
| Newsgroups | dev.linux.lists.virtio-comment |
|---|---|
| Message-ID | <[email protected]> |
> On Sat, Apr 12, 2025 at 10:39 PM Xuewei Niu <[email protected]> wrote: > > > > This patch brings a new feature, called "multi devices", to the virtio > > vsock. It introduces a "VIRTIO_VSOCK_F_MULTI_DEVICES" feature bit, and a > > "device_order" field to the config for the virtio vsock. > > > > == Motivition == > > > > Vsock is a lightweight and widely used data exchange mechanism between host > > and guest. Currently, the virtio-vsock only supports one device, resulting > > in the inability to enable more than one backend. > > I wonder which part of the spec forbids more than one device. No. The spec, however, is designed for a single device, and lacks some specifications for multiple devices. For example, we should have a mechanism to select a device from all to communicate with a peer. This patch introduces a new feature bit "VIRTIO_VSOCK_F_MULTI_DEVICES", and involves some modifications to the config space, device & driver norms. > > For instance, two devices > > are required: one to transfer data to the VMM via virtio-vsock, and another > > to a user process via vhost-user-vsock. > > > > Apart from that, a side gain is that theoretically the performance might be > > improved since each device has its own queue. But it varies depending on > > the implementation. > > It could implement multiqueue anyhow. > > Thanks Yes, indeed. As we discussed before, I marked this as a side gain. And @Stefano said that the community has a plan to implement multiqueue for vsock. The foundational goal of this patch is to enable vsock to support multiple backends. Thanks, Xuewei