Commit dadff1bc authored by Junxian Huang's avatar Junxian Huang Committed by Juan Zhou
Browse files

RDMA/hns: Fix incorrect congest type configuration

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8HYSU



--------------------------------------------------------------------------

hr_dev->caps.congest_type stands for the supported algorithm set, but
not the specific algorithm type. The correct configuration item should
be ilog2(hr_qp->congest_type).

Fixes: 09f1b7cb ("RDMA/hns: Support congestion control algorithm configuration at QP granularity")
Signed-off-by: default avatarJunxian Huang <huangjunxian6@hisilicon.com>
parent a49c547e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -5171,6 +5171,7 @@ static int fill_congest_field(struct ib_qp *ibqp, const struct ib_qp_attr *attr,
	struct hns_roce_congestion_algorithm congest_field;
	struct ib_device *ibdev = ibqp->device;
	struct hns_roce_dev *hr_dev = to_hr_dev(ibdev);
	struct hns_roce_qp *hr_qp = to_hr_qp(ibqp);
	u32 dip_idx = 0;
	int ret;

@@ -5184,7 +5185,7 @@ static int fill_congest_field(struct ib_qp *ibqp, const struct ib_qp_attr *attr,

	hr_reg_write(context, QPC_CONGEST_ALGO_TMPL_ID,
		     hr_dev->congest_algo_tmpl_id +
		     hr_dev->caps.congest_type * HNS_ROCE_CONGEST_SIZE);
		     ilog2(hr_qp->congest_type) * HNS_ROCE_CONGEST_SIZE);
	hr_reg_clear(qpc_mask, QPC_CONGEST_ALGO_TMPL_ID);
	hr_reg_write(&context->ext, QPCEX_CONGEST_ALG_SEL,
		     congest_field.alg_sel);