Skip to content

Commit 12d0447

Browse files
MarkZhang81rleon
authored andcommitted
IB/mlx5: Set and get correct qp_num for a DCT QP
When a DCT QP is created on an active lag, it's dctc.port is assigned in a round-robin way, which is from 1 to dev->lag_port. In this case when querying this QP, we may get qp_attr.port_num > 2. Fix this by setting qp->port when modifying a DCT QP, and read port_num from qp->port instead of dctc.port when querying it. Fixes: 7c4b1ab ("IB/mlx5: Add DCT RoCE LAG support") Signed-off-by: Mark Zhang <[email protected]> Reviewed-by: Maher Sanalla <[email protected]> Link: https://patch.msgid.link/94c76bf0adbea997f87ffa27674e0a7118ad92a9.1737290358.git.leon@kernel.org Signed-off-by: Leon Romanovsky <[email protected]>
1 parent d97505b commit 12d0447

File tree

1 file changed

+3
-1
lines changed
  • drivers/infiniband/hw/mlx5

1 file changed

+3
-1
lines changed

drivers/infiniband/hw/mlx5/qp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4579,6 +4579,8 @@ static int mlx5_ib_modify_dct(struct ib_qp *ibqp, struct ib_qp_attr *attr,
45794579

45804580
set_id = mlx5_ib_get_counters_id(dev, attr->port_num - 1);
45814581
MLX5_SET(dctc, dctc, counter_set_id, set_id);
4582+
4583+
qp->port = attr->port_num;
45824584
} else if (cur_state == IB_QPS_INIT && new_state == IB_QPS_RTR) {
45834585
struct mlx5_ib_modify_qp_resp resp = {};
45844586
u32 out[MLX5_ST_SZ_DW(create_dct_out)] = {};
@@ -5074,7 +5076,7 @@ static int mlx5_ib_dct_query_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *mqp,
50745076
}
50755077

50765078
if (qp_attr_mask & IB_QP_PORT)
5077-
qp_attr->port_num = MLX5_GET(dctc, dctc, port);
5079+
qp_attr->port_num = mqp->port;
50785080
if (qp_attr_mask & IB_QP_MIN_RNR_TIMER)
50795081
qp_attr->min_rnr_timer = MLX5_GET(dctc, dctc, min_rnr_nak);
50805082
if (qp_attr_mask & IB_QP_AV) {

0 commit comments

Comments
 (0)