SMFS and DMFS in Hardware Offloading
SMFS and DMFS in Hardware Offloading
switchdev (ethernet switch device driver model)
The Ethernet switch device driver model (switchdev) is an in-kernel driver model for switch devices which offload the forwarding (data) plane from the kernel.
Configuration
- Use “depends NET_SWITCHDEV” in driver’s Kconfig to ensure switchdev model support is built for driver.
- use
devlink
tool to setup switch modedevlink dev eswitch set pci/$PF_PCI mode switchdev
switchdev Performance Tuning
OVS Offload Using ASAP2 Direct
SwitchDev proformance can be furtuer improved by tuning it.
Steering Mode
OVS-kernel supports two steering modes for rules insertion into hardware.
- SMFS – Software Managed Flow Steering (as of MLNX_OFED v5.1, this is the default mode)
Rules are inserted directly to the hardrware by the software (driver). This mode is optimized for rules insertion. - DMFS – Device Managed Flow Steering
Rules insertion is done using firmware commands. This mode is optimized for throughput with a small amount of rules in the system.
Configuration
The mode can be controlled via sysfs or devlink API in kernels that support it:
Sysfs:
# echo smfs > /sys/class/net/<PF netdev>/compat/devlink/steering_mode
Devlink:
# devlink dev param set pci/0000:00:08.0 name flow_steering_mode value "smfs" cmode runtime
Replace smfs param with dmfs for device managed flow steering
Notes
- SMFS and DMFS mode should be set before moving the device to “switchdev” mode.
- Only when moving to SwitchDev will the driver use the mode set by the previous step.
- Steering mode cannot be changed after moving to “switchdev” mode
- Steering mode can only be applicable for “switchdev” mode only, which means no effects to legacy SR-IOV or other configurations.