Q-in-Q Tunneling
Q-in-Q tunneling (hardware-accelerated 802.1ad VLAN) enables the creation of a Layer 2 Ethernet connection between two servers. It allows segregation of different VLAN traffic on a link or bundling multiple VLANs into a single VLAN. This is achieved by adding a service VLAN tag before the user’s existing 802.1Q VLAN tags.
For details on Q-in-Q support in virtualized environments (SR-IOV), refer to "Q-in-Q Encapsulation per VF in Linux".
To enable device support for accelerated 802.1ad VLAN:
Turn on the new ethtool private flag
phv-bit(disabled by default).$ ethtool --set-priv-flags eth1 phv-bit on
Enabling this flag sets the
phv_enport capability.Change the interface device features by turning on the ethtool device feature
tx-vlan-stag-hw-insert(disabled by default).$ ethtool -K eth1 tx-vlan-stag-hw-insert on
Once the private flag and the ethtool device feature are set, the device will be ready for 802.1ad VLAN acceleration.
NoteThe
phv-bitprivate flag setting is available for the PF only. The VF can use the VLAN acceleration by setting thetx-vlan-stag-hw-insertparameter only if the private flagphv-bitis enabled by the PF. If the PF enables/disables thephv-bitflag after the VF driver is up, the configuration will take place only after the VF driver is restarted.