Skip to content
Roi Dayan edited this page Feb 16, 2017 · 2 revisions

OVS Offloads

Setting up SR-IOV on ConnectX-4/Lx

Turn on SR-IOV on the PF device

# echo 2 > /sys/class/net/enp4s0f0/device/sriov_numvfs

Verify the VF MAC addresses were provisioned correctly

# cat /sys/class/net/enp4s0f0/device/sriov_numvfs
2

# ip link show dev enp4s0f0
256: enp4s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master ovs-system
state UP mode DEFAULT group default qlen 1000
    link/ether e4:1d:2d:60:95:a0 brd ff:ff:ff:ff:ff:ff
    vf 0 MAC e4:11:22:33:44:50, spoof checking off, link-state auto
    vf 1 MAC e4:11:22:33:44:51, spoof checking off, link-state auto

Unbind VFs

echo 0000:04:00.2 > /sys/bus/pci/drivers/mlx5_core/unbind
echo 0000:04:00.3 > /sys/bus/pci/drivers/mlx5_core/unbind

Change mode to switchdev on the PF device

This will also create the VF representor netdevices in the host OS

# devlink dev eswitch set pci/0000:04:00.0 mode switchdev

Change e-switch inline-mode

# devlink dev eswitch set pci/0000:04:00.0 inline-mode transport

Enable TC rule offload in the driver

# ethtool -K enp4s0f0 hw-tc-offload on
# ethtool -K enp4s0f0_0 hw-tc-offload on
# ethtool -K enp4s0f0_1 hw-tc-offload on

Make sure to bring up the PF and representor netdevices

# ip link set dev enp4s0f0 up
# ip link set dev enp4s0f0_0 up
# ip link set dev enp4s0f0_1 up

Enable hardware offload in OVS

# ovs-vsctl set Open_vSwitch . other_config:hw-offload=true
Clone this wiki locally