]> Git Repo - linux.git/commitdiff
RDMA/hns: Fix the unneeded process when getting a general type of CQE error
authorXi Wang <[email protected]>
Tue, 28 Jul 2020 10:42:21 +0000 (18:42 +0800)
committerJason Gunthorpe <[email protected]>
Thu, 30 Jul 2020 18:11:49 +0000 (15:11 -0300)
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: 7c044adca272 ("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]>
drivers/infiniband/hw/hns/hns_roce_hw_v2.c
drivers/infiniband/hw/hns/hns_roce_hw_v2.h

index 0c81100667fa50d393efeda66bdd39edb83e7f37..d51b332ece5bdcb712a1f6ea192d3cf81faced5e 100644 (file)
@@ -3046,6 +3046,7 @@ static void get_cqe_status(struct hns_roce_dev *hr_dev, struct hns_roce_qp *qp,
                  IB_WC_RETRY_EXC_ERR },
                { HNS_ROCE_CQE_V2_RNR_RETRY_EXC_ERR, IB_WC_RNR_RETRY_EXC_ERR },
                { HNS_ROCE_CQE_V2_REMOTE_ABORT_ERR, IB_WC_REM_ABORT_ERR },
+               { HNS_ROCE_CQE_V2_GENERAL_ERR, IB_WC_GENERAL_ERR}
        };
 
        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,
        print_hex_dump(KERN_ERR, "", DUMP_PREFIX_NONE, 16, 4, cqe,
                       sizeof(*cqe), false);
 
+       /*
+        * For hns ROCEE, GENERAL_ERR is an error type that is not defined in
+        * the standard protocol, the driver must ignore it and needn't to set
+        * the QP to an error state.
+        */
+       if (cqe_status == HNS_ROCE_CQE_V2_GENERAL_ERR)
+               return;
+
        /*
         * Hip08 hardware cannot flush the WQEs in SQ/RQ if the QP state gets
         * into errored mode. Hence, as a workaround to this hardware
index 53c26f380f25883e5e95fe712d5d69ce3f64fa9e..1fb1c583d0f8fbabf7dc3c0781684c50de50ecd9 100644 (file)
@@ -214,6 +214,7 @@ enum {
        HNS_ROCE_CQE_V2_TRANSPORT_RETRY_EXC_ERR         = 0x15,
        HNS_ROCE_CQE_V2_RNR_RETRY_EXC_ERR               = 0x16,
        HNS_ROCE_CQE_V2_REMOTE_ABORT_ERR                = 0x22,
+       HNS_ROCE_CQE_V2_GENERAL_ERR                     = 0x23,
 
        HNS_ROCE_V2_CQE_STATUS_MASK                     = 0xff,
 };
This page took 0.075282 seconds and 4 git commands to generate.