Give a system VM one NIC queue per CPU - #14136
Open
bhouse-nexthop wants to merge 2 commits into
Open
Conversation
A system VM gets a single NIC queue however many CPUs it has, so every packet interrupt lands on CPU0. Adding CPUs to a router does not move more packets, which is the only reason to add them. Queue count is already a VM detail, nic.multiqueue.number, and the agent already turns it into <driver queues='N'/>. A user VM sets it three ways: deployVirtualMachine nicmultiqueuenumber=N updateVirtualMachine details[0].nic.multiqueue.number=N the Settings tab, listDetailOptions offers the key A system VM goes through none of them, so there is no way to set it at all. This gives one queue per CPU when nothing is set. 1 CPU no queues attribute, unchanged 4 CPU queues='4' 512 CPU queues='256', a tap device goes no higher The default offering is a single CPU, so a default install is unchanged. Only a resized system VM differs, and it differs the way the resize asked for. A queue number set on the VM still wins. Signed-off-by: Brad House <bhouse@nexthop.ai>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.22 #14136 +/- ##
=========================================
Coverage 17.93% 17.93%
- Complexity 16143 16150 +7
=========================================
Files 5928 5928
Lines 535174 535188 +14
Branches 65494 65497 +3
=========================================
+ Hits 95981 96007 +26
+ Misses 428266 428254 -12
Partials 10927 10927
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
MAX_TAP_QUEUES was declared between the @Inject and networkOfferingDetailsDao, so the annotation bound to the constant and the DAO was never injected. getNicDetails() dereferences it for every NIC, so every VM deploy failed with an NPE behind a 530 "Internal Server Error", which is what the simulator CI run was reporting. Move the constant above the injected fields and give the DAO its annotation back. Signed-off-by: Brad House <bhouse@nexthop.ai>
bhouse-nexthop
force-pushed
the
vr-nic-multiqueue-422
branch
from
September 11, 2026 01:25
216b4cb to
0d63a76
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A system VM gets one NIC queue no matter how many CPUs it has, so every packet interrupt lands on
CPU0. Adding CPUs to a router therefore does not move more packets, which is the only reason to add
them.
The queue count is already a VM detail,
nic.multiqueue.number, and the agent already turns it into<driver queues='N'/>on the interface. A user VM can set it three ways:deployVirtualMachine nicmultiqueuenumber=NupdateVirtualMachine details[0].nic.multiqueue.number=NlistDetailOptionsoffers the key for KVMA system VM goes through none of them. It is not created by
deployVirtualMachine, it is not aUserVmsoupdateVirtualMachinedoes not apply, and it has no details editor. There is no wayto set it at all, which is why this is a fix rather than a new setting.
So a system VM now gets one queue per CPU when nothing is set:
queues='4'queues='256'The 256 is the tap device ceiling in the host kernel, which refuses the interface rather than
trimming to fit. Above the CPU count it would make no difference anyway - the guest driver uses
min(CPUs, queues)and pushes that at probe, so no guest side change is needed.A queue number already set on the VM still wins.
The default offering is a single CPU, so a default install emits the same domain XML as before.
Only a system VM someone has already resized differs, and it differs in the direction the resize
asked for.
Worth calling out
symmetric, but it is worth being explicit about on a release branch.
4 CPU router fronting 8 tiers goes from 8 vhost threads to 32. Idle queues are cheap, but the
thread count is not nothing on a dense host.
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
How Has This Been Tested?
KVMGuruTest,Tests run: 35, Failures: 0. Six new cases:queues='4'The guest side was checked against the driver source the system VM runs, Linux 6.1
drivers/net/virtio_net.c:followed by
virtnet_set_queues(vi, vi->curr_queue_pairs)at probe, so the queues come up withoutethtool -L. The 256 comes fromMAX_TAP_QUEUESindrivers/net/tun.c.