Merge branch 'for-rc' into rdma.git for-next
authorJason Gunthorpe <jgg@nvidia.com>
Mon, 1 Nov 2021 18:08:19 +0000 (15:08 -0300)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 1 Nov 2021 18:08:19 +0000 (15:08 -0300)
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 <jgg@nvidia.com>
drivers/infiniband/hw/hns/hns_roce_hw_v2.c
drivers/infiniband/hw/qedr/verbs.c

index c2916b1..9bfbadd 100644 (file)
@@ -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;
index 48d2f6b..9100009 100644 (file)
@@ -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;