DCB QoS Classification
The Linux dcb tool from iproute2 provides the standard upstream interface for
configuring Data Center Bridging QoS classification. It controls how ingress
frames are mapped to internal priority queues based on PCP (802.1p), DSCP, or a
default priority.
This is the upstream-compatible alternative to the proprietary qos tool
documented on the Basic QoS page.
1. Platform Support
| Feature | Sparx5 | LAN966x | LAN969x | LAN9645x |
|---|---|---|---|---|
|
✔ |
✔ |
✔ |
✔ |
|
✔ |
✔ |
✔ |
✔ |
|
✔ |
✔ |
✔ |
· |
|
· |
· |
· |
✔ |
2. Limitations Compared to the qos Tool
The dcb tool uses the standard Linux DCB framework which is limited to 8
internal priorities (0-7). The hardware supports 16 traffic classes (8
priorities × 2 drop precedence levels). This means:
-
The
dcbPCP-to-priority mapping is lossy: frames with different DEI values can be mapped to the same internal priority, but the hardware drop precedence distinction is lost. Theqostool can map PCP+DEI to the full 16 traffic classes. -
Egress PCP/DEI rewriting via
dcb rewrsupports mapping internal priority to PCP, but cannot independently control DEI based on drop precedence. Theqostool supports additional egress rewriting modes (e.g., classified PCP/DEI, mapped, port default) that are not available throughdcb.
For applications that require full DPL-aware classification or advanced egress rewriting, use the qos tool instead.
3. App Trust
The dcb apptrust command controls which packet fields are trusted for priority
classification on ingress. By default, no fields are trusted and all frames use
the port default priority.
Trust PCP (VLAN priority) on a port:
$ dcb apptrust set dev eth0 order pcp
Trust DSCP (IP header) on a port:
$ dcb apptrust set dev eth0 order dscp
Disable all trust (use default priority only):
$ dcb apptrust set dev eth0 order
4. Default Priority
The default priority applies to all frames that do not match a trusted field.
Set the default priority to 4:
$ dcb app replace dev eth0 default-prio 4
Reset to default (priority 0):
$ dcb app replace dev eth0 default-prio 0
Show the current default priority:
$ dcb -j app show dev eth0 default-prio
5. PCP-to-Priority Mapping
When PCP trust is enabled, the pcp-prio mapping controls how the 802.1p PCP
and DEI fields are mapped to internal priorities.
The mapping format uses <PCP><DEI_FLAG>:<PRIORITY> where:
-
nd= no DEI (DEI=0) -
de= DEI set (DEI=1)
Configure a custom PCP-to-priority mapping (reverse order for DEI=0):
$ dcb app replace dev eth0 pcp-prio \
0nd:7 1nd:6 2nd:5 3nd:4 4nd:3 5nd:2 6nd:1 7nd:0 \
0de:0 1de:1 2de:2 3de:3 4de:4 5de:5 6de:6 7de:7
Restore the identity mapping (default):
$ dcb app replace dev eth0 pcp-prio \
0nd:0 1nd:1 2nd:2 3nd:3 4nd:4 5nd:5 6nd:6 7nd:7 \
0de:0 1de:1 2de:2 3de:3 4de:4 5de:5 6de:6 7de:7
6. DSCP-to-Priority Mapping
When DSCP trust is enabled, the dscp-prio mapping controls how the 6-bit DSCP
field in the IP header is mapped to internal priorities.
Map DSCP 32 to priority 4:
$ dcb app add dev eth0 dscp-prio 32:4
Remove the mapping:
$ dcb app del dev eth0 dscp-prio 32:4
Without explicit DSCP mappings, all DSCP values map to the default priority.
7. Egress Priority Rewriting (dcb rewr)
Egress rewriting via dcb rewr is supported on Sparx5 and LAN966x only.
LAN9645x does not support dcb rewr.
|
The dcb rewr command controls how the internal priority is mapped back to
PCP/DEI values in egress VLAN tags.
Set a priority-to-PCP mapping for egress:
$ dcb rewr set dev eth0 prio-pcp \
0:0nd 1:1nd 2:2nd 3:3nd 4:4nd 5:5nd 6:6nd 7:7nd
Show the current rewrite mapping:
$ dcb rewr show dev eth0 prio-pcp