Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3019647rwb; Mon, 15 Aug 2022 16:16:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR6fPaJBrDyOteMFmue0NF6mWZj+HnYtaVSofQs+lpEaBukXMQz/zGhRdTTT5lRlaJ1OH2a6 X-Received: by 2002:a17:906:d7a9:b0:731:2189:4f58 with SMTP id pk9-20020a170906d7a900b0073121894f58mr11954025ejb.471.1660605394315; Mon, 15 Aug 2022 16:16:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605394; cv=none; d=google.com; s=arc-20160816; b=QW+Eg+v6aeVnbt7v4g654CyH6kg2bUqgcEbCo2CWgbHrvRPecpjNnz3nx36yxHLfz8 410FOurMffcmHfo+fweHq1N0Smwgm3WMPMwBAB4QNyVqYMwAfxFqccUAyirL+afwUwsJ dKyYrBKyAFWXH0qXRDtFxCnTQEol+SXtrXECjviguHzxWB4ei7z+ylT84G1DkLcLLLLe 1q/0R7WiGWbAi/3Ws+RF5TZVK7LQFLdDtFFXBzbVHQYYsGEMXMdTODFVMyhqIIWIaHAM vNVZn1NoSp7jpLgMKm0lwj7In5Fh7JXl1/AvigMlPq7R6myRhbT8Q0YgIMDYaVfyrd/l bu4g== 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=trkpSuGlkUGUi96yZgqeTbkxNu6Z72r38oUAFHEhv+I=; b=Wi8a7M1w4wZGXubCPiTvdUTdrLNyOBhtWiLUkCmOaVaRy14AWWgp12MQPUVzx/wnQi Vy471t0imIv4okf48w/ei+polZhbNT2zqx238ts1T//k52oRSgHtyEyCNog6cB3nPWFP aZajlr5jYm/B70AmnGCZm8P9q/k+uvqt6KHt0ekOcJK4QIDaZhPlKhus+9rrsYH4Z08W bn+KDXNlD+HWcetUSWQacDFvSw/XC80XO2yOwyBhJxbuwhw3Le3P5vVbL3DPnF/faML5 zSr5cbXbNCZxZBuAsITDZ9ad/0DLmptjzcdr7A1RglMWPYSTtq4HPsBL+H85tHoNCwiL Q5xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Bd/e7wOK"; 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 ds1-20020a170907724100b00731148bc546si10031976ejc.38.2022.08.15.16.16.08; Mon, 15 Aug 2022 16:16:34 -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="Bd/e7wOK"; 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 S244397AbiHOVjE (ORCPT + 99 others); Mon, 15 Aug 2022 17:39:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349034AbiHOVga (ORCPT ); Mon, 15 Aug 2022 17:36:30 -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 1B7A56DADE; Mon, 15 Aug 2022 12:25:54 -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 8EAF86102C; Mon, 15 Aug 2022 19:25:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98E89C433C1; Mon, 15 Aug 2022 19:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591554; bh=49UswcMoTrYQFdQpZMQkdx9wWcv/19lShqGHkiFImoI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bd/e7wOKJHNpjgDui+P8qasJDplJOOVFaA5WlxPyIMtbCtHaqBjIFXJmU2hIiDNE1 zpY4TaR/CS26ydpo5Q+JtloXu0EBqLam/uLvLTYSl5pYQbVRySVAis7jEvwH4aoxn7 VleGe6KFl2xq9wPfLGEJQAzM4KwA1ZYhR1j6IaGQ= 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.18 0580/1095] scsi: qla2xxx: edif: Reduce N2N thrashing at app_start time Date: Mon, 15 Aug 2022 19:59:39 +0200 Message-Id: <20220815180453.570200078@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 37be3f9d6993a721bc019f03c97ea0fe66319997 ] For N2N + remote WWPN is bigger than local adapter, remote adapter will login to local adapter while authentication application is not running. When authentication application starts, the current session in FW needs to to be invalidated. Make sure the old session is torn down before triggering a relogin. Link: https://lore.kernel.org/r/20220608115849.16693-9-njavali@marvell.com Fixes: 4de067e5df12 ("scsi: qla2xxx: edif: Add N2N support for EDIF") 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 | 47 ++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c index 3f886b86d74a..dbe8ef887a9d 100644 --- a/drivers/scsi/qla2xxx/qla_edif.c +++ b/drivers/scsi/qla2xxx/qla_edif.c @@ -517,11 +517,28 @@ qla_edif_app_start(scsi_qla_host_t *vha, struct bsg_job *bsg_job) list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) fcport->n2n_link_reset_cnt = 0; - if (vha->hw->flags.n2n_fw_acc_sec) - set_bit(N2N_LINK_RESET, &vha->dpc_flags); - else + if (vha->hw->flags.n2n_fw_acc_sec) { + list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) + qla_edif_sa_ctl_init(vha, fcport); + + /* + * While authentication app was not running, remote device + * could still try to login with this local port. Let's + * clear the state and try again. + */ + qla2x00_wait_for_sess_deletion(vha); + + /* bounce the link to get the other guy to relogin */ + if (!vha->hw->flags.n2n_bigger) { + set_bit(N2N_LINK_RESET, &vha->dpc_flags); + qla2xxx_wake_dpc(vha); + } + } else { + qla2x00_wait_for_hba_online(vha); set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); - qla2xxx_wake_dpc(vha); + qla2xxx_wake_dpc(vha); + qla2x00_wait_for_hba_online(vha); + } } else { list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) { ql_dbg(ql_dbg_edif, vha, 0x2058, @@ -921,17 +938,21 @@ qla_edif_app_getfcinfo(scsi_qla_host_t *vha, struct bsg_job *bsg_job) if (tdid.b24 != 0 && tdid.b24 != fcport->d_id.b24) continue; - if (fcport->scan_state != QLA_FCPORT_FOUND) - continue; + if (!N2N_TOPO(vha->hw)) { + if (fcport->scan_state != QLA_FCPORT_FOUND) + continue; - if (fcport->port_type == FCT_UNKNOWN && !fcport->fc4_features) - rval = qla24xx_async_gffid(vha, fcport, true); + if (fcport->port_type == FCT_UNKNOWN && + !fcport->fc4_features) + rval = qla24xx_async_gffid(vha, fcport, + true); - if (!rval && - !(fcport->fc4_features & FC4_FF_TARGET || - fcport->port_type & - (FCT_TARGET | FCT_NVME_TARGET))) - continue; + if (!rval && + !(fcport->fc4_features & FC4_FF_TARGET || + fcport->port_type & + (FCT_TARGET | FCT_NVME_TARGET))) + continue; + } rval = 0; -- 2.35.1