目录
1概述
本文档介绍了以浪潮以太网交换机 SC6630EL和Mellanox 网卡 MCX653106A-ECAT 为主实施ROCE v2网络。主要内容包括交换机的QoS配置,网卡QoS配置。在本文档的附录中,提供了该文档所涉及的术语和缩略语。 阅读本文档有助于读者掌握系统的原理和各种配置信息。
2物理环境
本次实施设备信息:
交换机:浪潮SC6630EL-32C *1
网卡:Mellanox MCX653106A-ECAT *2
模块:100G QSFP28 SR4 *2
服务器:X86架构
操作系统:Ubuntu 22.04
2.1网络拓扑
3交换机配置文档信息
3.1 QoS配置
switch(config)# qos scheduler sp #创建qos调度模版 SP
switch(config-qos-scheduler-sp)#type strict #配置 qos 严格优先级调度算法(队列6-7,一般6-7队列是跑一些协议类型的流量)
switch(config-qos-scheduler-sp)# exit
switch(config)#interface ethernet 1-32
switch(config-if-ethernet1-32)# no service-policy scheduler queue 6-7 #清除队列6-7的默认调度算法
switch(config-if-ethernet1-32)# service-policy scheduler sp queue 6-7 #设置6-7队列的调度算法文件sp
switch(config-if-ethernet1-32)# do show interface service-policy scheduler #查看
switch(config-if-ethernet1-32)# priority-flow-control priority 3 #设置pfc在队列3
switch(config-if-ethernet1-32)# do show interface priority-flow-control priority config #查看
switch(config-if-ethernet1-32)# exit
switch(config)# qos buffer-profile ingress_dynamic_lossless_profile #创建 qos buffer-profile ingress_dynamic_lossless_profile动态入方向模版文件
switch(config-qos-buffer-profile-ingress_dynamic_lossless_profile)# exit
switch(config)#
switch(config)# qos buffer-profile ingress_static_lossy_profile #创建文件
switch(config-qos-buffer-profile-ingress_static_lossy_profile)# exit
switch(config)#
switch(config)# qos buffer-profile egress_static_lossless_profile #配置出方向文件
switch(config-qos-buffer-profile-egress_static_lossless_profile)# exit
switch(config)# qos buffer-profile egress_dynamic_lossy_profile #创建出方向动态文件
switch(config-qos-buffer-profile-egress_dynamic_lossy_profile)# exit
switch(config)# interface ethernet 1-32 #进入接口模式
switch(config-if-ethernet1-32)# do show interface service-policy buffer-profile ingress #接口模式下查看接口队列加载的入方向的配置文件
switch(config-if-ethernet1-32)# do show interface service-policy buffer-profile egress #接口模式下查看接口队列加载的出方向的配置文件
switch(config-if-ethernet1-32)# do show qos buffer-profile #查看qos buffer文件配置信息
switch(config-if-ethernet1-32)# exit
switch(config)# qos queue-profile ecn #创建qos文件 ecn
switch(config-qos-queue-profile-ecn)# green min-threshold #配置 wred 绿包丢弃低门限
switch(config-qos-queue-profile-ecn)# green max-threshold #配置 wred 绿包丢弃高门限
switch(config-qos-queue-profile-ecn)# green probability 80 #配置 wred 绿包丢弃概率
switch(config-qos-queue-profile-ecn)# random-detect #开启 wred,创建 wred profile 后默认为开启状态
switch(config-qos-queue-profile-ecn)# ecn
switch(config-qos-queue-profile-ecn)# exit
switch(config)# interface ethernet 1-32 #进入接口模式
switch(config-if-ethernet1-32)#service-policy queue-profile ecn queue 3 #队列3中使用QOS ecn WRED文件模版
switch(config-if-ethernet1-32)# do show interface service-policy queue-profile #查看
switch(config-if-ethernet1-32)#
service-policy buffer-profile ingress ingress_dynamic_lossless_profile queue 3 #队列3在入方向加载buffer-profile
switch(config-if-ethernet1-32)# service-policy buffer-profile ingress ingress_static_lossy_profile queue 0-2,4-7 #队列0-2,4-7在入方向加载buffer-profile文件
switch(config-if-ethernet1-32)# service-policy buffer-profile egress egress_static_lossless_profile queue 3 #队列3在出方向加载buffer-profile文件
switch(config-if-ethernet1-32)# service-policy buffer-profile egress egress_dynamic_lossy_profile queue 0-2,4-7 ##队列0-2,4-7在出方向加载buffer-profile文件
switch(config-if-ethernet1-32)# do show interface service-policy buffer-profile ingress|egress #查看接口的加载的信息文件
3.2 创建VLAN信息
switch# configure terminal
switch(config)# vlan 100
switch(config-vlan100)# exit
switch(config)# interface ethernet 1
switch(config-if-ethernet1)# switchport
switch(config-if-ethernet1)# switchport mode access
switch(config-if-ethernet1)# switchport access vlan 100
switch(config-if-ethernet1)# exit
switch(config)# interface ethernet 2
switch(config-if-ethernet2)# switchport
switch(config-if-ethernet2)# switchport mode access
switch(config-if-ethernet2)# switchport access vlan 100
switch(config-if-ethernet2)# exit
switch(config)# interface vlan 100
switch(config-if-vlan100)# ip address 10.0.0.1/24
switch(config-if-vlan100)# end
switch# show interface counters #查看接口couns
4 Mellanox网卡配置
4.1安装网卡驱动
4.2设置网卡模式
4.3 配置网卡IP地址
4.4 设置网卡ROCE模式
cma_roce_mode -d <dev> -p <port> -m <1|2>
易失配置,通过mlxconfig工具设置网卡配置文件
4.5设置网卡QoS
Ibdev2netdev 查看ib网卡对应的以太网卡
查看网卡默认当前配置
mlnx_qos -i ens1np0 网卡当前配置
网卡优先级类型默认802p (PCP),改成dscp
mlnx_qos -i ens1np0 --trust=dscp 设置接口信任dscp
设置队列3 PFC,后面打流测试让RoCE v2 流量跑在队列3 之中
mlnx_qos -i ens1np0 -f 0,0,0,1,0,0,0,0 开启priority 3 pfc
设置网卡的调度策略
mlnx_qos -i ens1np0 -s ets,ets,ets,ets,ets,ets,strict,strict -t 10,10,10,50,10,10,0,0 设置出向队列调度,tc7,tc6严格优先级,tc0-5按权重轮询。
4.6 测试网卡流量数据
通过ib_send_bw命令在服务器上测试RDMA流量数据,ib_send_bw -h 帮助文档了解参数的使用方法。
在交换机上使用show interface counters queue ethernet 1 查看接口的队列的包流量信息。