Priority Flow Control (PFC)
Priority Flow Control (PFC) IEEE 802.1Qbb applies pause functionality to specific classes of traffic on the Ethernet link. For example, PFC can provide lossless service for the RoCE traffic and best-effort service for the standard Ethernet traffic. PFC can provide different levels of service to specific classes of Ethernet traffic (using IEEE 802.1p traffic classes).
Configuring PFC on ConnectX-4 and above
Enable PFC on the desired priority:
Create a VLAN interface:
- Set egress mapping:
For Ethernet traffic:
Example (skprio=3, up=5):
Create 8 Traffic Classes (TCs):
- Enable PFC on the switch.
For information on how to enable PFC on your respective switch, please refer to Switch FC/PFC Configuration sections in the RDMA/RoCE Solutions Community page.
PFC Configuration Using LLDP DCBX
PFC Configuration on Hosts
PFC Auto-Configuration Using LLDP Tool in the OS
Start lldpad daemon on host.
Send lldpad packets to the switch.
- Set the PFC parameters.
For the CEE protocol, use dcbtool:
[pfcup:xxxxxxxx] Enables/disables priority flow control. From left to right (priorities 0-7) - x can be equal to either 0 or 1. 1 indicates that the priority is configured to transmit priority pause.
For IEEE protocol, use lldptool:
enabled Displays or sets the priorities with PFC enabled. The set attribute takes a comma-separated list of priorities to enable, or the string none to disable all priorities.
PFC Auto-Configuration Using LLDP in the Firmware (for mlx5 driver)
There are two ways to configure PFC and ETS on the server:
- Local Configuration - Configuring each server manually.
- Remote Configuration - Configuring PFC and ETS on the switch, after which the switch will pass the configuration to the server using LLDP DCBX TLVs.
There are two ways to implement the remote configuration using mlx5 driver:
- Configuring the adapter firmware to enable DCBX.
- Configuring the host to enable DCBX.
For further information on how to auto-configure PFC using LLDP in the firmware, refer to the HowTo Auto-Config PFC and ETS on ConnectX-4 via LLDP DCBX Community post.
PFC Configuration on Switches
In order to enable DCBX, LLDP should first be enabled:
Add DCBX to the list of supported TLVs per required interface.
For IEEE DCBX:
For CEE DCBX:
[Optional] Application Priority can be configured on the switch, with the required ethertype and priority. For example, IP packet, priority 1:
- Make sure PFC is enabled on the host (for enabling PFC on the host, refer to PFC Configuration on Hosts section above). Once it is enabled, it will be passed in the LLDP TLVs.
Enable PFC with the desired priority on the Ethernet port.
Example - Enabling PFC with priority 3 on port 1/1:
Several ingress and egress counters per priority are supported. Run ethtool -S to get the full list of port counters.
- Rx and Tx Counters:
- Pause frames
- Pause Duration
- Pause Transition
Note: The Pause counters in ConnectX-4 are visible via ethtool only for priorities on which PFC is enabled.
PFC Storm Prevention
PFC storm prevention enables toggling between default and auto modes.
The stall prevention timeout is configured to 8 seconds by default. Auto mode sets the stall prevention timeout to be 100 msec.
The feature can be controlled using sysfs in the following directory: /sys/class/net/eth*/settings/ pfc_stall_prevention
To query the PFC stall prevention mode:
To configure the PFC stall prevention mode:
The following two counters were added to the ethtool -S:
tx_Pause_storm_warning_events- when the device is stalled for a period longer than a pre-configured watermark, the counter increases, allowing the debug utility an insight into current device status.
tx_pause_storm_error_events- when the device is stalled for a period longer than a pre-configured timeout, the pause transmission is disabled, and the counter increase.
Dropless Receive Queue (RQ)
Dropless RQ feature enables the driver to notify the FW when SW receive queues are overloaded. This scenario takes place when the handling of SW receive queue is slower than the handling of the HW receive queues.
When this feature is enabled, a packet that is received while the receive queue is full will not be immediately dropped. The FW will accumulate these packets assuming posting of new WQEs will resume shortly. If received WQEs are not posted after a certain period of time, out_of_buffer counter will increase, indicating that the packet has been dropped.
This feature is disabled by default. In order to activate it, ensure that Flow Control feature is also enabled.
To enable the feature, run:
To get the feature state, run:
To disable the feature, run: