diff mbox series

[kvmtool,v2,14/17] virtio/net: Warn about enabling multiqueue with vhost

Message ID 20230606130426.978945-15-jean-philippe@linaro.org (mailing list archive)
State New, archived
Headers show
Series Fix vhost-net, scsi and vsock | expand

Commit Message

Jean-Philippe Brucker June 6, 2023, 1:04 p.m. UTC
vhost-net requires to open one file descriptor for each TX/RX queue
pair. At the moment kvmtool does not support multi-queue vhost: it
issues all vhost ioctls on the first pair, and the other pairs are
broken. Refuse the enable vhost when the user asks for multi-queue.

Using multi-queue vhost-net also requires creating the tap interface
with the 'multi_queue' parameter.

Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
---
 virtio/net.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/virtio/net.c b/virtio/net.c
index c4d20f22..02667176 100644
--- a/virtio/net.c
+++ b/virtio/net.c
@@ -741,6 +741,11 @@  static struct virtio_ops net_dev_virtio_ops = {
 
 static void virtio_net__vhost_init(struct kvm *kvm, struct net_dev *ndev)
 {
+	if (ndev->queue_pairs > 1) {
+		pr_warning("multiqueue is not supported with vhost yet");
+		return;
+	}
+
 	ndev->vhost_fd = open("/dev/vhost-net", O_RDWR);
 	if (ndev->vhost_fd < 0)
 		die_perror("Failed openning vhost-net device");