HomeFreeBSD

epair: add VLAN_HWTAGGING

Description

epair: add VLAN_HWTAGGING

Add capability VLAN_HWTAGGING to the epair interface and enable it by
default.
When sending a packet over a VLAN interface that uses an epair
interface, the flag M_VLANTAG and the ether_vtag (which contains the
VLAN ID and/or PCP) are set in the mbuf to inform the hardware that
the VLAN header has to be added. The sending epair end does not need
to actually add a VLAN header. It can just pass the mbuf with this
setting to the other epair end, which receives the packet. The
receiving epair end can just pass the mbuf with this setting to the
upper layer. Due to this setting, the upper layer believes that there
was a VLAN header that has been removed by the interface.
If the packet later leaves the host, the outgoing physical interface
can add the VLAN header in hardware if it supports VLAN_HWTAGGING.
If not, the implementation of Ethernet or bridge adds the VLAN header
in software.

Reviewed by: zlei, tuexen
Differential Revision: https://reviews.freebsd.org/D52465
Event: Wiesbaden Hackathon 2026

(cherry picked from commit 574d46b25ab6f42ad97017bb8b72520e9539e36f)

Details

Provenance
timo.voelker_fh-muenster.deAuthored on Jan 30 2026, 10:54 AM
tuexenCommitted on Apr 26 2026, 7:45 AM
Reviewer
zlei
Differential Revision
D52465: epair: add VLAN_HWTAGGING
Parents
rGbba71b3f7c15: ip: improve deferred computation of checksums
Branches
Unknown
Tags
Unknown