User Manual

Rev 2.1-1.0.6
Mellanox Technologies
103
4.13.7.3 Ethernet Virtual Function Configuration when Running SR-IOV
4.13.7.3.1VLAN Guest Tagging (VGT) and VLAN Switch Tagging (VST)
When running ETH ports on VGT, the ports may be configured to simply pass through packets as
is from VFs (Vlan Guest Tagging), or the administrator may configure the Hypervisor to silently
force packets to be associated with a VLan/Qos (Vlan Switch Tagging).
In the latter case, untagged or priority-tagged outgoing packets from the guest will have the
VLAN tag inserted, and incoming packets will have the VLAN tag removed. Any vlan-tagged
packets sent by the VF are silently dropped. The default behavior is VGT.
The feature may be controlled on the Hypervisor from userspace via iprout2 / netlink:
use:
where
NUM = 0..max-vf-num
vlan_id = 0..4095 (4095 means "set VGT")
qos =
0..7
For example:
ip link set dev eth2 vf 2 qos 3 - sets VST mode for VF #2 belonging to PF eth2,
with qos = 3
ip link set dev eth2 vf 2 4095 - sets mode for VF 2 back to VGT
4.13.7.3.2Additional Ethernet VF Configuration Options
Guest MAC configuration
By default, guest MAC addresses are configured to be all zeroes. In the mlnx_ofed guest driver,
if a guest sees a zero MAC, it generates a random MAC address for itself. If the administrator wishes
the guest to always start up with the same MAC, he/she should configure guest MACs before the
guest driver comes up.
The guest MAC may be configured by using:
For legacy guests, which do not generate random MACs, the adminstrator should always configure
their MAC addresses via ip link, as above.
Spoof checking
Spoof checking is currently available only on upstream kernels newer than 3.1.
4.13.7.3.3RoCE Support
RoCE is supported on Virtual Functions and VLANs may be used with it. For RoCE, the hyper-
visor GID table size is of 16 entries while the VFs share the remaining 112 entries. When the
ip link set { dev DEVICE | group DEVGROUP } [ { up | down } ]
...
[ vf NUM [ mac LLADDR ]
[ vlan VLANID [ qos VLAN-QOS ] ]
...
[ spoofchk { on | off} ] ]
...
ip link set dev <PF device> vf <NUM> vlan <vlan_id> [qos <qos>]
ip link set dev <PF device> vf <NUM> mac <LLADDR>
ip link set dev <PF device> vf <NUM> spoofchk [on | off]