Repository navigation
Conversation
A virtual router's virtio NICs always have a single queue: VPC router NICs are hot-plugged with an empty details map, and the agent cannot resolve nic.multiqueue.number=-1 on a plugged NIC because it gets no vCPU count. One host vhost thread then copies every packet of the NIC and caps the router's throughput whatever its vCPU count. For VMs of type DomainRouter, every virtio NIC now gets queues=<vCPUs> (from 2 vCPUs up) and packed virtqueues (where QEMU and libvirt support them), both when the domain is defined and when a NIC is hot-plugged; the plug path reads the vCPU count from the running domain. Queue settings from the VM details still win. The agent property router.nic.multiqueue.enabled (default true) switches it off.
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
…plug Packed virtqueues were asked for on router NICs to cut the vhost thread's per-packet cost, but the kernel's vhost-net does not offer the packed ring: QEMU runs the NIC with packed=true, yet the device does not offer VIRTIO_F_RING_PACKED to the guest (checked with x-query-virtio-status on QEMU 10.2.1, kernel 7.0). The guest always uses the split ring, so packed is dropped and router NICs get multiqueue only. - A replugged router NIC, after a VLAN or physical network change, keeps one queue per vCPU instead of falling back to a single queue. - Plugging a NIC reads the domain's vCPU count only for routers, so a failure there cannot fail the plug of another VM's NIC.
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.
Virtual router NICs on KVM get a single virtio queue, so all traffic of a router with several vCPUs is handled by one host vhost thread. Router NICs now get one queue per vCPU, when the router is defined, when a NIC is hot-plugged and when it is replugged after a VLAN or physical network change; queue settings from the VM details still win. Guest VM NICs are not changed, and only the router's NIC plug reads the domain's vCPU count.
The behaviour can be switched off per host with the agent property
router.nic.multiqueue.enabled(default true), documented inagent.properties. Packed virtqueues are not used: the kernel's vhost-net does not offer the packed ring, so the guest would use the split ring anyway. Unit tests cover the router, single-vCPU, guest VM, VM detail and switched-off cases, and the plug and replug wrappers.