PFC (Priority Flow Control) Watchdog

Design Notes

PFC watchdog is designed to detect and mitigate PFC storm received for each port. PFC pause frames is used in lossless Ethernet to pause the link partner from sending packets. Such back-pressure mechanism could propagate to the whole network and cause the network stop forwarding traffic. PFC watchdog is to detect abnormal back-pressure caused by receiving excessive PFC pause frames, and mitigate such situation by disable PFC caused pause temporarily. PFC watchdog has three function blocks, i.e. detection, mitigation and restoration.

The PFC storm detection is for a switch to detect if a lossless queue is receiving a PFC storm from its link partner and is in a paused state over T0 time. T0 is a port-level parameter. T0 should be on a scale of hundreds of milliseconds.

The PFC storm mitigation acts when a storm is detected on a queue. The watchdog can have two actions, drop and forward, on a queue level.

The watchdog should continue to count the PFC frames received on the queue. If no PFC frame is received over the T1 period, then the PFC storm restoration re-enables the PFC on the queue and stops dropping packets if the mitigation action was “drop.” T1 is a port-level parameter. T1 should be on a scale of hundreds of milliseconds.

Example model & SONiC version:

  • Aurora 830, Aurora 721, Aurora 621, Aurora 221
  • Netberg SONiC: sonic-broadcom-202311-n0

Restrictions:

  • Aurora 221 does not support PFC.

PFC Watchdog Commands

config pfcwd start <arguments>

This command starts PFC Watchdog. To config all ports, use all as input.

Syntax:

config pfcwd start [OPTIONS] [PORTS]... DETECTION_TIME

Options:

-a, --action [drop|forward|alert]
-r, --restoration-time INTEGER RANGE
--verbose - Enable verbose output

Usage:

Enable PFC watchdog on all ports:

admin@sonic:~$ sudo config pfcwd start --action drop all 400 --restoration-time 400

Enable PFC watchdog on ports Ethernet0 and Ethernet8:

admin@sonic:~$ sudo config pfcwd start --action forward Ethernet0 Ethernet8 400
restoration time not defined; default to 2 times detection time: 800 ms

config pfcwd stop

This command stops PFC Watchdog.

Usage:

config pfcwd stop

config pfcwd interval <interval_in_ms>

This command sets PFC Watchdog counter polling interval (in ms).

Usage:

config pfcwd interval 200

config pfcwd counter_poll <enable/disable>

This command enables or disables PFCWD-related counters polling.

Usage:

config pfcwd counter_poll disable

config pfcwd big_red_switch <enable/disable>

This command enables or disables PFCWD’s “BIG RED SWITCH”(BRS). After enabling BRS, the PFC Watchdog will be activated on all ports/queues where PFC is configured, regardless of whether the storm was detected.

Usage:

config pfcwd big_red_switch enable

config pfcwd start_default

This command starts PFC Watchdog with the default settings.

Usage:

config pfcwd start_default

This command doens’t work in SONiC 202311 and earlier releases.

show pfcwd config

This command shows current PFC Watchdog configuration

Usage:

admin@sonic:~$ show pfcwd config
BIG_RED_SWITCH status is disable
     PORT    ACTION    DETECTION TIME    RESTORATION TIME
---------  --------  ----------------  ------------------
Ethernet0   forward               400                 800
Ethernet8   forward               400                 800

show pfcwd stats

This command shows current PFC Watchdog statistics (storms detected, packets dropped, etc)

Usage:

admin@sonic:~$ show pfcwd stats
       QUEUE       STATUS    STORM DETECTED/RESTORED    TX OK/DROP    RX OK/DROP    TX LAST OK/DROP    RX LAST OK/DROP
------------  -----------  -------------------------  ------------  ------------  -----------------  -----------------
 Ethernet0:3  operational                        1/1           0/0           0/0                0/0                0/0
 Ethernet0:4  operational                        1/1           0/0           0/0                0/0                0/0
 Ethernet1:3  operational                        1/1           0/0           0/0                0/0                0/0
 Ethernet1:4  operational                        1/1           0/0           0/0                0/0                0/0
 Ethernet2:3  operational                        1/1           0/0           0/0                0/0                0/0
 Ethernet2:4  operational                        1/1           0/0           0/0                0/0                0/0

If BRS is enabled:

admin@nba621-1:~$ show pfcwd stats
       QUEUE    STATUS    STORM DETECTED/RESTORED    TX OK/DROP    RX OK/DROP    TX LAST OK/DROP    RX LAST OK/DROP
------------  --------  -------------------------  ------------  ------------  -----------------  -----------------
 Ethernet0:3   stormed                        2/1           0/0           0/0                0/0                0/0
 Ethernet0:4   stormed                        2/1           0/0           0/0                0/0                0/0
 Ethernet1:3   stormed                        2/1           0/0           0/0                0/0                0/0
 Ethernet1:4   stormed                        2/1           0/0           0/0                0/0                0/0
 Ethernet2:3   stormed                        2/1           0/0           0/0                0/0                0/0
 Ethernet2:4   stormed                        2/1           0/0           0/0                0/0                0/0
NEWS

Latest news