PFC
It is supported to manage PFC with templates or with customized configurations.
- Templated PFC Management 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.
- Customized PFC Management Configure a custom PG buffer profile to specify the PFC threshold. The specific steps for configuration are as follows:
- Run priority-flow-control enable ingress-queue-id command to enable PFC for the queue globally.
- Run buffer-profile buffer_profile_name command to create a lossless buffer profile.
- Run class-map class_map_name command to create a class map to specify the queue.
- 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.
- 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.
Table 1 PFC View
| 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. |
show interface priority-flow-control
Section titled “show interface priority-flow-control”[Command] show interface priority-flow-control
[Purpose] Display the PFC status of interfaces.
[View] Privileged User View
[Use Cases]
sonic# show interface priority-flow-controlInterface Lossless priorities----------- ---------------------0/0 3,40/4 3,40/8 3,40/12 3,40/16 3,40/20 3,40/24 3,40/28 3,40/32 3,40/36 3,40/40 3,40/44 3,40/48 3,40/52 3,40/56 3,40/60 3,40/64 3,40/68 3,40/72 3,40/76 3,40/80 3,40/84 3,40/88 3,40/92 3,40/96 3,40/100 3,40/104 3,40/108 3,40/112 3,40/116 3,40/120 3,40/124 3,40/128 3,40/129 3,4show counters priority-flow-control
Section titled “show counters priority-flow-control”[Command] show counters priority-flow-control
[Purpose] Display PFC counters.
[View] Privileged User View
[Use Cases]
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 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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 0clear counters priority-flow-control
Section titled “clear counters priority-flow-control”[Command] clear counters priority-flow-control
[Purpose] Clear PFC counters.
[View] Privileged User View
[Use Cases]
sonic# clear counters priority-flow-controlshow pfc profiles
Section titled “show pfc profiles”[Command] show pfc profiles
[Purpose] Display PFC profiles.
[View] Privileged User View
[Use Cases]
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"}}PFC Config
Section titled “PFC Config”Table 2 PFC Config
| 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. (For CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2) |
| mode lossless {static static_th|dynamic dynamic_th} size size xoff xoff xon-offset xon-offset [xon xon] | Set a PFC lossless buffer. (For other models) |
| priority-group-buffer buffer_profile_name | Bind the PG buffer profile to the queue at ingress. |
priority-flow-control enable
Section titled “priority-flow-control enable”[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]
sonic# configuresonic(config)# priority-flow-control enable 4buffer-profile
Section titled “buffer-profile”[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]
sonic(config)# buffer-profile testnamesonic(config-buffer-profile-testname)#mode lossless {static
Section titled “mode lossless {static”[Command] mode lossless {static static_th|dynamic dynamic_th} size size
[Purpose] Set a PFC lossless buffer. (For CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2)
[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]
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:
!buffer-profile lossless_buffer_profile mode lossless dynamic -3 size 0[Use Cases]
sonic(config)# buffer-profile buffer_testsonic(config-buffer-profile-buffer_test)# mode lossless dynamic -3 size 0mode lossless {static
Section titled “mode lossless {static”[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. (For other models)
[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.
If you want to assign them manually, the following are recommended parameters for different speeds interfaces.
- Recommended configurations for the CX864E-N model:
| 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 |
- Recommended configurations for other models:
| 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]
sonic(config)# buffer-profile pg_lossless_100000_100m_profilesonic(config-buffer-profile-pg_lossless_100000_100m_profile)# mode lossless dynamic 1 size 1518 xoff 46496 xon-offset 13440priority-group-buffer
Section titled “priority-group-buffer”[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]
sonic(config)# buffer-profile pg_lossless_100000_100m_profilesonic(config-buffer-profile-pg_lossless_100000_100m_profile)# mode lossless dynamic 1 size 1518 xoff 46496 xon-offset 13440sonic(config-buffer-profile-pg_lossless_100000_100m_profile)# exitsonic(config)# polic-map test1sonic(config-pmap-test1)# class cmap_4sonic(config-pmap-c)# priority-group-buffer pg_lossless_100000_100m_profile