---
title: PFC
slug: aidc/pfc
createdAt: 2025-12-01T11:11:08.000Z
---

It is supported to manage PFC with templates or with customized configurations.

- <font color="#1d05a2">Templated PFC Management</font>
  By default, a default PFC threshold template exists in the system that supports globally enabling PFC for up to two queues. PFC for queues **3** and **4** has been enabled by default.
  Run **show pfc profiles** command to display the default PFC threshold configuration.
- <font color="#1d05a2">Customized PFC Management</font>
  Configure a custom PG buffer profile to specify the PFC threshold.
  The specific steps for configuration are as follows:

1. Run **priority-flow-control enable** *ingress-queue-id* command to enable PFC for the queue globally.
2. Run **buffer-profile** *buffer\_profile\_name* command to create a lossless buffer profile.
3. Run **class-map** *class\_map\_name* command to create a class map to specify the queue.
4. Run **policy-map** *policy\_map\_name* command to create a policy map, and run **class** *class\_map\_name* to bind it to the class map. Then run **priority-group-buffer** *buffer\_profile\_name* command to bind to the priority-group buffer profile.
5. Run **service-policy** *policy\_map\_name* command to apply the policy to the interface.
   Due to the complexity of custom PFC configuration, it is recommended to use default template PFC in preference.

## <font color="#1d50a2">PFC View</font>

<font color="#1d05a2">Table 1 PFC View</font>

| **Command**                              | **Purpose**                           |
| ---------------------------------------- | ------------------------------------- |
| **show interface priority-flow-control** | Display the PFC status of interfaces. |
| **show counters priority-flow-control**  | Display PFC counters.                 |
| **clear counters priority-flow-control** | Clear PFC counters.                   |
| **show pfc profiles**                    | Display PFC profiles.                 |

### <font color="#1d50a2">show interface priority-flow-control</font>

**\[Command]**
**show interface priority-flow-control**

**\[Purpose]**
Display the PFC status of interfaces.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show interface priority-flow-control
Interface    Lossless priorities
-----------  ---------------------
0/0          3,4
0/4          3,4
0/8          3,4
0/12         3,4
0/16         3,4
0/20         3,4
0/24         3,4
0/28         3,4
0/32         3,4
0/36         3,4
0/40         3,4
0/44         3,4
0/48         3,4
0/52         3,4
0/56         3,4
0/60         3,4
0/64         3,4
0/68         3,4
0/72         3,4
0/76         3,4
0/80         3,4
0/84         3,4
0/88         3,4
0/92         3,4
0/96         3,4
0/100        3,4
0/104        3,4
0/108        3,4
0/112        3,4
0/116        3,4
0/120        3,4
0/124        3,4
0/128        3,4
0/129        3,4
```

### <font color="#1d50a2">show counters priority-flow-control</font>

**\[Command]**
**show counters priority-flow-control**

**\[Purpose]**
Display PFC counters.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show counters priority-flow-control
      Port Rx    PFC0    PFC1    PFC2    PFC3    PFC4    PFC5    PFC6    PFC7
-----------  ------  ------  ------  ------  ------  ------  ------  ------
        0/0       0       0       0       0       0       0       0       0
        0/4       0       0       0       0       0       0       0       0
        0/8       0       0       0       0       0       0       0       0
       0/12       0       0       0       0       0       0       0       0
       0/16       0       0       0       0       0       0       0       0
       0/20       0       0       0       0       0       0       0       0
       0/24       0       0       0       0       0       0       0       0
       0/28       0       0       0       0       0       0       0       0
       0/32       0       0       0       0       0       0       0       0
       0/36       0       0       0       0       0       0       0       0
       0/40       0       0       0       0       0       0       0       0
       0/44       0       0       0       0       0       0       0       0
       0/48       0       0       0       0       0       0       0       0
       0/52       0       0       0       0       0       0       0       0
       0/56       0       0       0       0       0       0       0       0
       0/60       0       0       0       0       0       0       0       0
       0/64       0       0       0       0       0       0       0       0
       0/68       0       0       0       0       0       0       0       0
       0/72       0       0       0       0       0       0       0       0
       0/76       0       0       0       0       0       0       0       0
       0/80       0       0       0       0       0       0       0       0
       0/84       0       0       0       0       0       0       0       0
       0/88       0       0       0       0       0       0       0       0
       0/92       0       0       0       0       0       0       0       0
       0/96       0       0       0       0       0       0       0       0
      0/100       0       0       0       0       0       0       0       0
      0/104       0       0       0       0       0       0       0       0
      0/108       0       0       0       0       0       0       0       0
      0/112       0       0       0       0       0       0       0       0
      0/116       0       0       0       0       0       0       0       0
      0/120       0       0       0       0       0       0       0       0
      0/124       0       0       0       0       0       0       0       0
      0/128       0       0       0       0       0       0       0       0
      0/129       0       0       0       0       0       0       0       0
    Port Tx    PFC0    PFC1    PFC2    PFC3    PFC4    PFC5    PFC6    PFC7
-----------  ------  ------  ------  ------  ------  ------  ------  ------
        0/0       0       0       0       0       0       0       0       0
        0/4       0       0       0       0       0       0       0       0
        0/8       0       0       0       0       0       0       0       0
       0/12       0       0       0       0       0       0       0       0
       0/16       0       0       0       0       0       0       0       0
       0/20       0       0       0       0       0       0       0       0
       0/24       0       0       0       0       0       0       0       0
       0/28       0       0       0       0       0       0       0       0
       0/32       0       0       0       0       0       0       0       0
       0/36       0       0       0       0       0       0       0       0
       0/40       0       0       0       0       0       0       0       0
       0/44       0       0       0       0       0       0       0       0
       0/48       0       0       0       0       0       0       0       0
       0/52       0       0       0       0       0       0       0       0
       0/56       0       0       0       0       0       0       0       0
       0/60       0       0       0       0       0       0       0       0
       0/64       0       0       0       0       0       0       0       0
       0/68       0       0       0       0       0       0       0       0
       0/72       0       0       0       0       0       0       0       0
       0/76       0       0       0       0       0       0       0       0
       0/80       0       0       0       0       0       0       0       0
       0/84       0       0       0       0       0       0       0       0
       0/88       0       0       0       0       0       0       0       0
       0/92       0       0       0       0       0       0       0       0
       0/96       0       0       0       0       0       0       0       0
      0/100       0       0       0       0       0       0       0       0
      0/104       0       0       0       0       0       0       0       0
      0/108       0       0       0       0       0       0       0       0
      0/112       0       0       0       0       0       0       0       0
      0/116       0       0       0       0       0       0       0       0
      0/120       0       0       0       0       0       0       0       0
      0/124       0       0       0       0       0       0       0       0
      0/128       0       0       0       0       0       0       0       0
      0/129       0       0       0       0       0       0       0       0
```

### <font color="#1d50a2">clear counters priority-flow-control</font>

**\[Command]**
**clear counters priority-flow-control**

**\[Purpose]**
Clear PFC counters.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# clear counters priority-flow-control
```

### <font color="#1d50a2">show pfc profiles</font>

**\[Command]**
**show pfc profiles**

**\[Purpose]**
Display PFC profiles.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show pfc profile
{
    "ingress_lossless_profile":{
        "dynamic_th":"1",
        "pool":"ingress_lossless_pool",
        "size":"1518",
        "xoff":"38816",
        "xon_offset":"13440"
    },
    "pg_lossless_1":{
        "dynamic_th":"-4",
        "pool":"ingress_lossless_pool",
        "size":"1518",
        "xoff":"46496",
        "xon_offset":"13440"
    },
    "pg_lossless_100000_40m_profile":{
        "dynamic_th":"1",
        "pool":"ingress_lossless_pool",
        "size":"1518",
        "xoff":"38816",
        "xon":"0",
        "xon_offset":"13440"
}
}
```

## <font color="#1d50a2">PFC Config</font>

<font color="#1d05a2">Table 2 PFC Config</font>

| **Command**                                                                                                                                          | **Purpose**                                                                                                     |
| ---------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| **priority-flow-control enable** *ingress-queue-id*                                                                                                  | Globally enable PFC for the queue.                                                                              |
| **buffer-profile** *buffer\_profile\_name*                                                                                                           | Configure a custom PFC buffer profile and enter Buffer Configuration View.                                      |
| **mode lossless** \{**static** *static\_th*\|**dynamic** *dynamic\_th*} **size** *size*                                                              | Set a PFC lossless buffer.<br /><font color="#1d05a2">(For CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2)</font> |
| **mode lossless** \{**static** *static\_th*\|**dynamic** *dynamic\_th*} **size** *size* **xoff** *xoff* **xon-offset** *xon-offset* \[**xon** *xon*] | Set a PFC lossless buffer.<br /><font color="#1d05a2">(For other models)</font>                                 |
| **priority-group-buffer** *buffer\_profile\_name*                                                                                                    | Bind the PG buffer profile to the queue at ingress.                                                             |

### <font color="#1d50a2">priority-flow-control enable *ingress-queue-id*</font>

**\[Command]**
**priority-flow-control enable** *ingress-queue-id*

**\[Purpose]**
Globally enable PFC for the queue.

**\[Parameters]**

| **Parameter**      | **Description**               |
| ------------------ | ----------------------------- |
| *ingress-queue-id* | Queue ID, the range is \[0,7] |

**\[View]**
Global Configuration View

**\[Notes]**
Only support up to two queues to enable PFC globally, by default, PFC of queue 3, 4 have been enabled. If you want to enable PFC for other queues, please disable PFC of queue 3 or 4 first.
Configuring the PFC global enable queue requires reload to take effect.
Port-based modification of PFC enable queues is not supported at this time.
Run command **no priority-flow-control enable** *ingress-queue-id* to disable PFC for the queue.

**\[Use Cases]**

```plaintext
sonic# configure
sonic(config)# priority-flow-control enable 4
```

### <font color="#1d50a2">buffer-profile *buffer\_profile\_name*</font>

**\[Command]**
**buffer-profile** *buffer\_profile\_name*

**\[Purpose]**
Configure a custom PFC buffer profile and enter Buffer Configuration View.

**\[Parameters]**

| **Parameter**           | **Description** |
| ----------------------- | --------------- |
| *buffer\_profile\_name* | Profile name.   |

**\[View]**
Global Configuration View

**\[Notes]**
Run command **no buffer-profile** *profile\_name* to delete the buffer profile.

**\[Use Cases]**

```plaintext
sonic(config)# buffer-profile testname
sonic(config-buffer-profile-testname)#
```

### <font color="#1d50a2">mode lossless \{static *static\_th*|dynamic *dynamic\_th*\} size *size*</font>

**\[Command]**
**mode lossless** \{**static** *static\_th*|**dynamic** *dynamic\_th*} **size** *size*

**\[Purpose]**
Set a PFC lossless buffer. <font color="#1d05a2">(For CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2)</font>

**\[Parameters]**

| **Parameter** | **Description**                                                                                                                                                                                                                                                                                                        |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| *static\_th*  | Set the static threshold value in bytes. This parameter is meaningless on CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2, and should be configured as 0.                                                                                                                                                                 |
| *dynamic\_th* | Set the dynamic threshold value in integer. The value shall not be less than -5. *Dynamic threshold* = (*dynamic\_th* + 6) \* *remaining available buffer* on CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2. For example, if dynamic\_th is set to -4, the dynamic threshold is 2 times the remaining available buffer; |
| *size*        | Set the guaranteed buffer in bytes. It is recommended to be an integer multiple of the cell size. The recommended configuration value is 25600.                                                                                                                                                                        |

**\[View]**
Buffer Configuration View

**\[Notes]**

:::hint{type="success"}
**INFO:&#x20;**&#x54;he cell size varies by model. On CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2, the cell size is 128 Bytes. On CX864E-N, the cell size is 512 Bytes. On other models, the cell size is 224 bytes.
:::

When congestion occurs at a queue and the ingress buffer occupancy reaches the watermark, it starts sending pause frames. When the sender receives a pause frame and reduces the traffic sent, the ingress buffer occupancy of the switch decreases and stops sending pause frames when the occupancy falls below the watermark.
The formula for calculating the PFC watermark is: Limit=Guaranteed Buffers + Dynamic Factor. Dynamic Factor is 0 in static mode.
The sum of the lossless buffers allocated to each queue shall be no greater than the lossless pool size.
Recommended Configuration:

```plaintext
!
buffer-profile lossless_buffer_profile
 mode lossless dynamic -3 size 0
```

**\[Use Cases]**

```plaintext
sonic(config)# buffer-profile buffer_test
sonic(config-buffer-profile-buffer_test)# mode lossless dynamic -3 size 0
```

### <font color="#1d50a2">mode lossless \{static *static\_th*|dynamic *dynamic\_th*\} size *size* xoff *xoff* xon-offset *xon-offset* \[xon *xon*\]</font>

**\[Command]**
**mode lossless** \{**static** *static\_th*|**dynamic** *dynamic\_th*} **size** *size* **xoff** *xoff* **xon-offset** *xon-offset* \[**xon** *xon*]

**\[Purpose]**
Set a PFC lossless buffer. <font color="#1d05a2">(For other models)</font>

**\[Parameters]**

| **Parameter** | **Description**                                                                                                                                                                                                                                                                                                                    |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| *static\_th*  | Set the static threshold value in bytes. The range is from 0 to 47218432.                                                                                                                                                                                                                                                          |
| *dynamic\_th* | Set the dynamic threshold value in integer. The range is from -4 to 3. *Dynamic threshold* = 2dynamic\_th \* *remaining available buffer*. For example, if dynamic\_th is set to 1, then dynamic threshold is two times the remaining available buffer, that is, the actual threshold is two-thirds of the total available buffer. |
| *size*        | Set the guaranteed buffer in bytes. The recommended value is 1518.                                                                                                                                                                                                                                                                 |
| *xoff*        | Set PFC pause frame trigger cache threshold value in bytes, which is recommended to be an integer multiple of the cell size. Xoff is related to cable length, port speed and so on, you may refer to the recommended  values below to configure. Xoff value must be greater than xon value.                                        |
| *xon-offset*  | Set PFC pause frame stop buffer threshold value in bytes, it is recommended to be an integer multiple of cell size. The recommended value is 13440.                                                                                                                                                                                |
| *xon*         | (Optional) It should be an integer multiple of cell size and the unit is byte. It is recommended to configure 0, since the actual xon takes the larger value of xon and xon-offset, so it is generally not necessary to set the value of xon.                                                                                      |

The parameters of dynamic lossless buffer are related to the port speed, cable length, etc. The following are the recommended values:

**\[View]**
Buffer Configuration View

**\[Notes]**
When congestion occurs at a queue and the ingress buffer occupancy reaches xoff, it starts sending pause frames. When the sender receives pause frames and reduces the traffic sent, the ingress buffer occupancy of the switch decreases and stops sending pause frames when the occupancy reaches xon.
The default ingress pause frame trigger threshold and pause frame stop threshold exist in the interface configuration when not configured by the user.
The sum of the lossless buffers allocated to each queue shall be no greater than the lossless pool size.

:::hint{type="warning"}
**Warning:&#x20;**&#x54;he parameters of dynamic lossless buffer are related to the port speed, cable length, etc. We recommend you to use “Easy RoCE” to automatically generate lossless parameters. Improper configuration may cause packet loss during traffic transmission.
:::

If you want to assign them manually, the following are recommended parameters for different speeds interfaces.

- <font color="#1d05a2">Recommended configurations for the CX864E-N model\:</font>

| **port speed** | **cable length** | **size** | **xon** | **xoff** | **dynamic threshold** | **xon\_offset** |
| -------------- | ---------------- | -------- | ------- | -------- | --------------------- | --------------- |
| 25000          | 5m               | 1518     | 0       | 15680    | 1                     | 9408            |
| 50000          | 5m               | 1518     | 0       | 21248    | 1                     | 9408            |
| 100000         | 5m               | 1518     | 0       | 34624    | 1                     | 9408            |
| 200000         | 5m               | 1518     | 0       | 62368    | 1                     | 9408            |
| 400000         | 5m               | 1518     | 0       | 117536   | 1                     | 9408            |
| 800000         | 5m               | 1518     | 0       | 197536   | 1                     | 9408            |
| 25000          | 40m              | 1518     | 0       | 16928    | 1                     | 9408            |
| 50000          | 40m              | 1518     | 0       | 23392    | 1                     | 9408            |
| 100000         | 40m              | 1518     | 0       | 38816    | 1                     | 9408            |
| 200000         | 40m              | 1518     | 0       | 71904    | 1                     | 9408            |
| 400000         | 40m              | 1518     | 0       | 135520   | 1                     | 9408            |
| 800000         | 40m              | 1518     | 0       | 205520   | 1                     | 9408            |
| 25000          | 100m             | 1518     | 0       | 18848    | 1                     | 9408            |
| 50000          | 100m             | 1518     | 0       | 27264    | 1                     | 9408            |
| 100000         | 100m             | 1518     | 0       | 46496    | 1                     | 9408            |
| 200000         | 100m             | 1518     | 0       | 87168    | 1                     | 9408            |
| 400000         | 100m             | 1518     | 0       | 166688   | 1                     | 9408            |
| 800000         | 100m             | 1518     | 0       | 236688   | 1                     | 9408            |
| 25000          | 300m             | 1518     | 0       | 25184    | 1                     | 9408            |
| 50000          | 300m             | 1518     | 0       | 40128    | 1                     | 9408            |
| 100000         | 300m             | 1518     | 0       | 72384    | 1                     | 9408            |
| 200000         | 300m             | 1518     | 0       | 138112   | 1                     | 9408            |
| 400000         | 300m             | 1518     | 0       | 268640   | 1                     | 9408            |
| 800000         | 300m             | 1518     | 0       | 468640   | 1                     | 9408            |

- <font color="#1d05a2">Recommended configurations for other models\:</font>

| **port speed** | **cable length** | **size** | **xon** | **xoff** | **dynamic threshold** | **xon\_offset** |
| -------------- | ---------------- | -------- | ------- | -------- | --------------------- | --------------- |
| 25000          | 5m               | 1518     | 0       | 15680    | 1                     | 13440           |
| 50000          | 5m               | 1518     | 0       | 21248    | 1                     | 13440           |
| 100000         | 5m               | 1518     | 0       | 34624    | 1                     | 13440           |
| 200000         | 5m               | 1518     | 0       | 62368    | 1                     | 13440           |
| 400000         | 5m               | 1518     | 0       | 117536   | 1                     | 13440           |
| 25000          | 40m              | 1518     | 0       | 16928    | 1                     | 13440           |
| 50000          | 40m              | 1518     | 0       | 23392    | 1                     | 13440           |
| 100000         | 40m              | 1518     | 0       | 38816    | 1                     | 13440           |
| 200000         | 40m              | 1518     | 0       | 71904    | 1                     | 13440           |
| 400000         | 40m              | 1518     | 0       | 135520   | 1                     | 13440           |
| 25000          | 100m             | 1518     | 0       | 18848    | 1                     | 13440           |
| 50000          | 100m             | 1518     | 0       | 27264    | 1                     | 13440           |
| 100000         | 100m             | 1518     | 0       | 46496    | 1                     | 13440           |
| 200000         | 100m             | 1518     | 0       | 87168    | 1                     | 13440           |
| 400000         | 100m             | 1518     | 0       | 166688   | 1                     | 13440           |
| 25000          | 300m             | 1518     | 0       | 25184    | 1                     | 13440           |
| 50000          | 300m             | 1518     | 0       | 40128    | 1                     | 13440           |
| 100000         | 300m             | 1518     | 0       | 72384    | 1                     | 13440           |
| 200000         | 300m             | 1518     | 0       | 138112   | 1                     | 13440           |
| 400000         | 300m             | 1518     | 0       | 268640   | 1                     | 13440           |

**\[Use Cases]**

```plaintext
sonic(config)# buffer-profile pg_lossless_100000_100m_profile
sonic(config-buffer-profile-pg_lossless_100000_100m_profile)# mode lossless dynamic 1 size 1518 xoff 46496 xon-offset 13440
```

### <font color="#1d50a2">priority-group-buffer *buffer\_profile\_name*</font>

**\[Command]**
**priority-group-buffer** *buffer\_profile\_name*

**\[Purpose]**
Bind the PG buffer profile to the queue at ingress.

**\[Parameters]**

| **Parameter**           | **Description** |
| ----------------------- | --------------- |
| *buffer\_profile\_name* | Profile name.   |

**\[View]**
Policy Map-Class Map Configuration View

**\[Notes]**
Please bind an existing class map to specify the queue for policy matching, and the queue should be globally PFC-enabled.
Run command **no priority-group-buffer** *buffer\_profile\_name* to unbind the PG buffer profile.

**\[Use Cases]**

```plaintext
sonic(config)# buffer-profile pg_lossless_100000_100m_profile
sonic(config-buffer-profile-pg_lossless_100000_100m_profile)# mode lossless dynamic 1 size 1518 xoff 46496 xon-offset 13440
sonic(config-buffer-profile-pg_lossless_100000_100m_profile)# exit
sonic(config)# polic-map test1
sonic(config-pmap-test1)# class cmap_4
sonic(config-pmap-c)# priority-group-buffer pg_lossless_100000_100m_profile
```

