Commit 997aa9b3 authored by Yixing Liu's avatar Yixing Liu Committed by ZhouJuan
Browse files

RDMA/hns: Remove the num_qpc_timer variable

mainline inclusion
from mainline-v6.0-rc5
commit 45baad7d
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7WVK1
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=45baad7dd98f4d83f67c86c28769d3184390e324

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

The bt number of qpc_timer of HIP09 increases compared with that of HIP08.
Therefore, qpc_timer_bt_num and num_qpc_timer do not match. As a result,
the driver may fail to allocate qpc_timer. So the driver needs to uniquely
uses qpc_timer_bt_num to represent the bt number of qpc_timer.

Fixes: 0e40dc2f ("RDMA/hns: Add timer allocation support for hip08")
Link: https://lore.kernel.org/r/20220829105021.1427804-4-liangwenpeng@huawei.com


Signed-off-by: default avatarYixing Liu <liuyixing1@huawei.com>
Signed-off-by: default avatarWenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarJuan Zhou <zhoujuan51@h-partners.com>
parent 4ffd72b5
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -797,7 +797,6 @@ struct hns_roce_caps {
	u32		rsv0;
	u32		num_qps;
	u32		reserved_qps;
	int		num_qpc_timer;
	u32		num_srqs;
	u32		max_wqes;
	u32		max_srq_wrs;
+0 −1
Original line number Diff line number Diff line
@@ -2331,7 +2331,6 @@ static int hns_roce_query_caps(struct hns_roce_dev *hr_dev)
	caps->max_sq_inline = le16_to_cpu(resp_a->max_sq_inline);
	caps->max_rq_sg = le16_to_cpu(resp_a->max_rq_sg);
	caps->max_rq_sg = roundup_pow_of_two(caps->max_rq_sg);
	caps->num_qpc_timer = le16_to_cpu(resp_a->num_qpc_timer);
	caps->max_srq_sges = le16_to_cpu(resp_a->max_srq_sges);
	caps->max_srq_sges = roundup_pow_of_two(caps->max_srq_sges);
	caps->num_aeq_vectors = resp_a->num_aeq_vectors;
+1 −1
Original line number Diff line number Diff line
@@ -1180,7 +1180,7 @@ static int hns_roce_init_hem(struct hns_roce_dev *hr_dev)
		ret = hns_roce_init_hem_table(hr_dev, &hr_dev->qpc_timer_table,
					      HEM_TYPE_QPC_TIMER,
					      hr_dev->caps.qpc_timer_entry_sz,
					      hr_dev->caps.num_qpc_timer);
					      hr_dev->caps.qpc_timer_bt_num);
		if (ret) {
			dev_err(dev,
				"Failed to init QPC timer memory, aborting.\n");