SR-IOV and NIC Passthrough: Giving a VM Its Own Slice of the Network Card
When the virtual bridge is the bottleneck and the fix is handing a VM real silicon

Contents
Most of the time, a virtio NIC through a Linux bridge is exactly the right answer for a VM’s networking — it’s flexible, it’s fast enough for almost everything a homelab throws at it, and it doesn’t tie a VM to specific physical hardware, which matters for live migration. But I ran into the case where it wasn’t fast enough: a VM doing sustained multi-gigabit throughput where the bridge’s per-packet CPU overhead on the host was showing up as a real, measurable ceiling, well short of what the physical NIC and the network on the other end could actually do. I’d assumed for a while that the bottleneck was somewhere else — the VM’s own CPU allocation, the switch, the far end of the link — before htop on the host made it obvious that a single kernel thread handling that VM’s bridge traffic was pinned at 100% while everything else sat comfortably idle. The fix was SR-IOV — letting a VM talk to a slice of the physical network card directly, bypassing the host’s virtual switching layer entirely.
Why the virtio bridge has a ceiling
A standard virtio NIC works by having the guest’s network driver talk to a virtual device that the host’s kernel and QEMU emulate, with every packet crossing through the host’s bridge, its networking stack, and a context switch between the guest and the host process handling the emulation. It’s genuinely well-optimised — virtio is designed specifically to minimise this overhead compared to full hardware emulation — but “minimised” isn’t “zero,” and at high packet rates or sustained high throughput, that per-packet host-side CPU cost adds up into a real bottleneck, usually visible as the host CPU core handling that VM’s networking pinned near 100% well before either the physical link or the VM’s own CPU allocation is saturated.

For the overwhelming majority of homelab workloads this ceiling is nowhere close to relevant — file transfers, web services, most self-hosted apps never get near it. It matters for things like a VM doing sustained 10Gbps+ throughput, latency-sensitive workloads where the extra hop through the host’s networking stack adds jitter that matters, or a VM you’re deliberately using for network-heavy testing where you want results that reflect the hardware, not the virtualisation layer on top of it.
What SR-IOV actually does
SR-IOV (Single Root I/O Virtualization) is a PCIe feature built into the network card itself, not something Proxmox or QEMU invents — it requires a NIC whose hardware and firmware explicitly support it (most Intel and Mellanox server-grade NICs do; consumer cards generally don’t). A capable card exposes one Physical Function (PF) — the “real” NIC the host sees normally — plus a configurable number of Virtual Functions (VFs), which are lightweight PCIe devices that behave like independent NICs from the perspective of anything they’re attached to, but which are actually slices of the same physical hardware, sharing its port and MAC address pool.
Each VF can be passed straight through to a VM using the same PCI passthrough mechanism you’d use for handing a VM its own physical disk or a GPU. Once passed through, the guest’s network driver talks almost directly to the physical card’s hardware queues — the host’s kernel is out of the packet path entirely for that VF, which is exactly where the virtio bridge’s per-packet overhead was coming from.
Enabling it: host-side IOMMU and VF creation
The prerequisites are the same as any PCI passthrough: IOMMU support enabled in the BIOS (VT-d on Intel, AMD-Vi on AMD) and enabled in the kernel command line:
| |
Then update-grub and reboot. Confirm IOMMU groups are actually populated:
| |
A non-zero, sensible count means it’s working; zero means either the BIOS setting is off or the command-line flag didn’t take.
With IOMMU confirmed, check whether the NIC supports SR-IOV and how many VFs it can create:
| |
Create the VFs — this example creates four:
| |
That’s runtime-only and won’t survive a reboot; make it persistent with a udev rule or a systemd unit that runs the same echo at boot, since there’s no dedicated Proxmox UI setting for VF count — it’s pure Linux kernel/driver territory that Proxmox just inherits.
Confirm the VFs appeared:
| |
SR-IOV versus macvlan/ipvlan
It’s worth being clear about where SR-IOV sits relative to the lighter-weight alternatives, because they solve overlapping-sounding problems in genuinely different ways. Macvlan and ipvlan interfaces also give a VM (or container) something that looks like a direct connection to the physical network, with its own MAC or IP rather than sharing the host’s bridge — but they’re still software constructs implemented by the host’s kernel, and every packet still passes through host-side processing, just with less overhead than a full bridge. They solve “I want this VM to look like an independent device on the network” without solving “the host’s CPU is the bottleneck,” because the host is still in the packet path either way.
SR-IOV is the only one of the three that actually removes the host from the data path for that VM’s traffic. If your problem is CPU overhead or latency added by host-side processing, only SR-IOV addresses it directly — macvlan and ipvlan are the right tool when what you actually want is address independence or bridge-avoidance for isolation reasons, not a throughput ceiling.
VLAN tagging on a VF
A detail that catches people out: VLAN tagging for a VF is often configured from the host side on the physical function, not from inside the guest the way you’d tag a normal virtio interface. Depending on the NIC and driver, you can pin a VF to a specific VLAN before it’s ever handed to the guest:
| |
Once set this way, the guest doesn’t need to know or care about VLAN tagging at all — it just sees an untagged interface, and the physical card handles the tag insertion and stripping in hardware. This is a genuinely nice property for a workload where you want the isolation guarantees of a dedicated VLAN without adding any VLAN-awareness complexity inside the guest OS, and it composes well with a VLAN-aware bridge setup elsewhere on the same host — the VF-tagged traffic and your regular bridge-tagged VM traffic can share the same physical switch port infrastructure without interfering with each other.
Not every card and driver combination supports host-side VF VLAN tagging identically — some require the VLAN to be set before the VF is passed through and won’t accept changes to a VF that’s already attached to a running VM, so it’s worth setting this up and confirming it before the guest is relying on it, rather than trying to adjust it live.
Assigning a VF to a VM
Each VF shows up as its own PCI device. Find its address and pass it through to a VM the same way you would any PCI device:
| |
Inside the guest, the VF appears as a normal-looking NIC — no special driver is usually needed for the guest OS itself beyond whatever driver matches the physical card’s chipset (Intel’s ixgbevf or iavf for their cards, Mellanox’s mlx5_core variants, and so on), and most modern Linux distributions include these drivers already.
One consequence worth planning around before you commit to this: a VM with a passed-through VF loses live migration. PCI passthrough ties the VM to that specific physical device on that specific host, so Proxmox can’t live-migrate it to another node the way it can a VM using a standard virtio NIC. For a workload where that trade-off matters — anything you rely on migrating for maintenance windows — weigh it carefully before switching over.
How many VFs is too many
Splitting a card into VFs isn’t free even before any of them are in use — each VF consumes a PCIe function slot and a share of the card’s hardware queue and buffer resources, and creating far more VFs than you actually plan to use can reduce per-VF performance across the board rather than costing nothing until they’re assigned. The sriov_totalvfs value a card reports is a hardware maximum, not a recommendation; I create only as many VFs as I have VMs actually planning to use passthrough, plus one or two spare for testing, rather than maxing out the card on the assumption I’ll grow into it. If you do need more later, VF count can be changed by re-writing sriov_numvfs (setting it to 0 first to clear existing VFs, then back up to the new count), though any VM actively using a VF at the time needs to be shut down first since destroying VFs out from under an attached guest doesn’t end well.
Troubleshooting
VFs don’t appear after setting sriov_numvfs. Check dmesg for driver errors immediately after the echo — some NIC firmware/driver combinations need a specific minimum driver version, and older distro kernels sometimes ship a version too old to support VF creation for a given card even though the card itself supports SR-IOV in principle. ethtool -i enp1s0f0 shows the driver version in use; check it against the NIC vendor’s minimum requirement.
VM boots but the passed-through VF shows no link. Confirm the VF’s MAC address and VLAN (if any) are set correctly from the host side first — some NIC drivers require the PF to explicitly configure the VF’s MAC before the VF will pass traffic, via ip link set enp1s0f0 vf 1 mac AA:BB:CC:DD:EE:FF. This is a common gotcha specifically because it’s easy to assume the VF is a fully independent device when it’s still partly under the PF’s control for these settings.
Host networking becomes unstable after creating VFs. Some cards reduce the PF’s own available queue count as VFs are carved out of it, which can matter if the host itself is doing heavy networking through that same physical port. Check whether you actually need the PF to keep doing host-level work, or whether it makes more sense to dedicate the whole card to VF passthrough and let the host use a different NIC for its own traffic.
Guest driver loads but throughput isn’t actually better than virtio was. Double check you’re actually testing the VF path and not accidentally still on a virtio bridge from before the change — ethtool -i inside the guest should show the VF driver, not virtio_net. If it genuinely is the VF and throughput still isn’t where you expected, check whether the bottleneck moved somewhere else entirely — storage, the other end of the connection, or a CPU limit on the VM itself that had nothing to do with networking in the first place.
Is it worth the setup
For most VMs, no — a standard virtio bridge is simpler, keeps live migration available, and is fast enough that you’ll hit a different bottleneck first. SR-IOV earns its complexity specifically for the workload where you’ve already confirmed, with actual measurements rather than a hunch, that the host’s virtual networking layer is the bottleneck, and where losing live migration for that VM is an acceptable trade. That’s a narrower set of situations than it might sound — most of my VMs, including several doing genuinely substantial file transfer work, never come close to needing it. But when a workload does hit that ceiling, the difference is dramatic enough — going from a hard CPU-bound cap to line-rate throughput with the host’s involvement removed from the packet path — that it’s worth having the technique in your back pocket rather than assuming the bridge is always good enough.
The pattern worth remembering, whether or not this specific technique applies to you: when a VM’s networking hits a ceiling that doesn’t move as you throw more VM CPU or RAM at it, look at the host’s own CPU usage for the process handling that traffic before assuming the guest itself is under-resourced. That one check is what turned a vague “networking feels slow” into a specific, fixable bottleneck, and it’s worth running before reaching for SR-IOV rather than after — plenty of throughput problems turn out to be something else entirely, like an MTU mismatch or a duplex setting, and it would have been a wasted afternoon setting up VFs to fix a problem that wasn’t actually there.




