i think my FreeBSD bridge(4) changes are now mostly complete: https://github.com/freebsd/freebsd-src/compare/main...llfw:freebsd-src:lf/dev/bridge-1q
summary:
- an interface's PVID can be set using 'ifconfig bridge0 ifpvid ix0 20'; any pvid other than 0 enables VLAN filtering.
- an interface's port type can be set using 'ifconfig bridge0 iftype ix0 <access|trunk|hybrid>'; the default is hybrid.
- the port's allowed VLAN list for trunk/hybrid ports can be set using ‘ifconfig bridge0 +ifvlans ix0 10,20,30,200-399', or '-ifvlans' to remove
- .1q tags are added on incoming frames and stripped on outgoing frames based on port PVID
- you can create an SVI on a bridge using 'ifconfig vlan20 create vlan 20 vlandev bridge0’ (or just 'ifconfig bridge0.20 create’)
- in theory this lets us do standards-based RSTP (rather than PVST) but i haven't tested that at all
this needs a *lot* of testing and review; i'm sure there are bugs and unhandled edge cases. my plan is to divide it into smaller chunks and submit those one at a time; so far, that's the ifconfig ifpvid option.
[edited to remove the link to a specific commit which is no longer valid]