跳转到内容
Ask AI

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:
  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.

Table 1 PFC View

CommandPurpose
show interface priority-flow-controlDisplay the PFC status of interfaces.
show counters priority-flow-controlDisplay PFC counters.
clear counters priority-flow-controlClear PFC counters.
show pfc profilesDisplay PFC profiles.

[Command] show interface priority-flow-control

[Purpose] Display the PFC status of interfaces.

[View] Privileged User View

[Use Cases]

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

[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 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

[Command] clear counters priority-flow-control

[Purpose] Clear PFC counters.

[View] Privileged User View

[Use Cases]

sonic# clear counters priority-flow-control

[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"
}
}

Table 2 PFC Config

CommandPurpose
priority-flow-control enable ingress-queue-idGlobally enable PFC for the queue.
buffer-profile buffer_profile_nameConfigure a custom PFC buffer profile and enter Buffer Configuration View.
mode lossless {static static_th|dynamic dynamic_th} size sizeSet 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_nameBind the PG buffer profile to the queue at ingress.

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

[Purpose] Globally enable PFC for the queue.

[Parameters]

ParameterDescription
ingress-queue-idQueue 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# configure
sonic(config)# priority-flow-control enable 4

[Command] buffer-profile buffer_profile_name

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

[Parameters]

ParameterDescription
buffer_profile_nameProfile name.

[View] Global Configuration View

[Notes] Run command no buffer-profile profile_name to delete the buffer profile.

[Use Cases]

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

[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]

ParameterDescription
static_thSet 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_thSet 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;
sizeSet 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_test
sonic(config-buffer-profile-buffer_test)# mode lossless dynamic -3 size 0

[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]

ParameterDescription
static_thSet the static threshold value in bytes. The range is from 0 to 47218432.
dynamic_thSet 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.
sizeSet the guaranteed buffer in bytes. The recommended value is 1518.
xoffSet 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-offsetSet 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 speedcable lengthsizexonxoffdynamic thresholdxon_offset
250005m151801568019408
500005m151802124819408
1000005m151803462419408
2000005m151806236819408
4000005m1518011753619408
8000005m1518019753619408
2500040m151801692819408
5000040m151802339219408
10000040m151803881619408
20000040m151807190419408
40000040m1518013552019408
80000040m1518020552019408
25000100m151801884819408
50000100m151802726419408
100000100m151804649619408
200000100m151808716819408
400000100m1518016668819408
800000100m1518023668819408
25000300m151802518419408
50000300m151804012819408
100000300m151807238419408
200000300m1518013811219408
400000300m1518026864019408
800000300m1518046864019408
  • Recommended configurations for other models:
port speedcable lengthsizexonxoffdynamic thresholdxon_offset
250005m1518015680113440
500005m1518021248113440
1000005m1518034624113440
2000005m1518062368113440
4000005m15180117536113440
2500040m1518016928113440
5000040m1518023392113440
10000040m1518038816113440
20000040m1518071904113440
40000040m15180135520113440
25000100m1518018848113440
50000100m1518027264113440
100000100m1518046496113440
200000100m1518087168113440
400000100m15180166688113440
25000300m1518025184113440
50000300m1518040128113440
100000300m1518072384113440
200000300m15180138112113440
400000300m15180268640113440

[Use Cases]

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

[Command] priority-group-buffer buffer_profile_name

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

[Parameters]

ParameterDescription
buffer_profile_nameProfile 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_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