From patchwork Fri Feb 3 22:40:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 9555201 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CAA2A602B7 for ; Fri, 3 Feb 2017 22:41:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B688427F9F for ; Fri, 3 Feb 2017 22:41:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB31E2818E; Fri, 3 Feb 2017 22:41:44 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 E25D428135 for ; Fri, 3 Feb 2017 22:41:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752988AbdBCWlk (ORCPT ); Fri, 3 Feb 2017 17:41:40 -0500 Received: from mail-cys01nam02on0063.outbound.protection.outlook.com ([104.47.37.63]:39605 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752974AbdBCWlg (ORCPT ); Fri, 3 Feb 2017 17:41:36 -0500 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; bh=M6iGU9KBJbKs4A55IHg1PClfUHwK6jV76IabJ4Pe76U=; b=LFNfJBmMsqVnppGx0hIP/eX13MP2Zs1roOxDrVZezssJw3w9zo9aRiLwmREHmwKy3vw7IR9ue/OyaYf/jXcwg3omzDurqAqKuqblZOK3TB7tnqH+0SjH8niLNQwcTFfTSc01G6I3REyxriO8MlPV//d0KIoSlJag+IeOkXGaWTU= Received: from BN6PR07CA0017.namprd07.prod.outlook.com (10.173.33.155) by BLUPR07MB196.namprd07.prod.outlook.com (10.242.200.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Fri, 3 Feb 2017 22:41:33 +0000 Received: from BN1BFFO11FD023.protection.gbl (2a01:111:f400:7c10::1:128) by BN6PR07CA0017.outlook.office365.com (2603:10b6:404:3a::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16 via Frontend Transport; Fri, 3 Feb 2017 22:41:33 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; linux-iscsi.org; dkim=none (message not signed) header.d=none; linux-iscsi.org; dmarc=none action=none header.from=cavium.com; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BN1BFFO11FD023.mail.protection.outlook.com (10.58.144.86) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.888.7 via Frontend Transport; Fri, 3 Feb 2017 22:41:32 +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.309.2; Fri, 3 Feb 2017 14:41:25 -0800 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 v13MfAvv002344; Fri, 3 Feb 2017 14:41:10 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id v13MfAcF002343; Fri, 3 Feb 2017 14:41:10 -0800 From: Himanshu Madhani To: , , , CC: , , Subject: [PATCH v2 02/14] qla2xxx: Allow relogin to proceed if remote login did not finish Date: Fri, 3 Feb 2017 14:40:43 -0800 Message-ID: <1486161655-2307-3-git-send-email-himanshu.madhani@cavium.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1486161655-2307-1-git-send-email-himanshu.madhani@cavium.com> References: <1486161655-2307-1-git-send-email-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)(6009001)(7916002)(39450400003)(2980300002)(428002)(189002)(199003)(356003)(42186005)(2906002)(101416001)(38730400001)(305945005)(47776003)(48376002)(5003940100001)(106466001)(92566002)(50226002)(105586002)(4001430100002)(5001770100001)(86362001)(76176999)(50986999)(107886002)(189998001)(8936002)(54906002)(81166006)(8676002)(8656002)(81156014)(2201001)(80596001)(5660300001)(36756003)(1691005)(4326007)(2950100002)(69596002)(4720700003)(6666003)(33646002)(626004)(50466002)(87636001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR07MB196; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; PTR:50-232-66-26-static.hfc.comcastbusiness.net; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD023; 1:y5WQkzX1lhTy74OIhvZBgu6gkaCeYgpN29/Zbqj6wC9LDt+srdvWoxkotAc3I4R5kIkTfWOEtKSL4wG7G7qR5CzQNhO7hhfqGAdOt03ADGy8Q+X9zh17QO3yV5+7YZ5k6Dqyj9V8HaKVEoZEGx1yul30iBDSPSYf/QWibnls86te0i7uvesoW+BonXakExwfH+05W3JucXVdK2F2fk9m5Li3sKpL8MRMRS7L0T9nI9YJXFa2++wCPN8CdpVr4AcK0VxieJtnAo9E0pa4wtmMYxsCfC+VaeXOgpDcn5ZYROQ9B3y23rCFQq2HjT0xlBheof6o1s4YQ62yYTM88nIudcxuo2iVwam96h0vjxA4HQp/KwM4mnBRDf87nwxINzBIOVYX3ewgPClzpEUcZL/H4ITgHheVXGKXPNomnTzfDaGmTVg1ITlP5Rm9+oOca5sdPtSuMdAa2By2c+DLlUgGWHsqXMV6RNoxq/lxmEdiEtqC/5EgcMKnkFivqiVnnk9E4J2tXmqdse//TQPMuy4toSzCSRIJugcbTZ1QDzPO870= X-MS-Office365-Filtering-Correlation-Id: 525e99d5-06a9-47b5-d156-08d44c85cd70 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR07MB196; X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB196; 3:meSSRmKuKL6U0fbkdG4QeatCXsXpiUFDjg45eqgOp33TGUNtwpn869KBlPF9IWo9/ICkAlp6aXx3wBk1N6tLXGziME9YXwUdjaw+4Cp9Uo/3qChXOg+qV0UaXUTFfO62LHrs1mU1tFmBKz1aLEjCVsdKtROooiGwN/idAmPvg8u7n3/Pg07bNR3qMK7I8i+oqavVtwMzt6eBoKsJL4uaVuuQCSq0UX2yl75KpeAAjeYzRyVVLQnytdFum0Ni5zm68VuLtbuLvXqQhHmgorRf8c/N8uKGjCdV0+BG/JoBZdI2ZoUu1p+E6STMfQX6YKLGEaCgsHoP/PmC854wb/KTGiPVudSu94E/zp6Odc053+zI8agKUZz7rctB9Oyl3l0S; 25:VM8vQywjVIme0iyTTr4d2udr/DEYiF3Y+w1ixZEGaDNWZpBhnyz3OxFL234us8Q2xOXj6ogOtcbS6gXtrm5Pk9SU4dHHZXhHeGgL/gR+NhZM6cw408EWXcpI4W+t3FRrgrPYutkfRp8/TZ/Z/xOBRB/sscmXUU/ud+aG8UF6DeqD/UBQ8cPvrwC1SFUJ8RFKAHMv33TbMAEwL0C2Xs+yqlv6CyJM5oDHc/2djGpK3yg9tV1IHY/Y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X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(13015025)(13018025)(13017025)(13024025)(13023025)(10201501046)(3002001)(6041248)(20161123558025)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(6072148); SRVR:BLUPR07MB196; BCL:0; PCL:0; RULEID:; SRVR:BLUPR07MB196; X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB196; 4:LmygYX/LjGOagxpWFDVg2+Dl7HKixstxDUozTlW9oH3k4HFe4vjBAube3Fwm2tIYGuZG7zPtyXj/75P9/hJVu/yQLUMrJgZnojAMgSy5pYKo/B3LMnWI0TazY2GgOK+XY6bhFeOttTeLl+Y7fZR52MHHGk0NyP1nGGkIPGuV27B9ZMCc5QAQlXNy8SB1F8Q7zDMFhYlF7eze5tKDjXKR8HvfyrK5cOrThU5aH/Q06//xkkvOa/RBJUFBrX6KdNjdlHtjoe+dNfNNKa0kdP5taMuWVXkQJDNg+PzvxKYMxmHIZsK92kXWigziETZWUzAiHJe3PcXE1ZnR4bTxT88ssZNNB0Z9aJYdDkxe/n3ID+dWDUxsX277XlLhBg/fpjoOyDOCwt3b1aXf5xNya24xcW0pjFlgHvU5fPynmAje2Kh6gQ+GIVSnj0HU+qJ/PHdmzv8h+uIUxp2UoSapkx7mesaiS29GWklFWeAUmP5bq7Ryw0mXUf+/Otpq0/8mpSSt2Wiq5mAbfUvA4rANCs4xYGM4Q3EAfORxPDbXfcz8KRSuEZ7nL8tEHQ3leD0YGmJIcYC1rXET8wxLeOrkPMDo1YkgzoJPqr0KGsz6uMhcK8ZoHtUBIxank4Ie3+4bDCK964kxvYaKQwf2oSzBc0ap/ah7fD5hwf6jKkJWJgKS3wKSbKwu1a3IzZONzOg++gVnVF4n7/BiKxOFKRwBjxejvA== X-Forefront-PRVS: 02070414A1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR07MB196; 23:IMahCY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W3JpsTzqjUrlszYzF9Q= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB196; 7:geLmu+RSoRkD2BeG02dfjG4WlO3SDnB2jat0S5tDIrHvYakfGCmHUVNQWBthnyHDze9PSryyEAOMptGSwAP7wRZLSLwDeYkhicJoqdRmiswixT+D7rXsiTOYidpYpYaVYxeVtmlduF3eh+ssTpR882fWikLBpaagxOtQvV9tnfG1asOiTWD5Ulua6hfWX21ZZZPUUV4z/I6sRMfJK7SY6Psx8IK6FzwC6k1KWgE4hPWofxx/E0iL7sFLSNsbw9CMVYC2qACfuY4kjakgEOF3ZRsHZN2ZoIVcRI8PitpqVyRQsSIxDlB2gUzES1WA+UWY0kkRe2Xry/zcFqE/XY3lFN1HEgxSmN199/XAyoip9PNDF1z8NxMvw9DyGUHsBUxmLgxzUJysPigniRzE7AUMOXfO6MuRKnULaOsO31kmBdPw3INfOiMwk3waUK0NNAijVWqoaO40v1Qy/HrsmBKf9PfBALHjainu+hjNrHKKFGCX2KOIvteWGJnB9OH0CeE/mBjEGwNzdXy/wn6Pp1xRWA== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Feb 2017 22:41:32.3734 (UTC) 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: BLUPR07MB196 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Quinn Tran If the remote port have started the login process, then the PLOGI and PRLI should be back to back. Driver will allow the remote port to complete the process. For the case where the remote port decide to back off from sending PRLI, this local port sets an expiration timer for the PRLI. Once the expiration time passes, the relogin retry logic is allowed to go through and perform login with the remote port. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 2 ++ drivers/scsi/qla2xxx/qla_init.c | 16 ++++++++++++++-- drivers/scsi/qla2xxx/qla_isr.c | 25 +++++++++++++++++++------ drivers/scsi/qla2xxx/qla_target.c | 1 + 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index fbaa39b..bf2ae8d3 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2300,6 +2300,8 @@ enum rscn_addr_format { struct ct_sns_desc ct_desc; enum discovery_state disc_state; enum login_state fw_login_state; + unsigned long plogi_nack_done_jiff; + u32 login_gen, last_login_gen; u32 rscn_gen, last_rscn_gen; u32 chip_reset; diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 9f3db52..e84ab37 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -876,10 +876,16 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) fcport->login_retry--; if ((fcport->fw_login_state == DSC_LS_PLOGI_PEND) || - (fcport->fw_login_state == DSC_LS_PLOGI_COMP) || (fcport->fw_login_state == DSC_LS_PRLI_PEND)) return 0; + if (fcport->fw_login_state == DSC_LS_PLOGI_COMP) { + unsigned long t = fcport->plogi_nack_done_jiff + HZ; + + if (time_before_eq(jiffies, t)) + return 0; + } + /* for pure Target Mode. Login will not be initiated */ if (vha->host->active_mode == MODE_TARGET) return 0; @@ -1041,10 +1047,16 @@ void qla24xx_handle_relogin_event(scsi_qla_host_t *vha, fcport->flags); if ((fcport->fw_login_state == DSC_LS_PLOGI_PEND) || - (fcport->fw_login_state == DSC_LS_PLOGI_COMP) || (fcport->fw_login_state == DSC_LS_PRLI_PEND)) return; + if (fcport->fw_login_state == DSC_LS_PLOGI_COMP) { + unsigned long t = fcport->plogi_nack_done_jiff + HZ; + + if (time_before_eq(jiffies, t)) + return; + } + if (fcport->flags & FCF_ASYNC_SENT) { fcport->login_retry++; set_bit(RELOGIN_NEEDED, &vha->dpc_flags); diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 0fd3258..f1da53d 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -1630,9 +1630,9 @@ static void qla2x00_error_entry(scsi_qla_host_t *, struct rsp_que *, QLA_LOGIO_LOGIN_RETRIED : 0; if (logio->entry_status) { ql_log(ql_log_warn, fcport->vha, 0x5034, - "Async-%s error entry - hdl=%x" + "Async-%s error entry - %8phC hdl=%x" "portid=%02x%02x%02x entry-status=%x.\n", - type, sp->handle, fcport->d_id.b.domain, + type, fcport->port_name, sp->handle, fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa, logio->entry_status); ql_dump_buffer(ql_dbg_async + ql_dbg_buffer, vha, 0x504d, @@ -1643,8 +1643,9 @@ static void qla2x00_error_entry(scsi_qla_host_t *, struct rsp_que *, if (le16_to_cpu(logio->comp_status) == CS_COMPLETE) { ql_dbg(ql_dbg_async, fcport->vha, 0x5036, - "Async-%s complete - hdl=%x portid=%02x%02x%02x " - "iop0=%x.\n", type, sp->handle, fcport->d_id.b.domain, + "Async-%s complete - %8phC hdl=%x portid=%02x%02x%02x " + "iop0=%x.\n", type, fcport->port_name, sp->handle, + fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa, le32_to_cpu(logio->io_parameter[0])); @@ -1684,6 +1685,17 @@ static void qla2x00_error_entry(scsi_qla_host_t *, struct rsp_que *, case LSC_SCODE_NPORT_USED: data[0] = MBS_LOOP_ID_USED; break; + case LSC_SCODE_CMD_FAILED: + if (iop[1] == 0x0606) { + /* + * PLOGI/PRLI Completed. We must have Recv PLOGI/PRLI, + * Target side acked. + */ + data[0] = MBS_COMMAND_COMPLETE; + goto logio_done; + } + data[0] = MBS_COMMAND_ERROR; + break; case LSC_SCODE_NOXCB: vha->hw->exch_starvation++; if (vha->hw->exch_starvation > 5) { @@ -1705,8 +1717,9 @@ static void qla2x00_error_entry(scsi_qla_host_t *, struct rsp_que *, } ql_dbg(ql_dbg_async, fcport->vha, 0x5037, - "Async-%s failed - hdl=%x portid=%02x%02x%02x comp=%x " - "iop0=%x iop1=%x.\n", type, sp->handle, fcport->d_id.b.domain, + "Async-%s failed - %8phC hdl=%x portid=%02x%02x%02x comp=%x " + "iop0=%x iop1=%x.\n", type, fcport->port_name, + sp->handle, fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa, le16_to_cpu(logio->comp_status), le32_to_cpu(logio->io_parameter[0]), diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 19ac2b5..8d21c04 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -554,6 +554,7 @@ void qla2x00_async_nack_sp_done(void *s, int res) sp->fcport->login_gen++; sp->fcport->fw_login_state = DSC_LS_PLOGI_COMP; sp->fcport->logout_on_delete = 1; + sp->fcport->plogi_nack_done_jiff = jiffies; break; case SRB_NACK_PRLI: