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
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D52465

Details

Provenance
timo.voelker_fh-muenster.deAuthored on Jan 30 2026, 10:54 AM
tuexenCommitted on Jan 30 2026, 10:54 AM
Reviewer
zlei
Differential Revision
D52465: epair: add VLAN_HWTAGGING
Parents
rG33596d92555e: dpaa2: add support for several interface counters
Branches
Unknown
Tags
Unknown