Repository navigation
feat(hhfab): give DPDK gateway VMs a virtual IOMMU and e1000e NICs - #2165
Draft
daniel-noland wants to merge 2 commits into
Draft
daniel-noland wants to merge 2 commits into
daniel-noland wants to merge 2 commits into
Conversation
The DPDK driver binds the gateway's NICs to vfio-pci, and vfio-pci needs an IOMMU group to bind to. VLAB gateway VMs have no IOMMU, and the Flatcar kernel is built without VFIO no-IOMMU mode, so the bind fails with EINVAL and the dataplane never starts. Give gateway VMs whose Gateway uses the DPDK driver (an interface with a PCI address, as the gateway API decides it) an emulated Intel IOMMU with interrupt remapping. The Flatcar kernel enables the IOMMU by default. The IOMMU alone is not enough: every NIC sits behind the same conventional PCI bridge, which puts them all in one IOMMU group, and vfio-pci takes a group whole. The management NIC would go with the dataplane's, and DPDK refuses the group as not viable while it is bound to e1000. So these VMs put their dataplane NICs on the root bus, one group each, and keep the management NIC behind the bridge where its name, enp2s0, comes from. The Gateway's PCI addresses are generated from the same rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
The DPDK driver gives each port a transmit queue per worker and one more for the control plane. QEMU's e1000 emulates the 82540EM, which has a single transmit ring, but DPDK's em driver advertises two for every em device. The control plane's frames went to the second queue and never left the VM: no ARP, no BGP, no BFD, while the dataplane counted them as sent. The e1000e (82574L) has two rings, and with it BGP, BFD and LLDP come up over the DPDK driver. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 23, 2026
This branch has not been deployed
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.
The DPDK driver binds the gateway's NICs to vfio-pci, and vfio-pci needs an IOMMU group to bind to. VLAB gateway VMs have no IOMMU, and the Flatcar kernel is built without
CONFIG_VFIO_NOIOMMU, so with--gateway-driver=dpdkthe bind fails with EINVAL (vfio-pci 0000:02:01.0: probe with driver vfio-pci failed with error -22) and the dataplane never starts.Gateway VMs whose Gateway uses the DPDK driver (an interface given by PCI address, the way the gateway API defaults its driver) now get:
-device intel-iommu,intremap=on,kernel-irqchip=split), ahead of every PCI device. The Flatcar kernel hasCONFIG_INTEL_IOMMU_DEFAULT_ON=y, so the guest needs no kernel arguments.0x10+ NIC ID, so each is its own IOMMU group. Behind the shared conventional PCI bridge all NICs land in one group, vfio-pci takes a group whole, and DPDK rejects it (VFIO group is not viable) while the management NIC is still on e1000. The management NIC stays behind the bridge, so it is stillenp2s0.0000:00:11.0,0000:00:12.0, ...).e1000e(82574L) dataplane NICs instead ofe1000(82540EM). The DPDK driver gives each port a transmit queue per worker plus one for the control plane. The 82540EM has a single transmit ring, though DPDK's em driver advertises two, so control-plane frames sent on the second never left the VM: ARP, BGP and BFD all failed while the dataplane counted them as sent.Kernel-driver gateways, switches, servers and the control node are unchanged.
Testing
New
TestCreateVLABConfigDPDKGatewayIOMMU: for both drivers, only DPDK gateways get the IOMMU, the management NIC stays behind the bridge, and every Gateway interface's PCI address is where the VM's NIC is. It was checked for vacuity: with the builder put back on0000:02:%02d.0, it fails.go test ./pkg/fab/... ./pkg/hhfab/...passes, and golangci-lint v1.64.8 reports 0 issues onpkg/hhfab.VLAB, using this commit cherry-picked onto v0.50.4 with
vlab gen --gateway-driver=dpdkandvlab up --recreate, running dataplane 0.30.0:q35,...,kernel-irqchip=splitandintel-iommu,intremap=on, withe1000onpcibr0,addr=0x0(management) and onpcie.0,addr=0x11/0x12. Switches don't get a vIOMMU.DMAR-IR: Enabled IRQ remapping in x2apic mode.enp2s0is up with its management address, and the IOMMU groups are{00:04.0, 01:00.0, 02:00.0},{00:11.0}and{00:12.0}.port1=pci@0000:00:11.0,port2=pci@0000:00:12.0.dataplane-initbinds both to vfio-pci, and EAL reportsUsing IOMMU type 1 (Type 1)and probes the device. The dataplane then stops at its own mlx5-only check (see below). Without this change it stops much earlier, at the vfio-pci bind (EINVAL), and with the vIOMMU alone it hitsVFIO group is not viable.Follow-up run on the same VLAB, with githedgehog/dataplane's vfio-pci port support (Bump to August Flatcar #1976) and an experimental fabric controller adding hugepage requests and the interface MTU (see below): BGP (IPv4 and EVPN) and BFD up on all four gateway links, LLDP seen by the spines,
setup-vpcs+setup-peerings 1+2:gw+test-connectivitypassing, and iperf3 between vpc-01 and vpc-02 through the gateway at about 11 Mbit/s each way.Not in this PR
/mtu=N(without it the DPDK ports stay at 1500, and full-size VXLAN packets are dropped). The gateway VMs also need hugepages reserved, which this PR does not do yet.Draft: the commit still needs the author's DCO sign-off.
🤖 Generated with Claude Code