COLOR

Manage packet color

COLOR

Manage the colour (green, yellow, red) that a port assigns to incoming packets, by 802.1p priority or by the CFI/DEI bit. It also manages the (packet priority, CFI) → (internal priority, colour) map, and the reverse map used on egress (unmap). Type the sub-commands set, show, map and unmap in full. Color= takes Green, Yellow or Red. The built-in help writes Prio=, and that works; the shortest form is pr=.

show, and map or unmap with a parameter missing, are read-only. Everything else changes the port’s priority and colour tables behind SONiC’s back (SONiC programs them from DOT1P_TO_TC_MAP and related QoS maps).

color show Port=<port>

Print the colour for each priority (0–7) and for CFI 0 and 1: a Color settings for port <name> header, Priority <n> lines, and No CFI and CFI lines. Read-only. A SONiC switch without colour configuration shows every priority and No CFI as Green and CFI as Red.

Hardware-validated

drivshell> color show port=ce0
Color settings for port ce0
Priority 0        Green
Priority 1        Green
Priority 2        Green
Priority 3        Green
Priority 4        Green
Priority 5        Green
Priority 6        Green
Priority 7        Green
No CFI            Green
CFI               Red
color set Port=<port> [PRio=<prio>] [CFI=<cfi>] Color=<Green|Yellow|Red>

Give a priority, or a CFI value, a colour. With neither, the shell prints No parameter to assign color. Changes the ASIC.

Unvalidated

drivshell> color set port=ce0 prio=1 color=yellow
color map Port=<port> [PktPrio=<prio> CFI=<cfi> IntPrio=<prio> Color=<Green|Yellow|Red>]

With PktPrio, CFI and IntPrio all given, set one ingress mapping (changes the ASIC). Otherwise print all 16 mappings as Packet Prio=<p>, CFI=<c>, Internal Prio=<i>, Color=<color>.

Unvalidated — Show the whole map of ce0 (read-only)

drivshell> color map port=ce0
color unmap Port=<port> [IntPrio=<prio> Color=<Green|Yellow|Red> PktPrio=<prio> CFI=<cfi>]

The egress direction: (internal priority, colour) → (packet priority, CFI). With all values given it sets one mapping (changes the ASIC). Otherwise it prints the table as Internal Prio=<i>, Color=<color>, Packet Prio=<p>, CFI=<c>.

Unvalidated

drivshell> color unmap port=ce0

Built-in help

Usages:
      color set Port=<port> Prio=<prio> CFI=<cfi>
            Color=<Green|Yellow|Red>
      color show Port=<port>
      color map Port=<port> PktPrio=<prio> CFI=<cfi>
            IntPrio=<prio> Color=<Green|Yellow|Red>
      color unmap Port=<port> IntPrio=<prio> Color=<Green|Yellow|Red>
            PktPrio=<prio> CFI=<cfi>

Further reading

交换芯片Helix4 L2 L3功能验证.