notes

The e1000e NIC: the network card a PC actually has

(Milestone 494 (a driver for the network card a PC actually has), rung 3b of milestone 198 (a package manager, and the trivial install). Every name on this page is provisional: e1000e for the crate, e1000e_transport, e1000e_service, network_bench, cargo xtask network-bench and this page's stem. An architect names things.)

nife's first network driver for a device a physical machine has. Intel's e1000e family covers the 82574L, which QEMU emulates as -device e1000e, and the I219 that xenon and a large share of business desktops carry. The driver is milestone 261 (the NVMe driver leaves the kernel)'s shape applied to a second real device, and it adds no system call surface.

How it is split

piece where what it does
control plane kernel/src/e1000e.rs finds the NIC, confines its DMA to one region, resets it, reads the MAC address, programs both ring bases, enables receive and transmit
what the process is handed kernel/src/user/e1000e_service.rs the spawn: two pages of BAR0, the DMA region, net_stack's usual slots minus the interrupt and the virtio transport
data plane components/src/e1000e_transport.rs, inside net_stack posts receive buffers, copies frames, moves the two tails, polls
everything either half computes partsfoundry/e1000e register map, descriptor formats, the DMA layout, and the whole ring logic behind two traits, host-tested against a simulated device and proved by Kani
what the kernel and the process agree on crates/driver_process_contract's e1000e the spawn handoff (Handoff, ROLE_TAG) and the three virtual addresses the process's windows sit at

net_stack drives every NIC it has a transport for through one enum, Nic (components/src/nic_device.rs), which is where smoltcp's phy::Device lives. Its entry, start in components/src/socket_server.rs, picks the server by the role word: 0 is the virtio server, and a word driver_process_contract::e1000e::Handoff::is_role accepts is the e1000e server. Handoff::pack and Handoff::unpack are the two words' layout, on the kernel's side and the process's.

The crate's README says where its register facts come from. Why its platform_controller_hub module ports FreeBSD's I219 bring-up, and how the kernel calls it, is in the I219 port.

The finding that decides the confinement

NVMe put its doorbells on a page of their own, so milestone 261's server can ring them without being able to move a ring. The e1000e family does not. Receive queue 0's base register is at 0x2800 and its tail at 0x2818; transmit's are 0x3800 and 0x3818 (Linux's regs.h, read 2026-10-04; partsfoundry/e1000e's registers). The process that moves a tail can also repoint the ring, so the IOMMU is the whole of the DMA confinement on this device, which milestone 494's block predicted from recall and the register map now confirms.

What the split still keeps from the process: BAR0's page 0 (CTRL, STATUS, RCTL, TCTL, the interrupt registers) and page 5 (the receive address and multicast filters). It cannot reset the device, change its MAC address, receive promiscuously, or reach the PHY.

That the IOMMU is doing the work was watched, not assumed. With the kernel's iommu::confine call skipped, QEMU printed vtd_iommu_translate: detected translation failure (dev=00:05:00, iova=0x920000) on the NIC's first ring fetch and no lease ever came (2026-10-04, x86_64; the DHCP test's Falsification: record).

What the server holds

kernel/src/user/e1000e_service.rs is the whole of what the process is handed, and it follows the virtio server's slot layout so the rest of net_stack is unchanged.

What it is denied is each a decision. BAR0's pages 0 and 5 stay with the kernel, as above. It holds no Interrupt capability: it polls, as the NVMe server does, because x86 routes no device line to a userspace waiter yet and the device is created with every interrupt masked. And it holds no DeviceFrame or PageFrame capability for either window. They arrive as spawn-time mappings, so it holds no name for them and cannot delegate or remap them.

A server over a link that is down is never started (Absent::NoLink). net_stack's DHCP loop has no bound, and every caller blocks on its lease. Such a server would be a wait with no end: a boot that never reaches its prompt, or a system test the harness watchdog stops along with the suite.

The booted system also leaves a PCH part such as the I219 untouched until PCH_PROVEN_ON_SILICON is set. Bring-up on one runs FreeBSD's I219 passes, and a hang in them would take xenon's prompt with it. That constant is set only in a commit that cites a xenon bench boot of the same bring-up ending verdict LEASED-AND-MEASURED. QEMU's 82574L never takes the PCH path, and the host simulation is this tree's reading of FreeBSD, not the device.

The gates, and what each proves

system_tests/src/user/e1000e_tests.rs, one module for all three architectures:

test proves
net_stack_gets_a_dhcp_lease_over_the_e1000e_nic_behind_the_iommu smoltcp's DHCP round trip through this data plane; the owning IOMMU unit was translating; the MAC address reached net_stack from the device's own register
a_client_echoes_over_tcp_through_the_e1000e_nic milestone 30 (the network stack as a confined component)'s TCP gate, same client
a_client_completes_a_udp_round_trip_through_the_e1000e_nic the datagram path, against slirp's TFTP server
a_package_fetched_over_the_e1000e_nic_is_accepted_only_by_the_image_digest rung 3a's fetch-and-verify, tens of kilobytes twice over TCP in full-size frames

Green on aarch64, riscv64 and x86_64 (PVH and OVMF) on patagonia, 2026-10-04. Each runner attaches the NIC as -device e1000e,mac=52:54:00:e1:00:0e,romfile= on its own slirp network whenever NIFE_NET is set, and the OVMF runner always does.

The OVMF runner had a NIC nobody chose. Until this milestone helpers/qemu-uefi-x86_64.sh named no network, and QEMU added its default: on q35 that is an e1000e on user networking. The first UDP run here reached slirp's TFTP server and was told the fixture did not exist, which is how it showed up. The device is now explicit and carries the same peers the other runners give theirs.

The bench boot

cargo xtask network-bench builds the network_bench kernel (release), stages it at target/esp-network-bench, and rehearses it under OVMF against helpers/network-bench-peer. The boot prints, every line prefixed network-bench:, the NIC's id and model with link and MAC, the DMAR preflight, the lease, the transfer, and one verdict. The rehearsal on 2026-10-04:

This transcript predates the phy line (2026-10-05), which a rehearsal now prints after nic as network-bench: phy : id 0x01410cb0.

network-bench: nic       : 8086:10d3 82574L (QEMU's e1000e), link up, mac 52:54:00:e1:00:0e
network-bench: preflight dmar scope : PASS
network-bench: dhcp      : leased 10.0.2.15
network-bench: transfer  : 8388608 bytes in 0.891 s = 75.308 Mbit/s
network-bench: verdict LEASED-AND-MEASURED

That rate is QEMU's under TCG and says nothing about a NIC. What the number counts on any machine is in notes/bench-boots.md: one stream through a 16 KiB receive window, a RECEIVE call per chunk, the NIC looked at continuously while frames flow. It measures this stack as built.

calef's bench step on xenon

Milestone 494's exit criterion 2, and the gate on PCH_PROVEN_ON_SILICON, is one boot of the bench kernel on xenon with the I219 cabled to a switch. The procedure, every ending, what to record and the Results table are the I219 cabled run. The same boot records what partsfoundry/e1000e issue 10 asks for: the bring-up observations, the link state and the frame counts in both directions, from the device's own counters (frame_counts in kernel/src/e1000e.rs, printed as network-bench: frames). It ends network-bench: verdict LEASED-AND-MEASURED when it succeeds.

BUGS