Commit 6a463bc9 authored by Jason Gunthorpe's avatar Jason Gunthorpe

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: default avatarJason Gunthorpe <jgg@nvidia.com>
parents a2a2a69d 4f960393
......@@ -3318,7 +3318,7 @@ static void hns_roce_v2_write_cqc(struct hns_roce_dev *hr_dev,
memset(cq_context, 0, sizeof(*cq_context));
hr_reg_write(cq_context, CQC_CQ_ST, V2_CQ_STATE_VALID);
hr_reg_write(cq_context, CQC_ARM_ST, REG_NXT_CEQE);
hr_reg_write(cq_context, CQC_ARM_ST, NO_ARMED);
hr_reg_write(cq_context, CQC_SHIFT, ilog2(hr_cq->cq_depth));
hr_reg_write(cq_context, CQC_CEQN, hr_cq->vector);
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,
mtu = ib_mtu_enum_to_int(ib_mtu);
if (WARN_ON(mtu <= 0))
return -EINVAL;
#define MAX_LP_MSG_LEN 65536
/* MTU * (2 ^ LP_PKTN_INI) shouldn't be bigger than 64KB */
#define MAX_LP_MSG_LEN 16384
/* MTU * (2 ^ LP_PKTN_INI) shouldn't be bigger than 16KB */
lp_pktn_ini = ilog2(MAX_LP_MSG_LEN / mtu);
if (WARN_ON(lp_pktn_ini >= 0xF))
return -EINVAL;
......
......@@ -2734,15 +2734,18 @@ int qedr_query_qp(struct ib_qp *ibqp,
int rc = 0;
memset(&params, 0, sizeof(params));
rc = dev->ops->rdma_query_qp(dev->rdma_ctx, qp->qed_qp, &params);
if (rc)
goto err;
memset(qp_attr, 0, sizeof(*qp_attr));
memset(qp_init_attr, 0, sizeof(*qp_init_attr));
qp_attr->qp_state = qedr_get_ibqp_state(params.state);
if (qp->qp_type != IB_QPT_GSI) {
rc = dev->ops->rdma_query_qp(dev->rdma_ctx, qp->qed_qp, &params);
if (rc)
goto err;
qp_attr->qp_state = qedr_get_ibqp_state(params.state);
} else {
qp_attr->qp_state = qedr_get_ibqp_state(QED_ROCE_QP_STATE_RTS);
}
qp_attr->cur_qp_state = qedr_get_ibqp_state(params.state);
qp_attr->path_mtu = ib_mtu_int_to_enum(params.mtu);
qp_attr->path_mig_state = IB_MIG_MIGRATED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment