From patchwork Thu Nov 30 03:40:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10084177 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 C129C602B9 for ; Thu, 30 Nov 2017 03:41:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5B8129935 for ; Thu, 30 Nov 2017 03:41:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AAA0029B02; Thu, 30 Nov 2017 03:41:08 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 1278929935 for ; Thu, 30 Nov 2017 03:41:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753376AbdK3DlG (ORCPT ); Wed, 29 Nov 2017 22:41:06 -0500 Received: from mail-sn1nam02on0067.outbound.protection.outlook.com ([104.47.36.67]:32352 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752980AbdK3DlD (ORCPT ); Wed, 29 Nov 2017 22:41:03 -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=v3Ke15V1T2G1YjJID/vlqkLAq0MFw3zqyQ3adse6fSc=; b=W3YVCIoiVsc/ZzbJtVeJkso0QHmhI10WMj7UPTdzFMjiSVgLnGMZR4oKOTRLRsf7toVrVt3QGwxma2k0mNifJdHT8oLs+KLdjBEZlgba5YJ+uNQZam5kGpzabjR2xKXLXIboJWTwbCa+KofJnfvBLnDFpCnFNaigSRvBEmrhE8U= Received: from BY2PR07CA0091.namprd07.prod.outlook.com (10.166.107.44) by SN1PR0701MB1952.namprd07.prod.outlook.com (10.163.131.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Thu, 30 Nov 2017 03:41:01 +0000 Received: from BL2FFO11FD049.protection.gbl (2a01:111:f400:7c09::119) by BY2PR07CA0091.outlook.office365.com (2a01:111:e400:7bff::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.260.4 via Frontend Transport; Thu, 30 Nov 2017 03:41:00 +0000 Authentication-Results: spf=none (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=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 BL2FFO11FD049.mail.protection.outlook.com (10.173.161.211) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.218.12 via Frontend Transport; Thu, 30 Nov 2017 03:41:00 +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; Wed, 29 Nov 2017 19:40:49 -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 vAU3enXl015130; Wed, 29 Nov 2017 19:40:49 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id vAU3enuM015129; Wed, 29 Nov 2017 19:40:49 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 06/22] qla2xxx: Retry switch command on time out Date: Wed, 29 Nov 2017 19:40:31 -0800 Message-ID: <20171130034047.15070-7-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171130034047.15070-1-himanshu.madhani@cavium.com> References: <20171130034047.15070-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)(979002)(6009001)(346002)(376002)(2980300002)(428002)(189002)(199003)(5660300001)(50466002)(6666003)(2950100002)(86362001)(50226002)(2906002)(105586002)(36756003)(87636003)(189998001)(106466001)(4326008)(50986010)(76176010)(1076002)(8936002)(51416003)(48376002)(101416001)(72206003)(69596002)(42186006)(54906003)(80596001)(356003)(305945005)(81156014)(8676002)(81166006)(478600001)(47776003)(110136005)(316002)(33646002)(16586007)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0701MB1952; 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; BL2FFO11FD049; 1:7JJE1/yMv67Mtc7dG95VSsNg6HLz7DvKq7lxM1+ewOUx49XediNZw76CwC0UTmgEZhl/PSm5NVekf/ncHriLKXPOQZfjtIMjr07R6nadnBxSVLkwxudrpKwwqebnqqBn X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 757019ff-d57a-450f-7599-08d537a42cb9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603280); SRVR:SN1PR0701MB1952; X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TpWRJFpU18a7NaZlg+7I=; 20:rBhwZ4qWNasu0uonCx/O+3G213zSqyrxbVshmgU186L/oAPwCmtE3BNHlDSrP8Ero5gnGgO/2G48ECBZDrRtky2t9O7bQtBihE1JqExCZvCYPoTvuhOPi8cR+cGj8HlYnwRG8U/AyVOkrtlBQl8pZbX3RzWMbtAM8WIp7QMjYgfXKbL+MlyPG5hPO/bR9BUWmksei1o13CF+n2cyYHpuoVQ8M5MPcY/zysGerb7k/UcouKc7sEhNIFGukUjcFdW2enii8JoatCL6adORcNHO9LDT5MWM5I3zG1B+k6CDFFynETowEHVK3Ig3uf8D/y+WpxHB+3olQaRDcp5FuJs4s3RWZqcuF17sDA+5r0xKN2PfriYoVaraQVZLsJr6B+HJhrgWTBAGDZnmb8RBLCGi4wc8iG6andLXiNrlIaend1MLEcA+Btol7tBf/D5dNIJQJkY4e0u5NeMlhtAHHaBm7CsKYeeWecwKPez3nKJ0FFMIm4NUw76Wau/myLbLrUJt X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231022)(6041248)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123560025)(6072148)(201708071742011); SRVR:SN1PR0701MB1952; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SN1PR0701MB1952; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0701MB1952; 4:6EoDib10L9c1dUCRYVCygWMWF3xfkWVgvuhjgexJaAKnLkmeIA14YaVMZ8kiN1D+oQnG6hAuGn9RfrWAmPMtICGj478BD4GU4AsIffMk2EwkMTX4qT5kzSFIcyyeQiahZQVK2sp9hpzjJA6BD1Bm139k5eS2L/qWlWOpOpV5pHIPX4KOOYl+/55k/upU2u59HGjVSokElwLKDkD1G9DVltMxQLkkD5n/qFU3FowVwxDNBC3MLoMxT88wfxDDMJDym7Xrd+oS6N9L6EsuN3FSGsk6Dte12tlU01VQknKapi88EBUCiwcOkZH4UeeZo0P3 X-Forefront-PRVS: 05079D8470 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0701MB1952; 23:F4bVQSqFyrb2WL7mk14h2M1aUCtVqil6X8R4r8D?= =?us-ascii?Q?KJvB/77tAszcTrJUtbkYNInzNTHA0m8YSyHXnl96kA8FwuPod1Lsn+LIt2R8?= =?us-ascii?Q?LjgMJmNnUQ88/4LqUG0P6MtwiK7FnHwiLmKMleww/WK3/AFYWtRrPu09RCSz?= =?us-ascii?Q?oo9cNwptKROdCA7zPsw8+FFdT4RE0VH1LDp4wqCiv1czLLRUrmdt/P/i3C+j?= =?us-ascii?Q?CVCCwqx2ZjSRuG+JBmmAIlFvFUG8KM8ZzkJ3cj/5nQqtaZDtJGE0o8TdTkfL?= =?us-ascii?Q?iJnBoKkBX2nM13JynAqAkXixsnmJMSRmUOFiDo7r7byaVxILNJjl4UXp3H+2?= =?us-ascii?Q?khEZdQcBP6cWJwnTVL5QE2PXu9KhsDMs4cwJbFfS/65hhO6FIefVn4ChfaqR?= =?us-ascii?Q?DLPi0sjoTmv7Yf4yWh0Tw4ZacoYtfpuyBEhiO/7sQbHhWuSlhqIxgt7MeGUj?= =?us-ascii?Q?bE87Uxank//UbFQU58qkirXo9aUL9kWBE7owIn4/22vM5ZoCQxcxGrpY6RfH?= =?us-ascii?Q?QsESu5S03mgLOxKI1mB0YKo8lixcUR9ZXSu881qtiC2ssv+41HzGdhJOpiij?= =?us-ascii?Q?h7XjC4fu7nELbx+Brhqp0X20c8llkSdhUAPm4ZlsRNsH2qQA+GkDkrNHTgtr?= =?us-ascii?Q?jFTh7NZsNzB05E5GQ6vGMSLxv7v82PPhon7loRWcgz3A3YNHkEonWxW4czrq?= =?us-ascii?Q?cnsJExFsI+sVx44eCuYwmVvQYOPKX0tUidfCP1rXQ5awSIyZV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Hu3RJbhlOT+2EHCwXKxmY44yJ3vAg+ZKNfwrImUHc+8YIq1cYmD6MGvLjvMxN85FY7Jn08KSaXG6QhAoxFple3xWa0+6AAuUc4bKSvUHY=; 7:hUeeMEuHiOI4bibguGnd4eVUGqKT0RZ255FgXTdsxtZuqZZ++ME7O4eMQ+S9qwuT04HLqFrIcDD5be8IlswNqLyDhJRJN08HwXc2H3U+LJjU17hY5/zR4al351qJRZiOOHTgSCRYjwscmUU6Kt+HQ9wKNCvSM54uKYTIlNaND1g6NCodj27GcAemju0A6/zPYFHKp/jve5KAzyLcb6EX11lhVQeXqXTu5MC88brISd5P1RLQS5vSojrCfo9p4wti SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2017 03:41:00.3722 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 757019ff-d57a-450f-7599-08d537a42cb9 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: SN1PR0701MB1952 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 Retry GID_PN & GPN_ID switch commands for time out case. Fixes: 726b85487067d ("qla2xxx: Add framework for async fabric discovery") Cc: # 4.10+ Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Reviewed-by: Hannes Reinecke --- drivers/scsi/qla2xxx/qla_gs.c | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 8984f857bb34..ea1b562ebc8a 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -175,6 +175,9 @@ qla2x00_chk_ms_status(scsi_qla_host_t *vha, ms_iocb_entry_t *ms_pkt, set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); } break; + case CS_TIMEOUT: + rval = QLA_FUNCTION_TIMEOUT; + /* drop through */ default: ql_dbg(ql_dbg_disc, vha, 0x2033, "%s failed, completion status (%x) on port_id: " @@ -2889,9 +2892,22 @@ static void qla2x00_async_gidpn_sp_done(void *s, int res) ea.rc = res; ea.event = FCME_GIDPN_DONE; - ql_dbg(ql_dbg_disc, vha, 0x204f, - "Async done-%s res %x, WWPN %8phC ID %3phC \n", - sp->name, res, fcport->port_name, id); + if (res == QLA_FUNCTION_TIMEOUT) { + ql_dbg(ql_dbg_disc, sp->vha, 0xffff, + "Async done-%s WWPN %8phC timed out.\n", + sp->name, fcport->port_name); + qla24xx_post_gidpn_work(sp->vha, fcport); + sp->free(sp); + return; + } else if (res) { + ql_dbg(ql_dbg_disc, sp->vha, 0xffff, + "Async done-%s fail res %x, WWPN %8phC\n", + sp->name, res, fcport->port_name); + } else { + ql_dbg(ql_dbg_disc, vha, 0x204f, + "Async done-%s good WWPN %8phC ID %3phC\n", + sp->name, fcport->port_name, id); + } qla2x00_fcport_event_handler(vha, &ea); @@ -3217,11 +3233,6 @@ static void qla2x00_async_gpnid_sp_done(void *s, int res) sp->name, ct_req->req.port_id.port_id, ct_rsp->rsp.gpn_id.port_name); - if (res) { - sp->free(sp); - return; - } - memset(&ea, 0, sizeof(ea)); memcpy(ea.port_name, ct_rsp->rsp.gpn_id.port_name, WWN_SIZE); ea.sp = sp; @@ -3231,6 +3242,13 @@ static void qla2x00_async_gpnid_sp_done(void *s, int res) ea.rc = res; ea.event = FCME_GPNID_DONE; + if (res) { + if (res == QLA_FUNCTION_TIMEOUT) + qla24xx_post_gpnid_work(sp->vha, &ea.id); + sp->free(sp); + return; + } + qla2x00_fcport_event_handler(vha, &ea); e = qla2x00_alloc_work(vha, QLA_EVT_GPNID_DONE);