Skip to content

Commit 0099baa

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
Pull rdma fixes from Jason Gunthorpe: "Many bug fixes in several drivers: - Fix misuse of the DMA API in rtrs - Several irdma issues: hung task due to SQ flushing, incorrect capability reporting to userspace, improper error handling for MW corners, touching an uninitialized SGL for during invalidation. - hns was using the wrong page size limits for the HW, an incorrect calculation of wqe_shift causing WQE corruption, and mis computed a timer id. - Fix a crash in SRP triggered by blktests - Fix compiler errors by calling virt_to_page() with the proper type in siw - Userspace triggerable deadlock in ODP - mlx5 could use the wrong profile due to some driver loading races, counters were not working in some device configurations, and a crash on error unwind" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/irdma: Report RNR NAK generation in device caps RDMA/irdma: Use s/g array in post send only when its valid RDMA/irdma: Return correct WC error for bind operation failure RDMA/irdma: Return error on MR deregister CQP failure RDMA/irdma: Report the correct max cqes from query device MAINTAINERS: Update maintainers of HiSilicon RoCE RDMA/mlx5: Fix UMR cleanup on error flow of driver init RDMA/mlx5: Set local port to one when accessing counters RDMA/mlx5: Rely on RoCE fw cap instead of devlink when setting profile IB/core: Fix a nested dead lock as part of ODP flow RDMA/siw: Pass a pointer to virt_to_page() RDMA/srp: Set scmnd->result only when scmnd is not NULL RDMA/hns: Remove the num_qpc_timer variable RDMA/hns: Fix wrong fixed value of qp->rq.wqe_shift RDMA/hns: Fix supported page size RDMA/cma: Fix arguments order in net device validation RDMA/irdma: Fix drain SQ hang with no completion RDMA/rtrs-srv: Pass the correct number of entries for dma mapped SGL RDMA/rtrs-clt: Use the right sg_cnt after ib_dma_map_sg
2 parents b7e00d6 + a261786 commit 0099baa

File tree

22 files changed

+105
-54
lines changed

22 files changed

+105
-54
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9208,8 +9208,8 @@ F: Documentation/ABI/testing/debugfs-hisi-zip
92089208
F: drivers/crypto/hisilicon/zip/
92099209

92109210
HISILICON ROCE DRIVER
9211+
M: Haoyue Xu <[email protected]>
92119212
M: Wenpeng Liang <[email protected]>
9212-
M: Weihang Li <[email protected]>
92139213
92149214
S: Maintained
92159215
F: Documentation/devicetree/bindings/infiniband/hisilicon-hns-roce.txt

drivers/infiniband/core/cma.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1841,8 +1841,8 @@ cma_ib_id_from_event(struct ib_cm_id *cm_id,
18411841
}
18421842

18431843
if (!validate_net_dev(*net_dev,
1844-
(struct sockaddr *)&req->listen_addr_storage,
1845-
(struct sockaddr *)&req->src_addr_storage)) {
1844+
(struct sockaddr *)&req->src_addr_storage,
1845+
(struct sockaddr *)&req->listen_addr_storage)) {
18461846
id_priv = ERR_PTR(-EHOSTUNREACH);
18471847
goto err;
18481848
}

drivers/infiniband/core/umem_odp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ int ib_umem_odp_map_dma_and_lock(struct ib_umem_odp *umem_odp, u64 user_virt,
462462
mutex_unlock(&umem_odp->umem_mutex);
463463

464464
out_put_mm:
465-
mmput(owning_mm);
465+
mmput_async(owning_mm);
466466
out_put_task:
467467
if (owning_process)
468468
put_task_struct(owning_process);

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: 2 additions & 2 deletions
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
@@ -83,7 +83,7 @@
8383

8484
#define HNS_ROCE_V2_QPC_TIMER_ENTRY_SZ PAGE_SIZE
8585
#define HNS_ROCE_V2_CQC_TIMER_ENTRY_SZ PAGE_SIZE
86-
#define HNS_ROCE_V2_PAGE_SIZE_SUPPORTED 0xFFFFF000
86+
#define HNS_ROCE_V2_PAGE_SIZE_SUPPORTED 0xFFFF000
8787
#define HNS_ROCE_V2_MAX_INNER_MTPT_NUM 2
8888
#define HNS_ROCE_INVALID_LKEY 0x0
8989
#define HNS_ROCE_INVALID_SGE_LENGTH 0x80000000

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");

drivers/infiniband/hw/hns/hns_roce_qp.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -462,11 +462,8 @@ static int set_rq_size(struct hns_roce_dev *hr_dev, struct ib_qp_cap *cap,
462462
hr_qp->rq.max_gs = roundup_pow_of_two(max(1U, cap->max_recv_sge) +
463463
hr_qp->rq.rsv_sge);
464464

465-
if (hr_dev->caps.max_rq_sg <= HNS_ROCE_SGE_IN_WQE)
466-
hr_qp->rq.wqe_shift = ilog2(hr_dev->caps.max_rq_desc_sz);
467-
else
468-
hr_qp->rq.wqe_shift = ilog2(hr_dev->caps.max_rq_desc_sz *
469-
hr_qp->rq.max_gs);
465+
hr_qp->rq.wqe_shift = ilog2(hr_dev->caps.max_rq_desc_sz *
466+
hr_qp->rq.max_gs);
470467

471468
hr_qp->rq.wqe_cnt = cnt;
472469
if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_RQ_INLINE &&

drivers/infiniband/hw/irdma/uk.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,8 @@ int irdma_uk_send(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info,
497497
FIELD_PREP(IRDMAQPSQ_IMMDATA, info->imm_data));
498498
i = 0;
499499
} else {
500-
qp->wqe_ops.iw_set_fragment(wqe, 0, op_info->sg_list,
500+
qp->wqe_ops.iw_set_fragment(wqe, 0,
501+
frag_cnt ? op_info->sg_list : NULL,
501502
qp->swqe_polarity);
502503
i = 1;
503504
}
@@ -1005,6 +1006,7 @@ int irdma_uk_cq_poll_cmpl(struct irdma_cq_uk *cq,
10051006
int ret_code;
10061007
bool move_cq_head = true;
10071008
u8 polarity;
1009+
u8 op_type;
10081010
bool ext_valid;
10091011
__le64 *ext_cqe;
10101012

@@ -1187,7 +1189,6 @@ int irdma_uk_cq_poll_cmpl(struct irdma_cq_uk *cq,
11871189
do {
11881190
__le64 *sw_wqe;
11891191
u64 wqe_qword;
1190-
u8 op_type;
11911192
u32 tail;
11921193

11931194
tail = qp->sq_ring.tail;
@@ -1204,6 +1205,8 @@ int irdma_uk_cq_poll_cmpl(struct irdma_cq_uk *cq,
12041205
break;
12051206
}
12061207
} while (1);
1208+
if (op_type == IRDMA_OP_TYPE_BIND_MW && info->minor_err == FLUSH_PROT_ERR)
1209+
info->minor_err = FLUSH_MW_BIND_ERR;
12071210
qp->sq_flush_seen = true;
12081211
if (!IRDMA_RING_MORE_WORK(qp->sq_ring))
12091212
qp->sq_flush_complete = true;

drivers/infiniband/hw/irdma/utils.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -590,11 +590,14 @@ static int irdma_wait_event(struct irdma_pci_f *rf,
590590
cqp_error = cqp_request->compl_info.error;
591591
if (cqp_error) {
592592
err_code = -EIO;
593-
if (cqp_request->compl_info.maj_err_code == 0xFFFF &&
594-
cqp_request->compl_info.min_err_code == 0x8029) {
595-
if (!rf->reset) {
596-
rf->reset = true;
597-
rf->gen_ops.request_reset(rf);
593+
if (cqp_request->compl_info.maj_err_code == 0xFFFF) {
594+
if (cqp_request->compl_info.min_err_code == 0x8002)
595+
err_code = -EBUSY;
596+
else if (cqp_request->compl_info.min_err_code == 0x8029) {
597+
if (!rf->reset) {
598+
rf->reset = true;
599+
rf->gen_ops.request_reset(rf);
600+
}
598601
}
599602
}
600603
}
@@ -2598,7 +2601,7 @@ void irdma_generate_flush_completions(struct irdma_qp *iwqp)
25982601
spin_unlock_irqrestore(&iwqp->lock, flags2);
25992602
spin_unlock_irqrestore(&iwqp->iwscq->lock, flags1);
26002603
if (compl_generated)
2601-
irdma_comp_handler(iwqp->iwrcq);
2604+
irdma_comp_handler(iwqp->iwscq);
26022605
} else {
26032606
spin_unlock_irqrestore(&iwqp->iwscq->lock, flags1);
26042607
mod_delayed_work(iwqp->iwdev->cleanup_wq, &iwqp->dwork_flush,

0 commit comments

Comments
 (0)