Skip to content

Commit 4a2da0b

Browse files
paravmellanoxdledford
authored andcommitted
IB/mlx5: Add debug control parameters for congestion control
This patch adds debug control parameters for congestion control which can be read or written through debugfs. They are for reaction point and notification point nodes. These control parameters are as below: +------------------------------+-----------------------------------------+ | Name | Description | |------------------------------+-----------------------------------------| |rp_clamp_tgt_rate | When set target rate is updated to | | | current rate | |------------------------------+-----------------------------------------| |rp_clamp_tgt_rate_ati | When set update target rate based on | | | timer as well | |------------------------------+-----------------------------------------| |rp_time_reset | time between rate increase if no | | | CNP is received unit in usec | |------------------------------+-----------------------------------------| |rp_byte_reset | Number of bytes between rate inease if | | | no CNP is received | |------------------------------+-----------------------------------------| |rp_threshold | Threshold for reaction point rate | | | control | |------------------------------+-----------------------------------------| |rp_ai_rate | Rate for target rate, unit in Mbps | |------------------------------+-----------------------------------------| |rp_hai_rate | Rate for hyper increase state | | | unit in Mbps | |------------------------------+-----------------------------------------| |rp_min_dec_fac | Minimum factor by which the current | | | transmit rate can be changed when | | | processing a CNP, unit is percerntage | |------------------------------+-----------------------------------------| |rp_min_rate | Minimum value for rate limit, | | | unit in Mbps | |------------------------------+-----------------------------------------| |rp_rate_to_set_on_first_cnp | Rate that is set when first CNP is | | | received, unit is Mbps | |------------------------------+-----------------------------------------| |rp_dce_tcp_g | Used to calculate alpha | |------------------------------+-----------------------------------------| |rp_dce_tcp_rtt | Time between updates of alpha value, | | | unit is usec | |------------------------------+-----------------------------------------| |rp_rate_reduce_monitor_period | Minimum time between consecutive rate | | | reductions | |------------------------------+-----------------------------------------| |rp_initial_alpha_value | Initial value of alpha | |------------------------------+-----------------------------------------| |rp_gd | When CNP is received, flow rate is | | | reduced based on gd, rp_gd is given as | | | log2(rp_gd) | |------------------------------+-----------------------------------------| |np_cnp_dscp | dscp code point for generated cnp | |------------------------------+-----------------------------------------| |np_cnp_prio_mode | 802.1p priority for generated cnp | |------------------------------+-----------------------------------------| |np_cnp_prio | cnp priority mode | +------------------------------+-----------------------------------------+ Signed-off-by: Parav Pandit <parav@mellanox.com> Reviewed-by: Daniel Jurgens <danielj@mellanox.com> Reviewed-by: Eli Cohen <eli@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Doug Ledford <dledford@redhat.com>
1 parent fd65f1b commit 4a2da0b

File tree

7 files changed

+493
-3
lines changed

7 files changed

+493
-3
lines changed

drivers/infiniband/hw/mlx5/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
obj-$(CONFIG_MLX5_INFINIBAND) += mlx5_ib.o
22

3-
mlx5_ib-y := main.o cq.o doorbell.o qp.o mem.o srq.o mr.o ah.o mad.o gsi.o ib_virt.o cmd.o
3+
mlx5_ib-y := main.o cq.o doorbell.o qp.o mem.o srq.o mr.o ah.o mad.o gsi.o ib_virt.o cmd.o cong.o
44
mlx5_ib-$(CONFIG_INFINIBAND_ON_DEMAND_PAGING) += odp.o

drivers/infiniband/hw/mlx5/cmd.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,23 @@ int mlx5_cmd_query_cong_counter(struct mlx5_core_dev *dev,
5757
MLX5_SET(query_cong_statistics_in, in, clear, reset);
5858
return mlx5_cmd_exec(dev, in, sizeof(in), out, out_size);
5959
}
60+
61+
int mlx5_cmd_query_cong_params(struct mlx5_core_dev *dev, int cong_point,
62+
void *out, int out_size)
63+
{
64+
u32 in[MLX5_ST_SZ_DW(query_cong_params_in)] = { };
65+
66+
MLX5_SET(query_cong_params_in, in, opcode,
67+
MLX5_CMD_OP_QUERY_CONG_PARAMS);
68+
MLX5_SET(query_cong_params_in, in, cong_protocol, cong_point);
69+
70+
return mlx5_cmd_exec(dev, in, sizeof(in), out, out_size);
71+
}
72+
73+
int mlx5_cmd_modify_cong_params(struct mlx5_core_dev *dev,
74+
void *in, int in_size)
75+
{
76+
u32 out[MLX5_ST_SZ_DW(modify_cong_params_out)] = { };
77+
78+
return mlx5_cmd_exec(dev, in, in_size, out, sizeof(out));
79+
}

drivers/infiniband/hw/mlx5/cmd.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,8 @@
3939
int mlx5_cmd_null_mkey(struct mlx5_core_dev *dev, u32 *null_mkey);
4040
int mlx5_cmd_query_cong_counter(struct mlx5_core_dev *dev,
4141
bool reset, void *out, int out_size);
42+
int mlx5_cmd_query_cong_params(struct mlx5_core_dev *dev, int cong_point,
43+
void *out, int out_size);
44+
int mlx5_cmd_modify_cong_params(struct mlx5_core_dev *mdev,
45+
void *in, int in_size);
4246
#endif /* MLX5_IB_CMD_H */

0 commit comments

Comments
 (0)