Re: [Bug 298073] Bridge VLAN tagging fails when using bhyve e1000 device emulation

From: Eva_Winterschön <freebsd-virt.eva_at_winterschon.com>
Date: Sat, 21 Nov 2026 01:09:12 UTC
Not as much of a bug as an expected state of improper emulation circa 1998 calling from CompUSA, and almost poetic: 

The emulator reserves 4 bytes for a VLAN tag _it_ determines must be inserted, then fails the guest's packet for not covering them - so a 42-byte frame hits "packet too small for writable header" and you get total packet loss. The 1998-2002 stack punishing itself and everyone else using it. 

----

Historical context to avoid wasting resources, frustration, time, blah... the e1000 ancient endures for ONE reason: every guest OS since the dawn of time ships a "driver" (quotes because they're so often just not worthy of being attributed the term unless it's to drive(r) the VM and its intended VLAN tag off a cliff).

So, it's surreptitiously become an example of the "always boots" default - never mind it's emulating a 1ge NIC old enough to vote, in software, when virtio-net exists. Compatibility chosen over sanity, VLANs stacked on top, then surprise when it falls over. Superfuntimes.

----

Alternate datas for the old-hats who remember the physical NICs:

---
Chip / card | Year
82542 PRO/1000, fiber, PCI | 1998
82543GC + PRO/1000 T/F | 2000
82540EM (QEMU's e1000) | ~2002
82545 (bhyve's e1000) | ~2002

The PRO/1000 family as a real product line launched around the 82543GC in mid-2000, with the 82544 already sampling by March 2001 ~~ the 82542 server adapter was the 1998 ancestor, and the chips the hypervisors actually emulate are the 2000-2002 generation.

Which means a boxed Intel PCI card from CompUSA in *1998* was almost certainly an EtherExpress PRO/100 - gigabit over copper (802.3ab) wasn't even standardized until 1999, and 802.3z fiber gigabit only landed June 1998. Either the card was Fast Ethernet in '97, or it was a PRO/1000 and the year slid by two or three. Era compression - the whole period feels like one year now, just like the length of time it felt like to stand in the checkout line with a shrink-wrapped box of FreeBSD floppies.

So my "old enough to vote" line holds: bhyve is emulating a ~23-year-old NIC. Fixes are good, proper maintenance helps others prevent confusion states, but ultimately.. just don't use the e1000 driver for VLAN bridges; there are better options even once the fix is complete. 

----

Note: docs should make note of these facts. We cannot have future users think FreeBSD is just for "the olds". 

Corollary: options for options for Bhyve without linux crosswalking:
 
| NIC Dev-Type | Origin |
| e1000 | emulated 82545 | 
| virtio-net | paravirt, tap / netmap / ng |
| viona  | illumos in-kernel accel |
| ptnet  | netmap paravirt FBSD |

On the politics and history as relevant discussion:
- bhyve's virtio-net isn't QEMU code. It's a BSD-licensed implementation of an OASIS spec, written for bhyve. 
- potential Linux-lineage objection/avoidance really lands on QEMU the program. 

But if the objection is to virtio as an ecosystem, ptnet is the clean answer: 
- Using netmap's own paravirt device from the Pisa group (Rizzo/Maffione) is BSD-licensed and in base since FBSD 12.0. 
- With ptnetmap the hypervisor leaves the datapath almost entirely; the guest netmap talks to a host netmap port or the VALE switch directly (ie: 20+ Mpps in their BSDCan numbers). 

Catch: the guest driver exists for FreeBSD (and Linux via netmap but nevermind that), so it's a BSD-guests-only club.

Backends aren't device models, but worth separating: 
- Behind e1000 or virtio-net you can hang tap, netmap, or netgraph (please be on FBSD 13+)
- netgraph being another fully native plumbing layer -- Illumos ships the same two models, but its default netif is virtio-net-viona; virtio at the guest boundary, datapath in the illumos kernel over Crossbow VNICs, 8 queue pairs by default. So... it's native code, but still virtio-flavoured.

PCIe Passthrough is how a decently modern guest gets a true Mellanox / Chelsio / Intel NIC... and there's fresh movement: an Oct 31, 2026 commit MFC'd igb SR-IOV PF support for 82576 and I350 to stable/15, with VFs split out as igbv! YAY! 

So even the baseline (usually MB ports on a generic server) using basic 1ge intel parts can now mint VFs for ppt and everyone becomes happy once more.. as for the shenanigans involving glorious warlord intel's ixl/iavf, the unmitigated harbinger-of-nation-state-spying acquisition of Mellanox via NVIDIA on our indispensible mlx5 based RNICs, and occasionally observed in the wild Chelsio cxgbe VFs have been ppt-passable for years. Yeah... just no more e1000 please.

EMW


On Fri, Nov 20, 2026, at 03:26, bugzilla-noreply@freebsd.org wrote:
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298073
>
> James Mintram <me@jamesrm.com> changed:
>
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |me@jamesrm.com
>
> --- Comment #2 from James Mintram <me@jamesrm.com> ---
> I've reproduced this issue on a FreeBSD 16.0-CURRENT host
> (main-n291387-2c2007fa3e65) with a FreeBSD 15.1 guest using bhyve's e1000
> emulation and VLAN 110.
>
> I logged out the following:
>
> pktlen=42 hdrlen=42 vlen=4
> e82545: packet too small for writable header
>
> The guest experiences complete packet loss.
>
> The writable-header check appears to include the four bytes reserved for VLAN
> insertion in its input-length requirement, even though those bytes are
> generated by the emulator rather than supplied by the guest.
>
> I've prepared a patch to compare pktlen against hdrlen while retaining hdrlen +
> vlen for the writable-buffer allocation.
>
> I tested this using a FreeBSD guest 15.1 - and was able to repro the error and
> verify the fix.
>
> GitHub PR: https://github.com/freebsd/freebsd-src/pull/2575
>
> -- 
> You are receiving this mail because:
> You are the assignee for the bug.