Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

DCQCN configuration for RDMA Traffic on NICs

Broadcom BCM57608 Thor2 DCQCN configuration for RDMA Traffic

Default DCQN-ECN/PFC attributes in AMD servers.

The network interface adapters are configured with the following Class of Service (including DCQCN-ECN) parameters for RoCE traffic:

For Thor2 NIC adapter:

  • RoCEv2 (RDMA over IPv4) enabled
  • Congestion Control (ECN) and PFC enabled
  • RoCE traffic tagged with DSCP 26 on PRIORITY 3
  • RoCE CNP traffic tagged with DSCP 48 and PRIORITY 7

Mapping Broadcom and Logical Interface Names to Configure DCQN-ECN/PFC and TOS/DSCP for RDMA Traffic Attributes in AMD Servers

DCQCN ECN, PFC and traffic marking need to be configured on the interfaces connected to the GPU backend; that is on the gpu#_eth (#=0-7) interfaces only.

On the section Changing NIC attributes section of these document, we determined that the gpu#_eth interfaces in our servers, are Broadcom BCM97608 (shown below) NICs.

All the steps for configuring Class of Service in this section will be focused on these Broadcom interfaces.

We will be using a combination of Linux system commands and Broadcom tools to enable, tune and monitor DCQCN ECN/PFC operation and RoCE traffic marking. For some of these commands we will need to find the Broadcom interface name associated with each gpu interface. Follow these steps to find these mappings:

  1. Find the PCI address of each gpu#_eth interface using the following logic:

    Example:

  2. Find the bnxt_re# (#=0-7) devices that corresponds to each PCI address using the following logic:

    Example:

  3. MAP the GPU interface bnxt_re# or mlx5_# interface names.

Combine the outputs from steps 1 and 2 to create a full mapping from gpu#_eth to bnxt_re# or mlx5_#. You can see from the outputs that for example gpu0_eth corresponds to bnxt_re3 (0000:66:00.0)

You can use the following logic to simplify the process:

Example:

Configuring DCQN-ECN/PFC and TOS/DSCP for RDMA Traffic attributes in AMD servers (Broadcom interfaces)

Some of the parameters related to DCQN-ECN/PFC and TOS/DSCP are listed in the following table:

Table 15. Server DCQCN configuration parameters

Parameter Description Default
cc_mode

0 for Deterministic Marking (DCQCN-D)

1 for Probabilistic Marking (DCQCN-P)

1
cnp_ecn Enables/disables ECN 0x1 (enabled)
cnp_dscp DSCP value for RoCE congestion notification packets 48
cnp_prio Priority for RoCE congestion notification packets 7
cnp_ratio_th Defines the threshold ratio for generating CNPs. It determines the rate at which CNPs are sent in response to congestion, helping to control the feedback mechanism's aggressiveness. 0x0
ecn_enable Enable congestion control. 0x1 (enabled)
ecn_marking Enables tagging of packets as ECN-enabled. ECN = 01 0x1 (enabled)
default_roce_mode Sets the default RoCE mode for RDMA RoCE v2
default_roce_tos Sets the default ToS value for RDMA traffic 104
roce_dscp DSCP value for RoCE packets. 26
roce_prio Priority for RoCE packets. 3
rtt Time period (µs) over which cnp and transmitted packets counts accumulate. At the end of rtt, the ratio between CNPs and TxPkts is computed, and the CP is updated. 40 μs.

BCM95741X Ethernet network adapters support three transmit and receive queues for each Ethernet port: 0, 4, and 5.

BCM95750X Ethernet network adapters support eight transmit and receive queues for each Ethernet port: 0 through 7.

By default, all queues are configured for weighted-fair-queueing (WFQ), with priority 0 traffic mapped to queue 4.

When the RoCE bnxt_re driver is loaded, CoSQ 0 is configured for lossless traffic, and CoSQ 5 is changed from WFQ to strict priority (SP) for CNP processing.

RoCE and CNP traffic can be tagged with different DSCP values or use VLAN tags instead.

By default, the ToS field is set to 104, which means DSCP is set to 48 and the ECN bits are set to 10 (ECN-enabled).

These parameters can be adjusted using three different methods:

  • Configuring DCQCN/RDMA marking values directly
  • Configuring DCQCN/RDMA marking values using Broadcom tools such as niccli, or lldptool directly
  • Configuring DCQCN/RDMA marking values using the bnxt_setupcc.sh utility, which uses either niccli or lldptool (default) behind the scenes.

The following sections will describe the steps to make changes using these different options.

Note: Ensure all changes are consistent with the configuration of switches within the fabric. Example:

Configuring DCQN-ECN/PFC and TOS/DSCP for RDMA Traffic attributes directly

You can make changes to the DCQCN and traffic marking by directly editing the files that contain the values of each parameter. This method is the easiest, and does not require installation of any additional tools, however, it is not an option for PFC related parameters, nor is it supported on all types of network adapters.

To complete these changes for a specific interface, you must be under in the proper interface directory, following these steps:

  1. Create interface directories for qos related values

    We determined the mappings between the gpu#_eth interfaces and the corresponding Broadcom interface names

    GPU-to-NIC Mapping:

    gpu0_eth => 0000:06:00.0 => bnxt_re0

    gpu1_eth => 0000:23:00.0 => bnxt_re1

    gpu2_eth => 0000:43:00.0 => bnxt_re2

    gpu3_eth => 0000:66:00.0 => bnxt_re3

    gpu4_eth => 0000:86:00.0 => bnxt_re4

    gpu5_eth => 0000:a3:00.0 => bnxt_re5

    gpu6_eth => 0000:c3:00.0 => bnxt_re6

    gpu7_eth => 0000:e6:00.0 => bnxt_re7

    We will use the Broadcom interface names to create the directories (rdma_cm and bnxt_re) where the DCQCN attributes as well as other parameters and statistics will be located for each interface.

    The interface specific directories do not exist until created using the following commands:

    Notice that these two directories must be present.

    If the rdma_cm directory for example is missing, try the following:

    Example:

    Repeat these steps for all the gpu interfaces.

    Note: You must be a root user to make these changes.

    The new directories will contain values pertaining to ECN, ROCE traffic and other functions:

    You can find a description of some of these parameters, as well as their current value using cat apply within the /sys/kernel/config/bnxt_re/bnxt_re0/ports/1/cc# directory.

    Example:

  2. Enable RoCEv2 operation.

    Even though RoCEv2 should be the default mode, the command to enable RoCEv2 is shown here.

    Note: This change is made under the rdma_cm directory
    Note: Enter the value exactly as shown including the space: “RoCE v2” (case sensitive).

    After setting the parameter, apply the new values as follows:

    Verify the changes:

  3. Enable ECN response and notification functions.

    Even though ECN should be enabled by default, the command to enable ECN is shown here.
Note: This change is made under the bnxt_re0 directory.

If needed, you can disable ECN by entering echo -n 0x0 > ecn_enable instead.

When ECN is enabled on the Broadcom interfaces, they will respond to CNP packets (RP) and will generate CNP packets when ECN-marked are received (NP).

To disable it, enter echo -n 0x0 > cnp_ecn instead.

After setting the parameter, apply the new values:

Verify the changes:

You can also enable the marking of both CNP and ROCE packets as ECN-eligible (meaning, these packets can be marked across the network when congestion occurs).

To summarize these attributes:

ecn_enable Enables/Disables the RP (response point) side of ECN. It enables the device to respond to CNP packets. Default = 1 (enable)
cnp_ecn Configures marking CNP packets as ECN-eligible. Either a value of 01 or 10 for ECT field.
ecn_marking Configures marking ROCE packets as ECN-eligible. Either a value of 01 or 10 for ECT field.
  1. Configure the DSCP and PRIO values for CNP and RoCEv2 packets.
    Note: Configuring these values manually, as shown below, is not an option for all types of Broadcom interface cards. For example, for BCM95741X devices you can use this method to configure the ECN, and RoCE priority values but on the BCM95750X/BCM97608 devices you can configure roce_dscp, ecn_dscp. See Broadcom Ethernet Network Adapter Congestion Control Parameters
    Note: These changes are made under the bnxt_re0 directory.
    Note: The following error indicates that changing the value of this parameter directly is not supported. In the case of BCM97608 roce_prio, and cnp_prio need to be configured using bnxt_setupcc.sh (described later).

    After setting the parameter, apply the new values:

    Verify the changes:

  2. Configure the DCQCN algorithm (under the bnxt_re directory).

    The default DCQCN Congestion Control (cc-mode) algorithm in Broadcom Ethernet network adapter is DCQCN-P. The mode can be changed using these commands:

    Note:

    This change is made under the bnxt_re0 directory.

    To use DCQCN-P configure:

    To use DCQCN-D configure:

  3. Check all the attributes that were configured.

The following command shows all the interface parameters:

For more information on the DCQCN algorithm in Broadcom Ethernet network adapter check the following documents: Changing Congestion Control Mode Settings and RoCE Congestion Control

Example:

We have highlighted some ECN/CNP related parameters:

Configuring DCQN-ECN/PFC and TOS/DSCP for RDMA Traffic attributes using niccli

You can make changes to the DCQCN and traffic marking using the NICCLI Configuration Utility.

niccli is a management tool for Broadcom Ethernet network adapters that provides detailed information, including type, status, serial number, and firmware version. It also enables the configuration of interface attributes such as DCQCN-ECN, PFC, and TOS/DSCP for optimizing RDMA traffic.

Note: The niccli tools needs to be installed in your system.

Installing the NICCLI Configuration Utility

You can obtain a summary of the interface adapters and ethernet ports that can be managed with niccli present on the server using niccli listdev, or list-eth as show in the example below.

You can use niccli in either oneline mode, interactive mode, or batch mode. The niccli -h help provides a high level description of these modes. In this section, we will show some examples of how to use the oneline and interactive modes for DCQCN-ECN, PFC, and TOS/DSCP configuration.

Entering niccli with no options allows you to work in the interactive mode, where you select an adapter/interface (by index) and then the proper <command> (e.g. show, get_qos, set_map) to obtain information or make changes to the selected interface.

You can identify the interface index corresponding to each interface using the method described in the Mapping Broadcom interface name with logical interface name section. This will give you the mappings between interfaces and pcie address which you can then correlate with the output of niccli below.

Once identified, enter the interface index (first column in the output) as shown in the example below.

Example:

Entering niccli -i <interface-index> <command> allows you to issue the same commands but including the target interface and then the command, all in one line. The niccli -list command can be used to determine the interface index.

Example:

The sudo niccli help provides an extensive list of commands and options available for both interactive and one-line mode.

Note: We will use the one-line mode for all the examples below to obtain information and make configuration changes.

The following examples show you how to use niccli to obtain information about a specific interface.

  1. Check interface status.

    The niccli -i <interface> show provides details about the interface such as type, MAC address, firmware, serial number, device health, temperature and so on.

    Example:

  2. Check QoS settings

The sudo niccli -i <interface-index> dscp2prio and sudo niccli -i 1 listmap -pri2cos commands show mappings between DSCP and Priority vales, and between priority vales, traffic classes (TC) and the output queues.

The outputs in the example show the defaults for:

  • Queues status. Only queues 0, 1, and 2 are enabled.
  • Priority to DSCP mappings: priority 7 => DSCP 48 & priority 3 => DSCP 26.
  • Priority to TC (traffic class) and queue mappings: priority 7 => TC2 (queue 0) => DSCP 48 & priority 3 => TC1 (queue 5) => DSCP 26.
Note: The output might be confusing, the Queue ID displayed is an internal CoS queue number. This really means queuing of traffic class 0, 1, and 2 are enabled, all other traffic classes are disabled.

The sudo niccli -i <interface-index> get_qos command provides a summary of the QoS configuration on the interface.

Example:

IEEE 802.1Qaz ETS Configuration TLV: shows the Enhanced Transmission Selection (ETS) configuration
PRIO_MAP: 0:0 1:0 2:0 3:1 4:0 5:0 6:0 7:2

Maps priorities to Traffic Classes (TC)

Priority 0, 1, 2, 4, 5, 6 → TC 0

Priority 3 → TC 1

Priority 7 → TC 2

TC Bandwidth: 50% 50% 0%

Allocates bandwidth percentages to traffic classes.

TC 0: 50% of the total bandwidth.

TC 1: 50%.

TC 2: 0%.

TSA_MAP: 0:ets 1:ets 2:strict

Together with TC Bandwidth, TSA_MAP allocates resources and defines service priority for each TC. Equivalent to schedulers & scheduler-map in Junos.

Specifies the Transmission Selection Algorithm (TSA) used for each TC:

TC 0 and TC 1 use ETS (Enhanced Transmission Selection) and share the available bandwidth 50/50

TC 2 uses strict priority, meaning TC 2 traffic will always be sent first

IEEE 802.1Qaz PFC TLV: defines traffic classification using the APP TLV (Type-Length-Value) format
PFC enabled: 3

Indicates that PFC is enabled on priority 3.

Other priorities do not have PFC enabled.

PFC ensures that traffic with this priority can pause instead of being dropped during congestion.

IEEE 802.1Qaz APP TLV

APP#0:

Priority: 7

Sel: 5

DSCP: 48

APP#1:

Priority: 3

Sel: 5

DSCP: 26

APP#2:

Priority: 3

Sel: 3

UDP or DCCP: 4791

Maps traffic to Traffic Classes. Equivalent to multifield classifiers in Junos.

APP#0: Traffic marked with DSCP = 48 is mapped to priority 7

APP#1: Traffic marked with DSCP = 48 is mapped to priority 3

APP#2: UDP or DCCP traffic with port = 4791 (RoCEv2) is mapped to priority 3

TC Rate Limit: 100% 100% 100% 0% 0% 0% 0% 0%

TC 0, TC 1, and TC 2 can use up to 100% of the bandwidth allocated to them.

TC 3 through TC 7 are set to 0%, meaning they are not currently configured to transmit traffic.

If needed, change the priority to traffic class mappings or the applications to traffic class mappings.

We recommend keeping the default settings and making sure they are consistent with the class-of-service configuration on the leaf nodes in the GPU backend fabric.

If there are any requirements to change the priority to traffic class mappings or the applications to traffic class mappings the following commands can be used:

Priority to traffic class mappings

Example:

Applications to traffic class mappings

Example:

If needed, change ETS configuration attributes

We recommend keeping the default settings and making sure they are consistent with the class-of-service configuration on the leaf nodes in the GPU backend fabric.

Example:

If needed, configure PFC

Example:

The following command attempts to enable the pfc on priority 5 and 6 and demonstrates that only one queue (one priority) can be configured as a lossless queue (PFC-enabled).

Configuring DCQCN and RoCE traffic marking values using bnxt_setupcc.sh

Using the bnxt_setupcc.sh utility, which can simplify the process.

The bnxt_setupcc.sh utility simplifies enabling or disabling both ECN and PFC, and changing the values of DSCP and PRIO for both ROCE and CNP packets for a given interface.

Under the hood it uses niccli (default) or lldptool which can be selected as part of the command.

You need to enter bnxt_setupcc.sh followed by your selected options as described in the help menu:

Example:

The default DSCP marking for CNP packets for interface gpu0 (bnxt_re0) is 0 as shown in the output below:

bnxt_setupcc.sh can be used to change it to the value expected by the fabric (48) as follows:

Where:

  • -u 3: Uses Broadcom niccli utility
  • -p 48: Sets the DSCP value for CNP packets to 48 (0x30)
  • -c: Configures the priority for CNP packets to 6
  • -s: Defines the DSCP value for regular RoCE packets to 26 (0x1a)
  • -r: Sets the priority for regular RoCE packets to 5
  • -m 3: Configures both PFC and congestion control (ECN).
Note: Device (-i) is required for the script to complete. Also, you cannot configure only one of the DSCP/PRIO values. You need to configure CNP-DSCP value (-p) , CNP-PRI value (-c), RoCE-DSCP (-s), and RoCE-PRIO (-r) for the command to work.

Verify the results with:

Note: You need to make sure that not only bnxt_setupcc.sh is installed and executable, but also that at least one of the tools (niccli or lldptool) is installed.

The following example shows that bnxt_setupcc.sh and niccli are installed, but lldptool is not. It also shows examples of installing and using the lldptool.

The lldptool is used to check or modify the LLDP (Link Layer Discovery Protocol) settings. To enable LLDP you need to install lldpad, which also installs lldptool automatically.

To install lldpad and lldptool follow these steps:

  1. Install required dependencies.

    Before installing lldpad, ensure that the necessary libraries are installed by running the following command:

    • libconfig9 – A configuration file processing library.
    • libnl-3-200 – A library for interacting with the Linux Netlink interface.
  1. Install lldpad.

    Install lldpad by running the following command:

    This package enables LLDP on the system, allowing it to exchange network topology information with other devices.

  2. Enable lldpad.

    Enable lldp using systemctl:

    This creates a systemd service that ensures lldpad is always running after a reboot.

  3. Start the lldpad service

    Activate lldp using systemctl:

    This activates lldpad immediately, allowing it to process LLDP packets.

    Note: To restart lldpad manually, use: sudo systemctl restart lldpadTo disable lldpad from starting at boot, use: sudo systemctl disable lldpad
  4. Verify the installation

Check the service status using systemctl

This ensures the tool is installed and ready to use. If everything is working properly, you should see an "active (running)" status.

You can use lldptool to enable or disable LLDP on an interface, and to check the LLDP status and the neighbors discovered on that interface. The lldptool -h shows you all the different options:

Check the Installing and Configuring Software Manually section of the Broadcom Ethernet Network Adapter User Guide or Installing the NICCLI Configuration Utility for more details.

Monitor interface and ECN/PFC operation:

Once you have the Broadcom name for a particular gpu as described at the beginning of this section, you can locate the directories where the interface’s operation status, as well as RoCE traffic and Congestion Control statistics are located.

  1. Navigate to the corresponding directory

/sys/class/infiniband/<Broadcom-interface-name>

Example:

For gpu0_eth:

Here you can check attributes such as operational state, address, mtu, speed, and interface statistics (including transmit and received packets, dropped packets, as well as ECN-marked packets, CNP packets received and CNP packets transmitted):

To check ECN statistics, check the related counters for the specific interface:

To check PFC statistics use: ethtool -s <InterfaceIndex> |egrep "pfc_frames|roce_pause" |more

Example:

Configuring the server to use the management interface for RCCL control traffic

ROCm Communication Collectives Library (RCCL) creates TCP sessions to coordinate processes and exchange Queue Pair information for RoCE, GIDs (Global IDs), Local and remote buffer addresses, RDMA keys (RKEYs for memory access permissions)

Note: This traffic is separate from the RoCEv2 traffic (port 4791) and is used for synchronizing model parameters, partial results operations, and so on.

These TCP sessions are created when the job starts and by default use one of the GPU interfaces (same interfaces used for RoCEv2 traffic).

Example:

It is recommended that the management interface connected to the (Frontend Fabric) is used. To achieve this, include the following when starting a job: export NCCL_SOCKET_IFNAME="mgmt_eth". The same environment variable applies to both NCCL and RCCL.

Example:

Note: ECN is enabled by default for these sessions; net.ipv4.tcp_ecn = 1 , but can be disable with: sudo sysctl -w net.ipv4.tcp_ecn=0

AMD Pollara DCQCN configuration for RDMA Traffic

For the AMD Pollara validation, DCQCN needs to be enabled and QOS has to be applied on the AMD NIC cards.

  1. Configure QOS on the NICs using the script. The DSCP parameters are equivalent to the values suggested in Table 15. Server DCQCN configuration parameters.
  2. Using AMD nicctl command line Utility below are the QOS parameters configured:
  3. The rdma link command can be used to check if the roce-devices association to the AMD Pollara NIC cards exist.

    The roce-devices are created when the ionic_rdma kernel module is loaded and should create the below roce-device file for each NIC card.

  4. To configure DCQCN on the AMD Pollara NICs, run below script with appropriate parameters.
  5. Using the nicctl command check the DCQCN profile for each roce-device.
  6. Finally run the rccl_test.sh script for 1G ALLREDUCE and ALLTOALL as below. The example below shows the tests run for both.