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-commandsset,show,mapandunmapin full.Color=takesGreen,YelloworRed. The built-in help writesPrio=, and that works; the shortest form ispr=.show, andmaporunmapwith a parameter missing, are read-only. Everything else changes the port’s priority and colour tables behind SONiC’s back (SONiC programs them fromDOT1P_TO_TC_MAPand 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, andNo CFIandCFIlines. Read-only. A SONiC switch without colour configuration shows every priority andNo CFIasGreenandCFIasRed.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,CFIandIntPrioall given, set one ingress mapping (changes the ASIC). Otherwise print all 16 mappings asPacket 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