Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2634666pxa; Mon, 17 Aug 2020 15:03:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzm+tK/jumlYTrUixaZmi0eKRxcQ38R7MJjPVGFyKaR3/Kons2NUF9T3mfJamVs6p/AzWHW X-Received: by 2002:aa7:cdd0:: with SMTP id h16mr17032690edw.116.1597701788242; Mon, 17 Aug 2020 15:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597701788; cv=none; d=google.com; s=arc-20160816; b=YtgJSwk6URbu8JIAZMGvahe/meS3kymy85MZyC4+pjxvJTJfEG/QTBhgmPu7NNonqZ xTX7f/2GsBRQyauOYGTuRh+bWPUqPGu8V0hsxOhBpYJer4GRGW/1dMcXougZMIJIyzCA 6E6tCrZujTaBwCzIjONuAhZ7C8p6DI52eHauCxQMhvHAJiObY6C3dZYmge99X9TOpnHp dHpm/4P+huR87A72yMyeOIUmDo9iL+IARSNMLraFvw95kW35NvTHVLTtCi1Rkh4yn0Tk CmvVjKKFpfgLrq1ARlATJOerGgkaVP3sRCT3X77o7V2OrbEoEimpVrf8u/oRI7PF5b/P umKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=s60g72bxEyv3o6ZRM4QL9i2bJBQPGkOwSFCmHQlNNe0=; b=gcPe11NL8ILy90OOmVMws1NLaAZfaJPJBgphGyER1WlUZ6gogrUNxYiRCuXJ7bv1ig OqnyVRaMXK5u5HJ3gHvuEsEZ2wX3fSQDoiwYnQsUpg3k/NpRGhu6wbteHxj73+XRyEtY I0zLM+g2dRV2Ul2TalSnbJFFtlF0K3mKUfkOj5SI7wmoFer1XBHtg1a6u4ZwF1Uz5U0m sf3ztQ+ra8OVJJaAWDxz8OW3P5DCDdopJbGLb+sA+vUrkYTLuF4KiNwCfewdYRa7JwDl 1kMCEKuZMWCGtuqlBUHaJwJxiRM0xSnzAN3BbgeC4IMYzAxPy+f2vk+doQTOz5YIBoKw g8OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KcgOr1hq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n20si11814043ejo.160.2020.08.17.15.02.44; Mon, 17 Aug 2020 15:03:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KcgOr1hq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730727AbgHQPlU (ORCPT + 99 others); Mon, 17 Aug 2020 11:41:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:36536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730394AbgHQPdi (ORCPT ); Mon, 17 Aug 2020 11:33:38 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C47BE22D2B; Mon, 17 Aug 2020 15:33:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597678418; bh=OizNdolFqPCsXRkXdorZxU6XFRZXjLoM4x3IYzceCvY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KcgOr1hqzBjrdljkThPO6/e495vq7efYhmsZrYYuhrXBhHeszjnwDXYPgWJegGEV/ nkXr0fPUfNrgUw9iJWVG5EWOg24z/694RD+SDEgG4RiU2LZ9W+Z3IFkySRtpEYNnq5 sdkKsemIimi8JZt9uKKUR1ukMfztvqFt/rzD041k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xi Wang , Weihang Li , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.8 328/464] RDMA/hns: Fix the unneeded process when getting a general type of CQE error Date: Mon, 17 Aug 2020 17:14:41 +0200 Message-Id: <20200817143849.501869614@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xi Wang [ Upstream commit 395f2e8fd340c5bfad026f5968b56ec34cf20dd1 ] 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/1595932941-40613-8-git-send-email-liweihang@huawei.com Signed-off-by: Xi Wang Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 9 +++++++++ drivers/infiniband/hw/hns/hns_roce_hw_v2.h | 1 + 2 files changed, 10 insertions(+) diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 9833ce3e21f9e..eb71b941d21b7 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -3053,6 +3053,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, @@ -3074,6 +3075,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 diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.h b/drivers/infiniband/hw/hns/hns_roce_hw_v2.h index e176b0aaa4ac2..e6c385ced1872 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.h +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.h @@ -230,6 +230,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, }; -- 2.25.1