Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6657600 authored by Lijun Ou's avatar Lijun Ou Committed by Greg Kroah-Hartman
Browse files

RDMA/hns: Fix the bug with updating rq head pointer when flush cqe



[ Upstream commit 9c6ccc035c209dda07685e8dba829a203ba17499 ]

When flush cqe with srq, the driver disable to update the rq head pointer
into the hardware.

Signed-off-by: default avatarLijun Ou <oulijun@huawei.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 647e8d79
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -3503,6 +3503,8 @@ static int hns_roce_v2_modify_qp(struct ib_qp *ibqp,
		roce_set_field(qpc_mask->byte_160_sq_ci_pi,
			       V2_QPC_BYTE_160_SQ_PRODUCER_IDX_M,
			       V2_QPC_BYTE_160_SQ_PRODUCER_IDX_S, 0);

		if (!ibqp->srq) {
			roce_set_field(context->byte_84_rq_ci_pi,
			       V2_QPC_BYTE_84_RQ_PRODUCER_IDX_M,
			       V2_QPC_BYTE_84_RQ_PRODUCER_IDX_S,
@@ -3511,6 +3513,7 @@ static int hns_roce_v2_modify_qp(struct ib_qp *ibqp,
			       V2_QPC_BYTE_84_RQ_PRODUCER_IDX_M,
			       V2_QPC_BYTE_84_RQ_PRODUCER_IDX_S, 0);
		}
	}

	if (attr_mask & IB_QP_AV) {
		const struct ib_global_route *grh =
@@ -3971,6 +3974,7 @@ static void hns_roce_set_qps_to_err(struct hns_roce_dev *hr_dev, u32 qpn)
	if (hr_qp->ibqp.uobject) {
		if (hr_qp->sdb_en == 1) {
			hr_qp->sq.head = *(int *)(hr_qp->sdb.virt_addr);
			if (hr_qp->rdb_en == 1)
				hr_qp->rq.head = *(int *)(hr_qp->rdb.virt_addr);
		} else {
			dev_warn(hr_dev->dev, "flush cqe is unsupported in userspace!\n");