Skip to content

Commit 6a463bc

Browse files
committed
Merge branch 'for-rc' into rdma.git for-next
Patches held over for a possible rc8. * for-rc: RDMA/qedr: Fix NULL deref for query_qp on the GSI QP RDMA/hns: Modify the value of MAX_LP_MSG_LEN to meet hardware compatibility RDMA/hns: Fix initial arm_st of CQ Signed-off-by: Jason Gunthorpe <[email protected]>
2 parents a2a2a69 + 4f96039 commit 6a463bc

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

drivers/infiniband/hw/hns/hns_roce_hw_v2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3318,7 +3318,7 @@ static void hns_roce_v2_write_cqc(struct hns_roce_dev *hr_dev,
33183318
memset(cq_context, 0, sizeof(*cq_context));
33193319

33203320
hr_reg_write(cq_context, CQC_CQ_ST, V2_CQ_STATE_VALID);
3321-
hr_reg_write(cq_context, CQC_ARM_ST, REG_NXT_CEQE);
3321+
hr_reg_write(cq_context, CQC_ARM_ST, NO_ARMED);
33223322
hr_reg_write(cq_context, CQC_SHIFT, ilog2(hr_cq->cq_depth));
33233323
hr_reg_write(cq_context, CQC_CEQN, hr_cq->vector);
33243324
hr_reg_write(cq_context, CQC_CQN, hr_cq->cqn);
@@ -4389,8 +4389,8 @@ static int modify_qp_init_to_rtr(struct ib_qp *ibqp,
43894389
mtu = ib_mtu_enum_to_int(ib_mtu);
43904390
if (WARN_ON(mtu <= 0))
43914391
return -EINVAL;
4392-
#define MAX_LP_MSG_LEN 65536
4393-
/* MTU * (2 ^ LP_PKTN_INI) shouldn't be bigger than 64KB */
4392+
#define MAX_LP_MSG_LEN 16384
4393+
/* MTU * (2 ^ LP_PKTN_INI) shouldn't be bigger than 16KB */
43944394
lp_pktn_ini = ilog2(MAX_LP_MSG_LEN / mtu);
43954395
if (WARN_ON(lp_pktn_ini >= 0xF))
43964396
return -EINVAL;

drivers/infiniband/hw/qedr/verbs.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2734,15 +2734,18 @@ int qedr_query_qp(struct ib_qp *ibqp,
27342734
int rc = 0;
27352735

27362736
memset(&params, 0, sizeof(params));
2737-
2738-
rc = dev->ops->rdma_query_qp(dev->rdma_ctx, qp->qed_qp, &params);
2739-
if (rc)
2740-
goto err;
2741-
27422737
memset(qp_attr, 0, sizeof(*qp_attr));
27432738
memset(qp_init_attr, 0, sizeof(*qp_init_attr));
27442739

2745-
qp_attr->qp_state = qedr_get_ibqp_state(params.state);
2740+
if (qp->qp_type != IB_QPT_GSI) {
2741+
rc = dev->ops->rdma_query_qp(dev->rdma_ctx, qp->qed_qp, &params);
2742+
if (rc)
2743+
goto err;
2744+
qp_attr->qp_state = qedr_get_ibqp_state(params.state);
2745+
} else {
2746+
qp_attr->qp_state = qedr_get_ibqp_state(QED_ROCE_QP_STATE_RTS);
2747+
}
2748+
27462749
qp_attr->cur_qp_state = qedr_get_ibqp_state(params.state);
27472750
qp_attr->path_mtu = ib_mtu_int_to_enum(params.mtu);
27482751
qp_attr->path_mig_state = IB_MIG_MIGRATED;

0 commit comments

Comments
 (0)