CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected]    2025/11/01 04:04:49

Modified files:
        sys/net        : if_bpe.c if_etherbridge.c if_etherbridge.h 
                         if_gre.c if_veb.c if_vxlan.c 

Log message:
make veb a vlan aware bridge.

veb now knows how to handle vlan tags on the wire like vlan(4) does.
vlan(4) still gets first pass at packets and vlan identifiers before
veb has it's chance to look at them though.

the etherbridge code is extended so entries have a vlan identifier
added to them. other users of the etherbridge code (bpe, nvgre,
vxlan) hardcode this vid to 0.

ports in veb(4) now have a pvid (port vlan identifier) used to
determine which vlan untagged packets get associated with, and a
bitmap of allows vids (vlan ids) that say what vlans tagged traffic
can interact with. ports can be configured as "access" ports by
only configuring a pvid but with no entries in the vid map, or as
a "trunk" by disabling the pvid and adding entries to the vid map,
or a "hybrid" port by configuring both a pvid and entries in the
vid map.

veb(4) associates all packets it handles with a vlan identifier,
ether by mapping untagged packets to the pvid on the relevant port,
or by using the id from tagged packets (subject to filtering by the
vid map). the vlan tag is then used to scope the forwarding database
(address cache) entries. this allows the same mac address to exist
in different vlans with different ports as the destination for
packets to those addresses.

to maintain compatibility with existing (simple) setups, veb defaults
to using pvid 1 on ports added to the bridge. this default pvid for
ports to inherit can be motified setting the vnetid on veb itself.
the vnetid can be cleared on the veb interface to have new ports
added without any pvid or vid map entries until they're configured
otherwise.

Reply via email to