Intel® Ethernet 800 Series Linux Flow Control

Configuration Guide for RDMA Use Cases

ID 635330
Date 07/13/2023
Version 1.3
Document Table of Contents

Step 2: Kernel Priority (sk_prio) or DSCP to UP Mapping

Option A: PCP/VLAN PFC: ToS to Kernel Priority Mapping to UP Mapping

The ToS value automatically maps to Linux kernel priorities (hard coded in Linux based on ip_​tos2prio in net/ipv4/route.c).

Mappings to set priority values 0, 2 ,4, and 6 are:

ToS 0 --> sk_prio 0 --> UP 0 ToS 8 --> sk_prio 2 --> UP 2 ToS 24 --> sk_prio 4 --> UP 4 ToS 16 --> sk_prio 6 --> UP 6

For more details, refer to:

http://linux-tc-notes.sourceforge.net/tc/doc/priority.txt

Also, refer to man tc-prio. Although tc-prio is about Linux traffic control (note that the 800 Series cannot use this for RDMA traffic), the chart with ToS and Linux Priority lists the hard-coded values.

Linux Source Notes:

PCP Mappings are implemented in the Linux kernel and drivers using rt_​tos2priority. For example, prio = rt_​tos2priority(tos) (from drivers/infiniband/core/cma.c).

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:

# ip link add link <ifname> name <vlan-ifname> type vlan id <vlan-id> egress-qos-map 0:3 1:0 2:0 3:0 4:0 5:0 6:0 7:0 Notes:
  • The UP value is the priority referenced in the PFC.
  • Competing technologies might use mqprio qdisc (see man tc-mqprio) to adjust this mapping, but the 800 Series implementation does not.
  • The 800 Series ADQ feature uses mqprio to direct traffic. ADQ and PFC cannot be used at the same time.

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 marking uses 6 bits of the 8-bit TOS field in the IPv4 Header to provide up to 64 classes (or code points) for traffic, thus the value for the DSCP field is four times the value of PCP ToS. 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