Commit c3a0ccf9 authored by ZhouJuan's avatar ZhouJuan
Browse files

Revert "RDMA/hns: Fix timeout attr in query qp for HIP08"

driver inclusion
category: cleanup
bugzilla: https://gitee.com/openeuler/kernel/issues/I7RKQ1



---------------------------------------------------------------------------

This reverts commit ca69b2a2.

Signed-off-by: default avatarJuan Zhou <zhoujuan51@h-partners.com>
parent a6c6fdce
Loading
Loading
Loading
Loading
+3 −14
Original line number Diff line number Diff line
@@ -5334,6 +5334,7 @@ static int hns_roce_v2_set_abs_fields(struct ib_qp *ibqp,
static bool check_qp_timeout_cfg_range(struct hns_roce_dev *hr_dev, u8 *timeout)
{
#define QP_ACK_TIMEOUT_MAX_HIP08 20
#define QP_ACK_TIMEOUT_OFFSET 10
#define QP_ACK_TIMEOUT_MAX 31

	if (hr_dev->pci_dev->revision == PCI_REVISION_ID_HIP08) {
@@ -5342,7 +5343,7 @@ static bool check_qp_timeout_cfg_range(struct hns_roce_dev *hr_dev, u8 *timeout)
				   "Local ACK timeout shall be 0 to 20.\n");
			return false;
		}
		*timeout += HNS_ROCE_V2_QP_ACK_TIMEOUT_OFS_HIP08;
		*timeout += QP_ACK_TIMEOUT_OFFSET;
	} else if (hr_dev->pci_dev->revision > PCI_REVISION_ID_HIP08) {
		if (*timeout > QP_ACK_TIMEOUT_MAX) {
			ibdev_warn(&hr_dev->ib_dev,
@@ -5672,18 +5673,6 @@ static int hns_roce_v2_query_qpc(struct hns_roce_dev *hr_dev, u32 qpn,
	return ret;
}

static u8 get_qp_timeout_attr(struct hns_roce_dev *hr_dev,
			      struct hns_roce_v2_qp_context *context)
{
	u8 timeout;

	timeout = (u8)hr_reg_read(context, QPC_AT);
	if (hr_dev->pci_dev->revision == PCI_REVISION_ID_HIP08)
		timeout -= HNS_ROCE_V2_QP_ACK_TIMEOUT_OFS_HIP08;

	return timeout;
}

static int hns_roce_v2_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr,
				int qp_attr_mask,
				struct ib_qp_init_attr *qp_init_attr)
@@ -5761,7 +5750,7 @@ static int hns_roce_v2_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr,
	qp_attr->max_dest_rd_atomic = 1 << hr_reg_read(&context, QPC_RR_MAX);

	qp_attr->min_rnr_timer = (u8)hr_reg_read(&context, QPC_MIN_RNR_TIME);
	qp_attr->timeout = get_qp_timeout_attr(hr_dev, &context);
	qp_attr->timeout = (u8)hr_reg_read(&context, QPC_AT);
	qp_attr->retry_cnt = hr_reg_read(&context, QPC_RETRY_NUM_INIT);
	qp_attr->rnr_retry = hr_reg_read(&context, QPC_RNR_NUM_INIT);

+0 −2
Original line number Diff line number Diff line
@@ -42,8 +42,6 @@
#define HNS_ROCE_V2_MAX_SRQWQE_SEGS		0x1000000
#define HNS_ROCE_V2_MAX_IDX_SEGS		0x1000000

#define HNS_ROCE_V2_QP_ACK_TIMEOUT_OFS_HIP08    10

#define HNS_ROCE_V3_SCCC_SZ			64
#define HNS_ROCE_V3_GMV_ENTRY_SZ		32