Skip to content

Commit 395f2e8

Browse files
wangxi11jgunthorpe
authored andcommitted
RDMA/hns: Fix the unneeded process when getting a general type of CQE error
If the hns ROCEE reports a general error CQE (types not specified by the IB General Specifications), it's no need to change the QP state to error, and the driver should just skip it. Fixes: 7c044ad ("RDMA/hns: Simplify the cqe code of poll cq") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Xi Wang <[email protected]> Signed-off-by: Weihang Li <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 4327bd2 commit 395f2e8

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

drivers/infiniband/hw/hns/hns_roce_hw_v2.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3046,6 +3046,7 @@ static void get_cqe_status(struct hns_roce_dev *hr_dev, struct hns_roce_qp *qp,
30463046
IB_WC_RETRY_EXC_ERR },
30473047
{ HNS_ROCE_CQE_V2_RNR_RETRY_EXC_ERR, IB_WC_RNR_RETRY_EXC_ERR },
30483048
{ HNS_ROCE_CQE_V2_REMOTE_ABORT_ERR, IB_WC_REM_ABORT_ERR },
3049+
{ HNS_ROCE_CQE_V2_GENERAL_ERR, IB_WC_GENERAL_ERR}
30493050
};
30503051

30513052
u32 cqe_status = roce_get_field(cqe->byte_4, V2_CQE_BYTE_4_STATUS_M,
@@ -3067,6 +3068,14 @@ static void get_cqe_status(struct hns_roce_dev *hr_dev, struct hns_roce_qp *qp,
30673068
print_hex_dump(KERN_ERR, "", DUMP_PREFIX_NONE, 16, 4, cqe,
30683069
sizeof(*cqe), false);
30693070

3071+
/*
3072+
* For hns ROCEE, GENERAL_ERR is an error type that is not defined in
3073+
* the standard protocol, the driver must ignore it and needn't to set
3074+
* the QP to an error state.
3075+
*/
3076+
if (cqe_status == HNS_ROCE_CQE_V2_GENERAL_ERR)
3077+
return;
3078+
30703079
/*
30713080
* Hip08 hardware cannot flush the WQEs in SQ/RQ if the QP state gets
30723081
* into errored mode. Hence, as a workaround to this hardware

drivers/infiniband/hw/hns/hns_roce_hw_v2.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ enum {
214214
HNS_ROCE_CQE_V2_TRANSPORT_RETRY_EXC_ERR = 0x15,
215215
HNS_ROCE_CQE_V2_RNR_RETRY_EXC_ERR = 0x16,
216216
HNS_ROCE_CQE_V2_REMOTE_ABORT_ERR = 0x22,
217+
HNS_ROCE_CQE_V2_GENERAL_ERR = 0x23,
217218

218219
HNS_ROCE_V2_CQE_STATUS_MASK = 0xff,
219220
};

0 commit comments

Comments
 (0)