From nobody Mon Sep 29 21:08:03 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0886C00140 for ; Tue, 16 Aug 2022 00:24:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353088AbiHPAYu (ORCPT ); Mon, 15 Aug 2022 20:24:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346164AbiHPAW6 (ORCPT ); Mon, 15 Aug 2022 20:22:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEEDBD292C; Mon, 15 Aug 2022 13:34:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 698A3B80EA8; Mon, 15 Aug 2022 20:33:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B86AEC433D6; Mon, 15 Aug 2022 20:33:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595625; bh=a6wrct/1vSDzdFquYxq7riEPjS5BzhdSsMye/0NyqSA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2ZDtsXlfvSUO28VfjnKMmtPzgM7oS5Wr8PCz2d+36pTLpW5Jr3U8S24NwsK/Z7cgH bvzNC3pZ6oPdFb92VSac24wJ9B7LqfMHBjr/1ABO5iPopNpK5GOfl/jThvuyrIgmVx xpiC5rQqlb6z6EUAKYFe/gpDE74ToYmHtLD9DGd8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mustafa Ismail , Shiraz Saleem , Leon Romanovsky , Sasha Levin Subject: [PATCH 5.19 0822/1157] RDMA/irdma: Fix setting of QP context err_rq_idx_valid field Date: Mon, 15 Aug 2022 20:02:58 +0200 Message-Id: <20220815180512.375371344@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Mustafa Ismail [ Upstream commit 3a844596ed71b7c12ac602f6f6b7b0f17e4d6a90 ] Setting err_rq_idx_valid field in QP context when the AE source of the AEQE is not associated with an RQ causes the firmware flush to fail. Set err_rq_idx_valid field in QP context only if it is associated with an RQ. Additionally, cleanup the redundant setting of this field in irdma_process_aeq. Fixes: 44d9e52977a1 ("RDMA/irdma: Implement device initialization definitio= ns") Link: https://lore.kernel.org/r/20220705230815.265-8-shiraz.saleem@intel.com Signed-off-by: Mustafa Ismail Signed-off-by: Shiraz Saleem Signed-off-by: Leon Romanovsky Signed-off-by: Sasha Levin --- drivers/infiniband/hw/irdma/hw.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/infiniband/hw/irdma/hw.c b/drivers/infiniband/hw/irdma= /hw.c index dd3943d22dc6..6bba1335993a 100644 --- a/drivers/infiniband/hw/irdma/hw.c +++ b/drivers/infiniband/hw/irdma/hw.c @@ -257,10 +257,6 @@ static void irdma_process_aeq(struct irdma_pci_f *rf) iwqp->last_aeq =3D info->ae_id; spin_unlock_irqrestore(&iwqp->lock, flags); ctx_info =3D &iwqp->ctx_info; - if (rdma_protocol_roce(&iwqp->iwdev->ibdev, 1)) - ctx_info->roce_info->err_rq_idx_valid =3D true; - else - ctx_info->iwarp_info->err_rq_idx_valid =3D true; } else { if (info->ae_id !=3D IRDMA_AE_CQ_OPERATION_ERROR) continue; @@ -370,16 +366,12 @@ static void irdma_process_aeq(struct irdma_pci_f *rf) case IRDMA_AE_LCE_FUNCTION_CATASTROPHIC: case IRDMA_AE_LCE_CQ_CATASTROPHIC: case IRDMA_AE_UDA_XMIT_DGRAM_TOO_LONG: - if (rdma_protocol_roce(&iwdev->ibdev, 1)) - ctx_info->roce_info->err_rq_idx_valid =3D false; - else - ctx_info->iwarp_info->err_rq_idx_valid =3D false; - fallthrough; default: ibdev_err(&iwdev->ibdev, "abnormal ae_id =3D 0x%x bool qp=3D%d qp_id = =3D %d\n", info->ae_id, info->qp, info->qp_cq_id); if (rdma_protocol_roce(&iwdev->ibdev, 1)) { - if (!info->sq && ctx_info->roce_info->err_rq_idx_valid) { + ctx_info->roce_info->err_rq_idx_valid =3D info->rq; + if (info->rq) { ctx_info->roce_info->err_rq_idx =3D info->wqe_idx; irdma_sc_qp_setctx_roce(&iwqp->sc_qp, iwqp->host_ctx.va, ctx_info); @@ -388,7 +380,8 @@ static void irdma_process_aeq(struct irdma_pci_f *rf) irdma_cm_disconn(iwqp); break; } - if (!info->sq && ctx_info->iwarp_info->err_rq_idx_valid) { + ctx_info->iwarp_info->err_rq_idx_valid =3D info->rq; + if (info->rq) { ctx_info->iwarp_info->err_rq_idx =3D info->wqe_idx; ctx_info->tcp_info_valid =3D false; ctx_info->iwarp_info_valid =3D true; --=20 2.35.1