From patchwork Tue Sep 11 17:18:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10596001 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3135C14E5 for ; Tue, 11 Sep 2018 17:18:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 140AF29B1F for ; Tue, 11 Sep 2018 17:18:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 085A629B23; Tue, 11 Sep 2018 17:18:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 80CFB29B1F for ; Tue, 11 Sep 2018 17:18:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728021AbeIKWTE (ORCPT ); Tue, 11 Sep 2018 18:19:04 -0400 Received: from mail-co1nam03on0078.outbound.protection.outlook.com ([104.47.40.78]:6120 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726782AbeIKWTE (ORCPT ); Tue, 11 Sep 2018 18:19:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s2tQVRADqa9NORWbSzQLQrnG5tkTUiJW2kPDy8Vq5Us=; b=YjZV8kOJuGL3eCgdKvenskqEyGS1z5qlkK6DS2G5GlUFMpnyVg/WR+cHAbX37+UnZG1wKdbxI3cQ1AeBV95si+7JSs6XdTT+0NlCxaotQ4FMIKRcR/MlHkaleyRrZ8VdyEC1v1rmIG66aBuNPwiUx6ICS5QRCYOcvl0DPK5o+rg= Received: from DM6PR07CA0004.namprd07.prod.outlook.com (2603:10b6:5:94::17) by BYAPR07MB4664.namprd07.prod.outlook.com (2603:10b6:a02:f1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.13; Tue, 11 Sep 2018 17:18:41 +0000 Received: from CO1NAM05FT061.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::201) by DM6PR07CA0004.outlook.office365.com (2603:10b6:5:94::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1122.16 via Frontend Transport; Tue, 11 Sep 2018 17:18:40 +0000 Authentication-Results: spf=pass (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by CO1NAM05FT061.mail.protection.outlook.com (10.152.96.179) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1164.5 via Frontend Transport; Tue, 11 Sep 2018 17:18:40 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 11 Sep 2018 10:18:30 -0700 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id w8BHITkc029087; Tue, 11 Sep 2018 10:18:29 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w8BHITLQ029086; Tue, 11 Sep 2018 10:18:29 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 09/16] qla2xxx: Fix stuck session in PLOGI state Date: Tue, 11 Sep 2018 10:18:20 -0700 Message-ID: <20180911171827.29016-10-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180911171827.29016-1-himanshu.madhani@cavium.com> References: <20180911171827.29016-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(136003)(376002)(346002)(396003)(2980300002)(438002)(199004)(189003)(14444005)(126002)(44832011)(486006)(1076002)(106002)(4326008)(6666003)(305945005)(51416003)(8676002)(76176011)(110136005)(16586007)(316002)(42186006)(54906003)(2906002)(476003)(8936002)(478600001)(86362001)(575784001)(87636003)(48376002)(106466001)(72206003)(356003)(26005)(50466002)(81166006)(81156014)(5660300001)(80596001)(36756003)(69596002)(11346002)(47776003)(336012)(50226002)(446003)(2616005)(186003);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR07MB4664;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT061;1:QeXRIiLQc3lxPgk9NCb450MZaPADJqoL5lsmMMz4GSeJLE2g64Yaflz3vdbLbwbVgrZSRvsWLlZallrO84gPri0s19OZnHCVphEEYxI+EVgjtpnbSGZfgDAbWomqx9JX X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5d8bf789-5737-475b-1f78-08d6180a9e8a X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BYAPR07MB4664; X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4664;3:FwtecrLZ4ThOUKiQ2Dr8yitcmsKPsz2iFb7jwPmGBozfUst/ZUm8SVss+H5hM03J2kDAYh1R6SyQmqfU7s7Pkz8karuA5jPlCvEg9o47T+jkC9v9ECBwzozeEtMbRnVsPDaUrp+efqfohFkiqy+L2m5GXNdgRyu0+UAs4jBmzh6W4PEk3aJf1/9E4jqTZc3dgX7zYxJWx4x1tD7ONePO0btDX2+Z2PVss5RgK4kgtv7yUkWBE1GLWp2XzW1R6vWxgUxU0qAZCqusy/V5rLaF+IfbJMfNXffL3vctLFFJp1eSHG7emQSkIy3ZG0A6P1zwIKPDOQ+dTnAryYq8ripJEPn1mg7kMrrtmt6iR+87dZw=;25:1972l+CDVMRLyCj7L3U+JHeEa9PW3CXe44WAZGivFvzHBiW/QYsSm9lp6mmdoc4dZnVLta4f6gzl9qgpkkVpemG5rhcq6gYZ1zPzFWhs2ZiZO0/fqPdWIwYAt+eEzW5w4p62DjqrsFpQECUE1wDx9iGW7K07Ar78QXbYQg6G3g84RffvMe4jwPnu0nRx9h431uFDf1sX8aR2ArG1NupUbPTv7RXvslIIxF/Bk2OR9BoqkdrUolMCXWboE+wmQ9/JwGgI5b58oJXS+oFk5sANmmwiCWyf0hxol5xEENUhEEgouKWKQa/JBBkZtCLJ5zexMD63zR7TyH43WSlpRPP3CA== X-MS-TrafficTypeDiagnostic: BYAPR07MB4664: X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4664;31:s2kBlL0XSW6J0BR4SJnwNSYY5sG4J5pCHvmqaF8H7TzIhNdoKFFJguY//uydRrB6A714932PSkHxjLXhNkupm+8gn5xJPJigAkvApPiiAKve6J11Cm5lbbbiTeuMlqQNRmggoBKEp9CvuJt2yZpE9UCf4EE6ZnrB+DE8B30BGnq1mzCvprDTwK2InK6pqsh2pYU14nMiwGkr1kAWVj/6W/zf9OwyDEULLNgxsOAe5f4=;20:1YxBwfJScRtgmxxjsxXv2GfldP630sxPPVZB/C+00saCRTLe/CUSPacXZoHTProh7v41fQcXtDUVmiP77M5nU2R0TC1LZSyfZsxvEJX8dz3d7kGUvg0UJ23eGuOWRwVi/rEU5KMMErApBSEovosGQgT+j3aYB9+zY/FUj8+bP2ehoHWMReFbr5KqcKoEW27bj8pDMbBUgHTfOzkDkOnlUIec778D8FhqVxrmi34yd4eEW7iLXEbIkVIqW4j8qrcjMfhQn3b1JraAG4rDk0kQhfIQstfGeaAiCsrl0vhjKyqd4J7O5o76lj1S6yxIiCJIjv7QiZ/PTspFX0+0KYfdXgP7cGXoWs0YIYMbG7koP7aCqFyK1Lh8541+w+LqcqwHeJjbeck1UTrO3CvMCLCMyYOljbmPtlBWpjoquTCzfoJmaHIDLsuqBOVOJU3gzpWQVe9pggSjoLkhKoJFcam/T4uKpXbP39pER/cIkx08XarFQ8QAY00BCoz9RbFVR3gL X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(10201501046)(3002001)(93006095)(93004095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699050);SRVR:BYAPR07MB4664;BCL:0;PCL:0;RULEID:;SRVR:BYAPR07MB4664; X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4664;4:fbqa1af635dTELlgYGWJ8uXJYo9OIJVwLw8Zl+5ytrtbDMUgdCesrivqyr96tyzIZ72cDcPs8QKTSus7p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WEg5sYtAEAjNMkPgpThYDJS8gKDUh15ittlxk4mperzMqA4bBOJXF/RY65CY0koeJ0GqY1WNhC+ij2Q6eS3lnsM4p+aQq0b+3a9bO2mWrqeAnIXEU8fVzZ3Pi/Z+3c5x4ZLHZJvM1z2OJUDJESWPW8SzptD5H3l9sHi4bfFV3fA==;5:hwfyxXI/AFJTHooOQPnaOUi1S/hDk5/HGdawrvgFqUWAvCC4yL8+I1hPB1OBsvKcKWg31ZjwoYJ3w3QHdEjbV6MwD4d6dC/oKEyHFIR0LtI6xGGkqM/Gy0By/XxSJe5F3vzKRKupdqGfYhI6m3wFupu+DTvZg0zKkCO/6Tbw5Ro=;7:s9/KB/4A4/26CVtbmwbzLkglhGAxYLPyGj934ggraRVayG7ejJSvTqQCVtFPNqDjzmHxHu+ZpQwwHGTouAAlSb35fVHMPX+tOmGFhqZEUftZutwpWV9QCsRWiKKEfOs6Q1ZsFkm8EZ1vQarWQ4kqP6YEH3KHCV2ep3EgGdfSP1Q+plEfjxVguaKto7YXCb3PKUndX7jOjwnlAC2xPRVnianYGCeA+2jR3LHTgJ4Bxihdef/FiQ5KGUYt+YB+YyVy SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2018 17:18:40.5439 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5d8bf789-5737-475b-1f78-08d6180a9e8a X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB4664 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Quinn Tran On PLOGI complete + RSCN received, driver tries to handle RSCN but failed to reset the session back to the beginning to restart the login process. Instead the session was left in the Plogi complete without moving forward. This patch will push the session state back to the delete state and restart the connection. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c | 13 +++++++++---- drivers/scsi/qla2xxx/qla_target.c | 4 ---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 0575210aa8f1..bd1afa3063ee 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -414,6 +414,7 @@ void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea) return; } else if (ea->sp->gen1 != ea->fcport->rscn_gen) { qla_rscn_replay(fcport); + qlt_schedule_sess_for_deletion(fcport); return; } @@ -538,6 +539,7 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, if (fcport->last_rscn_gen != fcport->rscn_gen) { qla_rscn_replay(fcport); + qlt_schedule_sess_for_deletion(fcport); return; } else if (fcport->last_login_gen != fcport->login_gen) { ql_dbg(ql_dbg_disc, vha, 0x20e0, @@ -1229,6 +1231,7 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) return; } else if (ea->sp->gen1 != fcport->rscn_gen) { qla_rscn_replay(fcport); + qlt_schedule_sess_for_deletion(fcport); return; } @@ -1699,9 +1702,7 @@ void qla_rscn_replay(fc_port_t *fcport) #else qla24xx_post_gpnid_work(fcport->vha, &ea.id); #endif - } else { - qla24xx_post_gnl_work(fcport->vha, fcport); - } + } } static void @@ -1938,7 +1939,7 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) "%s %8phC DS %d LS %d rc %d login %d|%d rscn %d|%d data %x|%x iop %x|%x\n", __func__, fcport->port_name, fcport->disc_state, fcport->fw_login_state, ea->rc, ea->sp->gen2, fcport->login_gen, - ea->sp->gen2, fcport->rscn_gen|ea->sp->gen1, + ea->sp->gen1, fcport->rscn_gen, ea->data[0], ea->data[1], ea->iop[0], ea->iop[1]); if ((fcport->fw_login_state == DSC_LS_PLOGI_PEND) || @@ -1960,7 +1961,11 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) set_bit(RELOGIN_NEEDED, &vha->dpc_flags); return; } else if (ea->sp->gen1 != fcport->rscn_gen) { + ql_dbg(ql_dbg_disc, vha, 0x20d3, + "%s %8phC RSCN generation changed\n", + __func__, fcport->port_name); qla_rscn_replay(fcport); + qlt_schedule_sess_for_deletion(fcport); return; } diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index c0b9e0d079c0..666146a86d10 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -1260,9 +1260,6 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess) break; } - if (sess->deleted == QLA_SESS_DELETED) - sess->logout_on_delete = 0; - spin_lock_irqsave(&sess->vha->work_lock, flags); if (sess->deleted == QLA_SESS_DELETION_IN_PROGRESS) { spin_unlock_irqrestore(&sess->vha->work_lock, flags); @@ -4080,7 +4077,6 @@ static void qlt_do_ctio_completion(struct scsi_qla_host *vha, * Session is already logged out, but we need * to notify initiator, who's not aware of this */ - cmd->sess->logout_on_delete = 0; cmd->sess->send_els_logo = 1; ql_dbg(ql_dbg_disc, vha, 0x20f8, "%s %d %8phC post del sess\n",