Intel® Ethernet 800 Series Linux Flow Control
Configuration Guide for RDMA Use Cases
Step 2: Kernel Priority (sk_prio) or DSCP to UP Mapping
Option A: PCP/VLAN PFC: ToS to Kernel Priority Mapping to UP Mapping
Linux automatically maps IP ToS (Type of Service) values to kernel priorities (sk_prio) using a hardcoded function (ip_tos2prio) in net/ipv4/route.c. These kernel priorities are then mapped to User Priorities (UP) used in VLAN tagging and Priority Flow Control (PFC).
Default mappings to set priority values 0, 2 ,4, and 6 are:
For more details, refer to:
http://linux-tc-notes.sourceforge.net/tc/doc/priority.txt
Also, refer to
Linux Source Notes:
PCP Mappings are implemented in the Linux kernel and drivers using
This is how 0, 2, 4, and 6 priority values occur.
In order to use other priority values (i.e., 1, 3, 5, 7), a VLAN is required to be set up using the egress-qos-map option. For example to map all priority 0 as priority 3:
Option B: DSCP to UP Mapping
DSCP mapping is implemented in the Linux kernel and drivers using ToS to DSCP direct mapping. Note that ToS is deprecated in favor of DSCP. The two low-order bits are used for ECN, while the upper six bits are used for the DSCP value (the priority). DSCP uses the upper 6 bits of the 8-bit ToS field, allowing up to 64 code points. DSCP values are effectively 4x the PCP ToS values. DSCP to UP translation table has 64 entries and provides a translation from every one of 64 DSCP values to a 3-bit UP value.
The following table shows the commonly used DSCP Values and their priority values.
| DSCP Value | Decimal Value | ToS (4 x DSCP) | UP |
|---|---|---|---|
| 000 000 | 0 | 0 | 0 |
| 001 000 | 8 | 32 | 1 |
| 010 000 | 16 | 64 | 2 |
| 010 100 | 20 | 80 | 2 |
| 011 000 | 24 | 96 | 3 |
| 011 010 | 26 | 104 | 3 |
| 100 000 | 32 | 128 | 4 |
| 100 110 | 38 | 152 | 4 |
| 101 000 | 40 | 160 | 5 |
| 101 110 | 46 | 184 | 5 |
| 110 000 | 48 | 192 | 6 |
| 111 000 | 56 | 224 | 7 |