Virtualization

KVM guests drop incoming packets under sustained throughput when SR‑IOV VFs are bound with VFIO

liamlogic
1mo ago
Environment

Environment

Linux host (CentOS 8) running KVM/QEMU with Mellanox NICs providing SR-IOV VFs; VFIO used to passthrough VFs to guests. Issue seen on guests running sustained RX under heavy load.

Symptoms

Symptoms

Guests keep interfaces up and counters increment, but incoming packet reception halts for 10–60s while host-level pps counters continue; guests do not receive traffic during stalls, then resume. Small packets continue to pass intermittently.

Observations

Observations

Host dmesg shows no device reset. ethtool -S on physical PF shows RX drops and driver queue full counters rising. Guests' ifconfig shows normal link. Rebinding VFs to host (unplug/plug) restores traffic. Behavior correlates with high interrupt/coalescing load and host CPU steal/runqueue spikes.

Already attempted

Already attempted

Tried reducing VF interrupt moderation, increased queue counts, tuned netdev_max_backlog and rxfh, updated Mellanox drivers (latest stable), moved VFs between NUMA nodes — stalls still occur under very high sustained throughput.

Question

Question

What causes guest RX stalls with VFIO-bound SR-IOV VFs under sustained throughput and how to mitigate without removing passthrough?

COMMUNITY RESPONSES

Verified community troubleshooting

1 reply
0
daviddata Answer
user
Posted 1mo ago • 0 confirmations

This typically comes from interrupt/queue overload on the host when SR‑IOV VFs are VFIO-bound. Start by pinning VF/PF IRQs and the guest vCPUs to the NIC's NUMA node, increase RX ring sizes and netdev_max_backlog, and reduce interrupt moderation to smooth bursts. If problems persist, test with virtio/vhost instead of passthrough to confirm whether VFIO adds the regression. Gather NIC ethtool -S stats, IRQ mappings, and perf traces and open a vendor support ticket if driver/firmware looks suspect. Rolling back to older firmware is an option but do so with change windows.

Showing 1 of 1 community responses
AI DIAGNOSTICS

Incident analysis

Updated 1mo ago• Trouble ID

Most likely causes

Host-side interrupt/IRQ handling bottleneck leading to RX queue overflow before VF DMA completed 85%
NIC driver or firmware bug when VFs are used with VFIO under high pps/throughput 65%
NUMA misconfiguration: VF queues bound to CPU far from memory region, causing latency under load 55%

Summary

When VFs are passed through with VFIO, guests rely on hardware queues and interrupts. High sustained RX can exhaust NIC driver software queues or cause interrupt handling bottlenecks on the host CPU/core handling the PF/VF traffic. Interrupt moderation, coalescing, or misaligned IRQ affinity can lead to bursts where host cannot keep up, causing packet drops that do not show up as link-down. VFIO adds overhead for interrupt routing and may interact poorly with driver queue handling on certain NIC firmwares, explaining why rebinding restores flow temporarily.

Suggested Fixes

Diagnostic step 1
Pin VF interrupts and the host irqbalance so VF/PF interrupts and guest vCPU handling occur on CPUs local to the NIC's NUMA node; use 'smp_affinity' or irqaffinity tools.
Diagnostic step 2
Increase RX ring sizes and netdev_max_backlog on host and guests; tune interrupt coalescing to lower pps spikes.
Diagnostic step 3
Test with vendor-recommended firmware/drivers; if already latest, try a vendor recommended older firmware to check for regression and capture NIC driver debug stats.

Continue troubleshooting

Matched from the title, description and tags