qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

QEMU Multiqueue with VirtIO not working


From: Matheus Stolet
Subject: QEMU Multiqueue with VirtIO not working
Date: Sun, 23 Jul 2023 22:55:44 +0200
User-agent: Roundcube Webmail/1.4.13

I am trying to add a network interface to QEMU that uses multiple queues, but when I check the number of queues for my created device inside the VM, only one queue is showing up. How do I create a virtual interface inside a VM that has multiple RX queues?

I start QEMU with the following command:

sudo qemu-system-x86_64 \
    -nographic -monitor none -serial stdio \
    -machine accel=kvm,type=q35 \
    -cpu host \
    -smp 11 \
    -m 10G \
    -snapshot \
    -netdev user,id=net0,hostfwd=tcp::2220-:22 \
    -device virtio-net-pci,netdev=net0 \
-chardev socket,id=char0,path=/usr/local/var/run/openvswitch/vhost0 \ -netdev type=vhost-user,chardev=char0,vhostforce=on,queues=12,id=net1 \
    -device virtio-net-pci,netdev=net1,mac=$mac,mq=on,vectors=26 \
-object memory-backend-file,id=mem,size=10G,mem-path=/dev/hugepages,share=on \
    -numa node,memdev=mem -mem-prealloc \
    -drive if=virtio,format=qcow2,file="base.snapshot.qcow2" \
    -drive if=virtio,format=raw,file="seed.img"

And this is the result of the ethtool command:
sudo ethtool -S enp0s2
NIC statistics:
     rx_queue_0_packets: 233
     rx_queue_0_bytes: 284704
     rx_queue_0_drops: 0
     rx_queue_0_xdp_packets: 0
     rx_queue_0_xdp_tx: 0
     rx_queue_0_xdp_redirects: 0
     rx_queue_0_xdp_drops: 0
     rx_queue_0_kicks: 1
     tx_queue_0_packets: 104
     tx_queue_0_bytes: 9140
     tx_queue_0_xdp_tx: 0
     tx_queue_0_xdp_tx_drops: 0
     tx_queue_0_kicks: 80
So I can actually run clients and servers that use this interface, but it seems like I am only using one RX queue, so performance is not very good.Furthermore, when I run ethtool -l enp0s2 I noticed that despite mq=on and queues=12, the current hardware setting and the pre-set maximums indicate that combined=1. From other examples, the value for combined is the number of queues created. When I try to configure the number of queues used by the NIC with the following command ethtool -L enp0s2 combined 10 I get the following error Cannot set device channel parameters: Invalid argument

Versions
qemu-x86_64: 8.0.90
VM Distribution: Ubuntu 20.04
VM Kernel: 5.4.0-148-generic



reply via email to

[Prev in Thread] Current Thread [Next in Thread]