aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Brucker <jean-philippe@linaro.org>2023-06-06 14:04:23 +0100
committerWill Deacon <will@kernel.org>2023-06-08 22:39:03 +0100
commit3a70ab1e7bb3b0ec773fcc95020bf95cab763fdf (patch)
treeadc0aaf19ec48ee94f1417ea1fa046db5addaa3a
parent33e026a78c9f6760bf809d5b01369aaed2f627ee (diff)
downloadkvmtool-3a70ab1e7bb3b0ec773fcc95020bf95cab763fdf.tar.gz
virtio/net: Warn about enabling multiqueue with vhost
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> Link: https://lore.kernel.org/r/20230606130426.978945-15-jean-philippe@linaro.org Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r--virtio/net.c5
1 files changed, 5 insertions, 0 deletions
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");