1. 背景
Mellanox网卡提供了PCC(Programmable Congestion Control 可编程拥塞控制)用于给用户涉及和实现私有的拥塞控制算法。网卡里面有一个PPCC( Port Programmable Congestion Control 端口可编程拥塞控制)的寄存器提供给用户,允许用户配置和读取 PCC 算法及其参数/计数器。DPA(Data process Accelerate)是网卡中用于运行PCC的硬件加速单元核心。
Programmable Congestion Control (PCC) allows users to design and implement their own congestion control (CC) algorithm, giving them the flexibility to work out an optimal solution to handle congestion in their clusters. On BlueField-3 networking p latforms , PCC is provided as a component of DOCA.
The Port Programmable Congestion Control (PPCC) register allows the user to configure and read PCC algorithms and their parameters/counters.
主机-网卡-DPA的关系:
2. PPCC端口可编程拥塞控制
端口可编程拥塞控制 (PPCC) 寄存器允许用户配置和读取 PCC 算法及其参数/计数器。
它支持以下功能:
- 在不同的端口上启用不同的算法
- 查询算法和可调参数/计数器的信息
- 在不编译和重新烧录用户镜像的情况下更改算法参数
- 查询或清除可编程计数器
3. 配置命令类型
配置PPCC需要使用mlxreg的工具。配置方式:
# 获取
sudo mlxreg -d /dev/mst/mt41692_pciconf0 -y --get --op "cmd_type=0" --reg_name PPCC --indexes "local_port=1,pnat=0,lp_msb=0,algo_slot=0,algo_param_index=0"
# 设置
sudo mlxreg -d /dev/mst/mt41692_pciconf0 -y --set "cmd_type=1" --reg_name PPCC --indexes "local_port=1,pnat=0,lp_msb=0,algo_slot=0,algo_param_index=0"
其中
-d 指定设备可以是mst设备,也可以是BDF号。
-y 表示配置时候无需和用户交互确认,直接输入y,类似yum install -y的参数
设置的时候必须设置 cmd_type 和 索引index,cmd type用来指定命令类型作用。
配置的时候必须保持 doca_pcc 应用程序运行
配置的时候保持这三个index不变(local_port=1, pnat=0, lp_msb=0),具体这三个参数作用还未知。