Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2831995rwb; Mon, 15 Aug 2022 12:12:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR5/n8NTIUOEeemONX4GE56UPBo8GLUwD6sV+7Jnl4/hrUgGK28FEcuRjenfwgs6Gz8M/ma1 X-Received: by 2002:a17:902:f101:b0:16d:c0ae:acd5 with SMTP id e1-20020a170902f10100b0016dc0aeacd5mr18006149plb.70.1660590778276; Mon, 15 Aug 2022 12:12:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660590778; cv=none; d=google.com; s=arc-20160816; b=cPhA102DIy8y6Utc/DkUB7t3SvvDkpZJ0v3aZF9OpTs1BFnLxIGSgqt7Zdtw6+4SJm 6PaiBSBJfBzthRtZRnoebR9qce3OfQMjBM8i7Ag/+0Iv0IxqYLAA6+yEwzNDMWB+JXfl OG/uBKz+v68tIW8+StjDKQ9qFmv6SZFW3UUeFTWfKV2B0nYH/KnCO+YYzJ0z3OZvAEnH WwmwfwoH7QbfPYXWjtJmx39/7v2SnxtxjiP+Pv9rVsAPsyGnkYck/uLN/ih+sZeLdVbC X1PgzvPcLaWgJcEAieVA2b+rs10CJBaQoiosKnZOd/xcCsfkObnrtGllysbSPUpbnV5o c+nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=W38QOexTuyG68zCq+PtOFnY4ZvBZ3dwW5gbAjEUehhw=; b=pwr1kGgm2xpavl71FT0u8Qnu5fl069fXV4rSRUjLrhgYTMFZ2lrdWfNW1S7gaE6Lkt xxLMQNrq2xiSfDx6qmYlI32flao1gmP/XV6m+iLzjWPnVMp4gt/97RxFV9As7BrXFIop R6ROy0YxfVDKNj08B2YoVlscSMCjnzwfmCP1LXHG2A+cFuqGSWWtH+v6eJmx6cEtMlhy NTp5bMu73DsV2BHxq8YPALGNvLmPwX8n+TsPwZFQZci7aI6V4o9GGK7meTdEqxbNxole /rpY3rqnWiXqzppEN2XoEeTcpXmhNVb9B3UKSX7MBarDOYRf504CQ2Nsi5yzz+LT7k4F M9tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VP1MW0Va; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 136-20020a63018e000000b00421f0a9cd4esi11241180pgb.550.2022.08.15.12.12.45; Mon, 15 Aug 2022 12:12:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VP1MW0Va; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343708AbiHOTKZ (ORCPT + 99 others); Mon, 15 Aug 2022 15:10:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245210AbiHOTHA (ORCPT ); Mon, 15 Aug 2022 15:07:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3C266407; Mon, 15 Aug 2022 11:35:23 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 37FEE60FFD; Mon, 15 Aug 2022 18:35:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FF1DC433D6; Mon, 15 Aug 2022 18:35:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588522; bh=eX2NWuVLWaciWJvUAx+ClV4nlqaFeBff3kQfbkpS6UI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VP1MW0VaxTeTrX/msowzlsYpLsnLwIm4MT8C4aJiyuuBbeY3USSw8uxzhJ9PFdm/r +3tct63QBkS4H8NsEN2gSYDcfMv3bbK1OI221eRkLg4EX4RYEwKICPiyY49V57PujF hzdEAuMs0YIDlaFzhFXCSVNNpp/ROKDF0Yd3RanE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Himanshu Madhani , Quinn Tran , Nilesh Javali , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.15 423/779] scsi: qla2xxx: edif: Fix session thrash Date: Mon, 15 Aug 2022 20:01:07 +0200 Message-Id: <20220815180355.341190515@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Quinn Tran [ Upstream commit a8fdfb0b39c2b31722c70bdf2272b949d5af4b7b ] Current code prematurely sends out PRLI before authentication application has given the OK to do so. This causes PRLI failure and session teardown. Prevents PRLI from going out before authentication app gives the OK. Link: https://lore.kernel.org/r/20220608115849.16693-7-njavali@marvell.com Fixes: 91f6f5fbe87b ("scsi: qla2xxx: edif: Reduce connection thrash") Reviewed-by: Himanshu Madhani Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/qla2xxx/qla_edif.c | 2 +- drivers/scsi/qla2xxx/qla_edif.h | 4 ++++ drivers/scsi/qla2xxx/qla_init.c | 10 +++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c index c0971888a0a1..8e9237434e8b 100644 --- a/drivers/scsi/qla2xxx/qla_edif.c +++ b/drivers/scsi/qla2xxx/qla_edif.c @@ -3437,7 +3437,7 @@ int qla_edif_process_els(scsi_qla_host_t *vha, struct bsg_job *bsg_job) if (qla_bsg_check(vha, bsg_job, fcport)) return 0; - if (fcport->loop_id == FC_NO_LOOP_ID) { + if (EDIF_SESS_DELETE(fcport)) { ql_dbg(ql_dbg_edif, vha, 0x910d, "%s ELS code %x, no loop id.\n", __func__, bsg_request->rqst_data.r_els.els_code); diff --git a/drivers/scsi/qla2xxx/qla_edif.h b/drivers/scsi/qla2xxx/qla_edif.h index a965ca8e47ce..b9cedf6defd9 100644 --- a/drivers/scsi/qla2xxx/qla_edif.h +++ b/drivers/scsi/qla2xxx/qla_edif.h @@ -140,4 +140,8 @@ struct enode { (DBELL_ACTIVE(_fcport->vha) && \ (_fcport->disc_state == DSC_LOGIN_AUTH_PEND)) +#define EDIF_SESS_DELETE(_s) \ + (qla_ini_mode_enabled(_s->vha) && (_s->disc_state == DSC_DELETE_PEND || \ + _s->disc_state == DSC_DELETED)) + #endif /* __QLA_EDIF_H */ diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 49cfe8c9f3bb..edc29d6ebb28 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1764,8 +1764,16 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) break; case DSC_LOGIN_PEND: - if (fcport->fw_login_state == DSC_LS_PLOGI_COMP) + if (vha->hw->flags.edif_enabled) + break; + + if (fcport->fw_login_state == DSC_LS_PLOGI_COMP) { + ql_dbg(ql_dbg_disc, vha, 0x2118, + "%s %d %8phC post %s PRLI\n", + __func__, __LINE__, fcport->port_name, + NVME_TARGET(vha->hw, fcport) ? "NVME" : "FC"); qla24xx_post_prli_work(vha, fcport); + } break; case DSC_UPD_FCPORT: -- 2.35.1