Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3260707rwb; Mon, 15 Aug 2022 22:35:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR72eDLda9QimHPC6zuA3OTx796Nfl9dKJp+muOa47HpF+XkYtio6k7tfvkSVh5Yfo8p6fSj X-Received: by 2002:a17:902:e848:b0:16d:ccea:3259 with SMTP id t8-20020a170902e84800b0016dccea3259mr20065838plg.146.1660628117681; Mon, 15 Aug 2022 22:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660628117; cv=none; d=google.com; s=arc-20160816; b=dvTmqtzAaYxlnED9rtJVnTc/z/5ESpu+xJQFBPue/bNZJBBEgpfjDzh6upEmGS82k2 n3SCAgnfsepplBWPxGb3qBYYFVuvW3Rvk7CH2EypE8EhuAHyml3D9duAeyiHLoELOjqN YwEQIzzG75QU0FmBv/EzNYcey72faG+PpAgKCGfB/NpvwE/6tcn0Ty+/QglqksUVdy1M 7ttQn3TmxVzirLn+oa8HL/SF7vjIYQxNw3rUXy41e5d3up2Depz3kdQnbCA7qE+my2a6 jrg2ZKsqwA9xhiFuSQfDQ31UFjUIphMlfEOLh+Y9AMugtDEjHEATFqjRZ1d0pEkonJW0 U7/A== 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=S1Ncg1CfTJ2S/Dh1D5B3UBtnIWkyXoKyJGE+f4HT3r8=; b=n6AYmmBUwR0bmKfKpwAB5CNxOgWlCu85uDDRph53LVRDreRamN8qQOFlGJbGteS3Zl 6UtiDkjLhCRDXW/HbSnQxaeiSuMvPVPhOJJhMyxvLeK/TnEVJtonLfohRcGePqGT9KGb bR9/B7f6835V1W6aSopUkerrAY4EiVHfeUiXXIZEgmUOXvPmh77jDq/6TtL44kBzRcmJ WaNvE4mOvA/QhvZe5M0lNvJPa7SA/XZywXFjatETSTN+U58x0aAngKo0ysMFldIiQ/Sd VJvPJzh1rrJt06Ybiu1TCwGIW7ZEhUr/TQVZuADv70r6WVgc4Pgto0jTGxBCtZYz+nH/ d5dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=onqIGUYp; 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 h10-20020a63530a000000b0042814932da7si6702037pgb.403.2022.08.15.22.35.07; Mon, 15 Aug 2022 22:35:17 -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=onqIGUYp; 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 S229832AbiHPEdp (ORCPT + 99 others); Tue, 16 Aug 2022 00:33:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229588AbiHPEdJ (ORCPT ); Tue, 16 Aug 2022 00:33:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC25F16945E; Mon, 15 Aug 2022 13:23:53 -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 3CFC561007; Mon, 15 Aug 2022 20:23:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31AC9C433D7; Mon, 15 Aug 2022 20:23:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595032; bh=NituQGIJrlhmVONiOXePMyRzbgpWrRi0nhnlPe8xvqM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=onqIGUYpkLhgUNJtGMiqiYyVeBt8Xdno0qtq2oI0ZWhMA+1btJVbdNjwkIQDivtef mDBG5yhJ9d+uqzvmuHEVf3seOVWrus+lHbwX4Vq0wJi40HQHgaj1izgZ9prKilK+ON HO0peuqXcEjz81zjDimua9OiOH54XMpRewQguVOM= 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.19 0618/1157] scsi: qla2xxx: edif: Send LOGO for unexpected IKE message Date: Mon, 15 Aug 2022 19:59:34 +0200 Message-Id: <20220815180504.380900214@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-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 2b659ed67a12f39f56d8dcad9b5d5a74d67c01b3 ] If the session is down and the local port continues to receive AUTH ELS messages, the driver needs to send back LOGO so that the remote device knows to tear down its session. Terminate and clean up the AUTH ELS exchange followed by a passthrough LOGO. Link: https://lore.kernel.org/r/20220608115849.16693-3-njavali@marvell.com Fixes: 225479296c4f ("scsi: qla2xxx: edif: Reject AUTH ELS on session down") 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 | 19 +++++++++++++++++-- drivers/scsi/qla2xxx/qla_fw.h | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c index bd5740f23e76..f9f4c4a6afcc 100644 --- a/drivers/scsi/qla2xxx/qla_edif.c +++ b/drivers/scsi/qla2xxx/qla_edif.c @@ -2643,8 +2643,7 @@ void qla24xx_auth_els(scsi_qla_host_t *vha, void **pkt, struct rsp_que **rsp) fcport = qla2x00_find_fcport_by_pid(host, &purex->pur_info.pur_sid); - if (DBELL_INACTIVE(vha) || - (fcport && EDIF_SESSION_DOWN(fcport))) { + if (DBELL_INACTIVE(vha)) { ql_dbg(ql_dbg_edif, host, 0x0910c, "%s e_dbell.db_flags =%x %06x\n", __func__, host->e_dbell.db_flags, fcport ? fcport->d_id.b24 : 0); @@ -2654,6 +2653,22 @@ void qla24xx_auth_els(scsi_qla_host_t *vha, void **pkt, struct rsp_que **rsp) return; } + if (fcport && EDIF_SESSION_DOWN(fcport)) { + ql_dbg(ql_dbg_edif, host, 0x13b6, + "%s terminate exchange. Send logo to 0x%x\n", + __func__, a.did.b24); + + a.tx_byte_count = a.tx_len = 0; + a.tx_addr = 0; + a.control_flags = EPD_RX_XCHG; /* EPD_RX_XCHG = terminate cmd */ + qla_els_reject_iocb(host, (*rsp)->qpair, &a); + qla_enode_free(host, ptr); + /* send logo to let remote port knows to tear down session */ + fcport->send_els_logo = 1; + qlt_schedule_sess_for_deletion(fcport); + return; + } + /* add the local enode to the list */ qla_enode_add(host, ptr); diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h index 0bb1d562f0bf..361015b5763e 100644 --- a/drivers/scsi/qla2xxx/qla_fw.h +++ b/drivers/scsi/qla2xxx/qla_fw.h @@ -807,7 +807,7 @@ struct els_entry_24xx { #define EPD_ELS_COMMAND (0 << 13) #define EPD_ELS_ACC (1 << 13) #define EPD_ELS_RJT (2 << 13) -#define EPD_RX_XCHG (3 << 13) +#define EPD_RX_XCHG (3 << 13) /* terminate exchange */ #define ECF_CLR_PASSTHRU_PEND BIT_12 #define ECF_INCL_FRAME_HDR BIT_11 #define ECF_SEC_LOGIN BIT_3 -- 2.35.1