Command Line Reference
DCB Configuration
PFC
17 min
it is supported to manage pfc with templates or with customized configurations templated pfc management 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 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 pfc view pfc view table 1 pfc view 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 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 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 show counters priority flow control 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 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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 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 clear counters priority flow control 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 control show pfc profiles 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 pfc config table 2 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) (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) (for other models) priority group buffer buffer profile name bind the pg buffer profile to the queue at ingress priority flow control enable priority flow control enable ingress queue id \[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# configure sonic(config)# priority flow control enable 4 buffer profile buffer profile buffer profile name \[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 testname sonic(config buffer profile testname)# mode lossless {static mode lossless {static static th |dynamic dynamic th } size size \[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) (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] info the 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 ! 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 mode lossless {static mode lossless {static static th |dynamic dynamic th } size size xoff xoff xon offset xon offset \[xon xon ] \[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) (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 warning the 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 recommended configurations for the cx864e n model 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 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 profile sonic(config buffer profile pg lossless 100000 100m profile)# mode lossless dynamic 1 size 1518 xoff 46496 xon offset 13440 priority group buffer priority group buffer buffer profile name \[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 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
