This post provides a configuration example for Mellanox devices installed with MLNX_OFED running RoCE over a lossy network, in DSCP-based QoS mode.
- QoS parameters are set on QP creation. When working with RDMA-CM it is possible to set QoS parameters for RDMA-CM created QPs
- Some of the configuration steps below can either be done permanently or temporarily (can be kept for the next boot).
For permanent configuration after running mlxconfig, a device reset (mlxfwreset) or host reboot is required.
Step 1 - set QoS parameters
Set DSCP (L3) as trust mode for the NIC
# mlnx_qos -i <interface> --trust dscp
[Optional] Set ToS to 106 (DSCP 26) for ALL RoCE traffic (Note: This command is nonpersistent)
# echo 106 > /sys/class/infiniband/<mlx-device>/tc/1/traffic_class
[Optional] Set the RDMA-CM ToS to 106 (DSCP 26) (Note: This command is nonpersistent)
# cma_roce_tos -d <mlx-device> -t 106
[Optional] Enable ECN for TCP traffic (Note: This command is nonpersistent)
# sysctl -w net.ipv4.tcp_ecn=1
<interface> refers to parent interface (for example ens2f0)
<vlan-interface> refers to vlan interface (for example ens2f0.100)
<mst-device> refers to MST device. (for example /dev/mst/mt4115_pciconf0)
<mlx-device> refers to mlx device (for example mlx5_0)