User Manual

Rev 2.1-1.0.6
Mellanox Technologies
67
1. The application sets the ToS of the socket using setsockopt (IP_TOS, value).
2. ToS is translated into the
sk_prio using a fixed translation:
TOS 0 <=> sk_prio 0
TOS 8 <=> sk_prio 2
TOS 24 <=> sk_prio 4
TOS 16 <=> sk_prio 6
3. The Socket Priority is mapped to the UP:
If the underlying device is a VLAN device,
egress_map is used controlled by the vconfig
command. This is per VLAN mapping.
If the underlying device is not a VLAN device, the
tc command is used. In this case, even
though
tc manual states that the mapping is from the sk_prio to the TC number, the
mlx4_en driver interprets this as a sk_prio to UP mapping.
Mapping the sk_prio to the UP is done by using
tc_wrap.py -i <dev name> -u
0,1,2,3,4,5,6,7
4. The the UP is mapped to the TC as configured by the mlnx_qos tool or by the lldpad daemon
if DCBX is used.
Socket applications can use setsockopt (SK_PRIO, value) to directly set the sk_prio
of the socket. In this case the ToS to sk_prio fixed mapping is not needed. This allows
the application and the administrator to utilize more than the 4 values possible via ToS.
4.5.4 RoCE Quality of Service Mapping
Applications use RDMA-CM API to create and use QPs.
The following is the RoCE QoS mapping flow:
1. The application sets the ToS of the QP using the
rdma_set_option option
(
RDMA_OPTION_ID_TOS, value).
2. ToS is translated into the Socket Priority (
sk_prio) using a fixed translation:
TOS 0 <=> sk_prio 0
TOS 8 <=> sk_prio 2
TOS 24 <=> sk_prio 4
TOS 16 <=> sk_prio 6
3. The Socket Priority is mapped to the User Priority (UP) using the tc command.
In case of a VLAN device, the parent real device is used for the purpose of this mapping.
In case of VLAN interface, the UP obtained according to the above mapping is also used
in the VLAN tag of the traffic