RDMAmellonx流控配置工具mlnx_qos

枕上诗书闲处好,门前风景雨来佳。这篇文章主要讲述RDMAmellonx流控配置工具mlnx_qos相关的知识,希望能为你提供帮助。

目录
??前言??
??参数??
??-i, --interface  获取当前的 QoS 配置??
【RDMAmellonx流控配置工具mlnx_qos】??-f, --pfc  设置端口的PFC??
??-p --prio_tc  将优先级映射到ETC(出口流量类别)??
??-s --tsa , -t -t-cbw  ??
??-r --ratelimit    为每个 TC 添加速率限制??
??-d --dcbx  获取/设置 DCBX 模式??
??--trust    设置pcp 或 dscp??
??--dscp2prio    设置dscp到priority  映射??
??--buffer_size  设置接收缓冲区大小??
??--prio2buffer  将优先级映射到接收缓冲区??
??-h  帮助信息??



前言注意:此命令是临时的,非持久性的,重启网卡或主机后失效?
mlnx_qos(Linux 工具 ,MLNX_OFED 的一部分)
这篇文章适用于 MLNX_OFED v4.2。
参考:?
参数-i, --interface  获取当前的 QoS 配置
此参数用于获取当前的 QoS 配置:
# mlnx_qos -i eth2

# mlnx_qos -i eth2
DCBX mode: OS controlled
Priority trust state: dscp
dscp2prio mapping:
prio:0 dscp:07,06,05,04,03,02,01,00,
prio:1 dscp:15,14,13,12,11,10,09,08,
prio:2 dscp:23,22,21,20,19,18,17,16,
prio:3 dscp:31,30,29,28,27,26,25,24,
prio:4 dscp:39,38,37,36,35,34,33,32,
prio:5 dscp:47,46,45,44,43,42,41,40,
prio:6 dscp:55,54,53,52,51,50,49,48,
prio:7 dscp:63,62,61,60,59,58,57,56,
Cable len: 10
PFC configuration:
priority 0 1 2 3 4 5 6 7
enabled 1 0 1 0 0 0 1 1

tc: 0 ratelimit: unlimited, tsa: ets, bw: 10%
priority: 1

tc: 1 ratelimit: unlimited, tsa: ets, bw: 10%
priority: 0

tc: 2 ratelimit: unlimited, tsa: ets, bw: 10%
priority: 2

tc: 3 ratelimit: unlimited, tsa: ets, bw: 10%
priority: 3

tc: 4 ratelimit: unlimited, tsa: ets, bw: 10%
priority: 4

tc: 5 ratelimit: unlimited, tsa: ets, bw: 10%
priority: 5

tc: 6 ratelimit: unlimited, tsa: strict
priority: 6

tc: 7 ratelimit: unlimited, tsa: ets, bw: 40%
priority: 7


-f, --pfc  设置端口的PFC
该参数用于设置端口的优先流控制(PFC)配置。您可以启用优先级priorities 0...7 的任何子集。
优先级是使用  逗号分隔的 列表 提供的。
例如,要启用  priority 3,请运行:
# mlnx_qos -i eth2 -f    0,0,0,1,0,0,0,0    #0-1-2-3-4-5-6-7
要检查配置,请运行:
# mlnx_qos -i eth2
PFC configuration:
priority 0 1 2 3 4 5 6 7
enabled 0 0 0 1 0 0 0 0
...
以上结果显示PFC 在优先级priority 3 上启用。
也可以看看:《HowTo Configure PFC on ConnectX-4 》??https://community.mellanox.com/s/article/howto-configure-pfc-on-connectx-4??
-p --prio_tc  将优先级映射到ETC(出口流量类别)
此参数用于将优先级映射到出口流量类别 (ETC)。
注意:默认情况下,优先级priority  0 映射到 tc1,优先级priority  1 映射到 tc0。所有其他优先级都映射到同一个 TC。
要更改映射,执行更改命令。例如:
# mlnx_qos -i eth2 -p 0,1,2,3,4,5,6,7
-s --tsa , -t -t-cbw 
-s 用于设置 出口调度方法:严格优先级或每个traffic class的 ETS。
-t 用于设置每个traffic class (TC) 的带宽(当此 TC 出口调度方法为 ETS 时相关),总和必须为 100,而严格优先级必须为 0 bw。
这些配置必须结合在一起。
例如,要为 tc6 设置严格优先级(strict priority),而其余的都是 ETS,请运行:
# mlnx_qos -i eth2 -s ets,ets,ets,ets,ets,ets,strict,ets -t 10,10,10,10,10,10,0,40

# mlnx_qos -i eth2 -s ets,ets,ets,ets,ets,ets,strict,ets -t 10,10,10,10,10,10,0,40

Priority trust mode: pcp

PFC configuration:
priority 0 1 2 3 4 5 6 7
enabled 0 0 0 0 0 0 0 0

tc: 0 ratelimit: unlimited, tsa: ets, bw: 10%
priority: 1

tc: 1 ratelimit: unlimited, tsa: ets, bw: 10%
priority: 0

tc: 2 ratelimit: unlimited, tsa: ets, bw: 10%
priority: 2

tc: 3 ratelimit: unlimited, tsa: ets, bw: 10%
priority: 3

tc: 4 ratelimit: unlimited, tsa: ets, bw: 10%
priority: 4

tc: 5 ratelimit: unlimited, tsa: ets, bw: 10%
priority: 5

tc: 6 ratelimit: unlimited, tsa: strict
priority: 6

tc: 7 ratelimit: unlimited, tsa: ets, bw: 40%
priority: 7


-r --ratelimit    为每个 TC 添加速率限制
此参数用于为每个 TC 添加速率限制。例如,要将 tc0 限制为 5G,将 tc3 限制为 10G,将 tc6 限制为 7G,请运行:
# mlnx_qos -i eth2 -r 5,0,0,10,0,0,7,0
-d --dcbx  获取/设置 DCBX 模式
此参数用于获取/设置 DCBX 模式(固件或操作系统控制)。有关更多信息,请参阅
《HowTo Auto-Config PFC and ETS on ConnectX-4 via LLDP DCBX》??https://community.mellanox.com/s/article/howto-auto-config-pfc-and-ets-on-connectx-4-via-lldp-dcbx??
--trust    设置pcp 或 dscp
此参数用于设置trust级别(pcp 或 dscp,即L2或L3)。也可以看看《HowTo Configure Trust State on Mellanox Adapters》
??https://community.mellanox.com/s/article/howto-configure-trust-state-on-mellanox-adapters??
请注意,要使此设置对 VF 生效,请重新加载 VF 驱动程序或重新启动 VM。
# mlnx_qos -i eth2 --trust=dscp
DCBX mode: OS controlled
Priority trust state: dscp
dscp2prio mapping:
prio:0 dscp:07,06,05,04,03,02,01,00,
prio:1 dscp:15,14,13,12,11,10,09,08,
prio:2 dscp:23,22,21,20,19,18,17,16,
prio:3 dscp:31,30,29,28,27,26,25,24,
prio:4 dscp:39,38,37,36,35,34,33,32,
prio:5 dscp:47,46,45,44,43,42,41,40,
prio:6 dscp:55,54,53,52,51,50,49,48,
prio:7 dscp:63,62,61,60,59,58,57,56,
--dscp2prio    设置dscp到priority  映射
当trust  为“dscp”时,该参数用于设置dscp到优先级priority  映射。请注意,要使此设置对 VF 生效,请重新加载 VF 驱动程序或重新启动 VM。
例如,要将 dscp 30 映射到优先级 6,请运行:
# mlnx_qos -i eth2 --dscp2prio set,30,6
DCBX mode: OS controlled
Priority trust state: dscp
dscp2prio mapping:
prio:0 dscp:07,06,05,04,03,02,01,00,
prio:1 dscp:15,14,13,12,11,10,09,08,
prio:2 dscp:23,22,21,20,19,18,17,16,
prio:3 dscp:31,29,28,27,26,25,24,
prio:4 dscp:39,38,37,36,35,34,33,32,
prio:5 dscp:47,46,45,44,43,42,41,40,
prio:6 dscp:30,55,54,53,52,51,50,49,48,
prio:7 dscp:63,62,61,60,59,58,57,56,
--buffer_size  设置接收缓冲区大小
从OFED 4.4 开始支持。该参数用于设置接收缓冲区大小。请注意,为避免流量丢失,无损缓冲区大小应至少为 (xoff + 8 * MTU),有损缓冲区大小不应为 0。
例如,下面这个命令将缓冲区大小 0、1、2、3、4、5、6、7 分别设置为 80296、80296、1000、80296、1000、1000、1000、1000 的大小。
#  mlnx_qos -i ens2f0 --buffer_size  80296,80296,1000,80296,1000,1000,1000,1000
DCBX mode: OS controlled
Priority trust state: pcp
Receive buffer size (bytes): 80256,80256,896,80256,896,896,896,896,
Cable len: 7
PFC configuration:
priority 0 1 2 3 4 5 6 7
enabled 0 0 0 0 0 0 0 0
buffer 0 0 0 0 0 0 0 0
--prio2buffer  将优先级映射到接收缓冲区
从OFED 4.4 开始支持。此参数用于手动将优先级映射到接收缓冲区。
例如,下面的命令将优先级 0、1、2、3、4、5、6、7 分别设置为缓冲区 0、2、5、7、1、2、3、6。
#  mlnx_qos -i ens2f0 --prio2buffer 0,2,5,7,1,2,3,6
DCBX mode: OS controlled
Priority trust state: pcp
Receive buffer size (bytes): 80256,80256,896,80256,896,896,896,896,
Cable len: 7
PFC configuration:
priority 0 1 2 3 4 5 6 7
enabled 0 0 0 0 0 0 0 0
buffer 0 2 5 7 1 2 3 6
-h  帮助信息
This parameter is used to display help information.
该参数用于显示帮助信息。


    推荐阅读