Skip to content

Commit 45baad7

Browse files
Yixing Liurleon
authored andcommitted
RDMA/hns: Remove the num_qpc_timer variable
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: 0e40dc2 ("RDMA/hns: Add timer allocation support for hip08") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Yixing Liu <[email protected]> Signed-off-by: Wenpeng Liang <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 0c8b5d6 commit 45baad7

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

drivers/infiniband/hw/hns/hns_roce_device.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,6 @@ struct hns_roce_caps {
730730
u32 num_qps;
731731
u32 num_pi_qps;
732732
u32 reserved_qps;
733-
int num_qpc_timer;
734733
u32 num_srqs;
735734
u32 max_wqes;
736735
u32 max_srq_wrs;

drivers/infiniband/hw/hns/hns_roce_hw_v2.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,7 +1977,7 @@ static void set_default_caps(struct hns_roce_dev *hr_dev)
19771977

19781978
caps->num_mtpts = HNS_ROCE_V2_MAX_MTPT_NUM;
19791979
caps->num_pds = HNS_ROCE_V2_MAX_PD_NUM;
1980-
caps->num_qpc_timer = HNS_ROCE_V2_MAX_QPC_TIMER_NUM;
1980+
caps->qpc_timer_bt_num = HNS_ROCE_V2_MAX_QPC_TIMER_BT_NUM;
19811981
caps->cqc_timer_bt_num = HNS_ROCE_V2_MAX_CQC_TIMER_BT_NUM;
19821982

19831983
caps->max_qp_init_rdma = HNS_ROCE_V2_MAX_QP_INIT_RDMA;
@@ -2273,7 +2273,6 @@ static int hns_roce_query_pf_caps(struct hns_roce_dev *hr_dev)
22732273
caps->max_rq_sg = le16_to_cpu(resp_a->max_rq_sg);
22742274
caps->max_rq_sg = roundup_pow_of_two(caps->max_rq_sg);
22752275
caps->max_extend_sg = le32_to_cpu(resp_a->max_extend_sg);
2276-
caps->num_qpc_timer = le16_to_cpu(resp_a->num_qpc_timer);
22772276
caps->max_srq_sges = le16_to_cpu(resp_a->max_srq_sges);
22782277
caps->max_srq_sges = roundup_pow_of_two(caps->max_srq_sges);
22792278
caps->num_aeq_vectors = resp_a->num_aeq_vectors;

drivers/infiniband/hw/hns/hns_roce_hw_v2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
#include <linux/bitops.h>
3737

3838
#define HNS_ROCE_V2_MAX_QP_NUM 0x1000
39-
#define HNS_ROCE_V2_MAX_QPC_TIMER_NUM 0x200
4039
#define HNS_ROCE_V2_MAX_WQE_NUM 0x8000
4140
#define HNS_ROCE_V2_MAX_SRQ_WR 0x8000
4241
#define HNS_ROCE_V2_MAX_SRQ_SGE 64
4342
#define HNS_ROCE_V2_MAX_CQ_NUM 0x100000
43+
#define HNS_ROCE_V2_MAX_QPC_TIMER_BT_NUM 0x100
4444
#define HNS_ROCE_V2_MAX_CQC_TIMER_BT_NUM 0x100
4545
#define HNS_ROCE_V2_MAX_SRQ_NUM 0x100000
4646
#define HNS_ROCE_V2_MAX_CQE_NUM 0x400000

drivers/infiniband/hw/hns/hns_roce_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ static int hns_roce_init_hem(struct hns_roce_dev *hr_dev)
725725
ret = hns_roce_init_hem_table(hr_dev, &hr_dev->qpc_timer_table,
726726
HEM_TYPE_QPC_TIMER,
727727
hr_dev->caps.qpc_timer_entry_sz,
728-
hr_dev->caps.num_qpc_timer, 1);
728+
hr_dev->caps.qpc_timer_bt_num, 1);
729729
if (ret) {
730730
dev_err(dev,
731731
"Failed to init QPC timer memory, aborting.\n");

0 commit comments

Comments
 (0)