From patchwork Mon Dec 4 22:45:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10091697 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 68FAA600C5 for ; Mon, 4 Dec 2017 22:45:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5AE2F29387 for ; Mon, 4 Dec 2017 22:45:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FAC729446; Mon, 4 Dec 2017 22:45:45 +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 07AFB29387 for ; Mon, 4 Dec 2017 22:45:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752418AbdLDWpn (ORCPT ); Mon, 4 Dec 2017 17:45:43 -0500 Received: from mail-dm3nam03on0043.outbound.protection.outlook.com ([104.47.41.43]:1891 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751793AbdLDWpg (ORCPT ); Mon, 4 Dec 2017 17:45: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=1k5mnFK54D4opX6BKOV5+twonZJ3ALtGt9Ss+jR9nj8=; b=Dn3JZqsKyPSmXxet/97Xdvwqm4NLFcGJle4mc013jBrqJ9WxlOSVuXQf6FXX9U2dLbbivoth4vWfyb8wULw90Vmf48X8bnTapo9LLiIQnDpbufv8ZbONEPRe5dpDTKNNi8Y4E/69nFDD84htP4uRLoHQCmnK5/s3VQtVddsBl98= Received: from SN1PR0701CA0084.namprd07.prod.outlook.com (2a01:111:e400:52fd::52) by SN4PR0701MB3824.namprd07.prod.outlook.com (2603:10b6:803:4f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Mon, 4 Dec 2017 22:45:35 +0000 Received: from BL2FFO11FD008.protection.gbl (2a01:111:f400:7c09::127) by SN1PR0701CA0084.outlook.office365.com (2a01:111:e400:52fd::52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.282.5 via Frontend Transport; Mon, 4 Dec 2017 22:45:35 +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 BL2FFO11FD008.mail.protection.outlook.com (10.173.161.4) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.239.4 via Frontend Transport; Mon, 4 Dec 2017 22:45:34 +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; Mon, 4 Dec 2017 14:45:19 -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 vB4MjJIG003469; Mon, 4 Dec 2017 14:45:19 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id vB4MjJJV003468; Mon, 4 Dec 2017 14:45:19 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 06/22] qla2xxx: Retry switch command on time out Date: Mon, 4 Dec 2017 14:45:01 -0800 Message-ID: <20171204224517.3409-7-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171204224517.3409-1-himanshu.madhani@cavium.com> References: <20171204224517.3409-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)(72206003)(106466001)(36756003)(86362001)(105586002)(2906002)(16586007)(110136005)(316002)(76176011)(8936002)(356003)(8676002)(50226002)(54906003)(305945005)(81166006)(51416003)(33646002)(47776003)(81156014)(42186006)(1076002)(189998001)(5660300001)(50466002)(4326008)(478600001)(87636003)(48376002)(69596002)(80596001)(6666003)(2950100002)(101416001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN4PR0701MB3824; 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; BL2FFO11FD008; 1:F/8IDOog9vdey7pCrnc3Cd9yZkahefKWWnq/1SNnk8tlIXevBalqmQWANMirUUxg8Kr7l9fxZWtN24F33pfg0jHRFW9eSM+PYMI044qS6ZHkqHRrsWvh4CX6BjL5Sn7V X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 45f3a86e-f619-4e7a-19b5-08d53b68bb70 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603286); SRVR:SN4PR0701MB3824; X-Microsoft-Exchange-Diagnostics: 1; SN4PR0701MB3824; 3:vGd0qFem86FvdjI8OOcciPcB68RpYV1yOgSLnBK3egGFQtAN5LAI4kqUlV59yIjOIAHFgJACOCwugAh7uYYLUtxMH2pdz2Vz2PPcJWB8ZdIucG7MeYXeFCP5Rs5dbVZskoXSQHp4I2fHHCCHNydr6eqHZBVO7cyU++bePiOrwa0qZzdLdwWEUGzeZxqJv7/kjO/xoACBhxFT+yeSASJSIiviccLAvTBaf4o4Poy7X9mrub3b2gGUL8lURUi35Bf224tX2wsGf4IXHOU4L8q08VQ+IXKGnFw0tQJVWBcK3oIqJubDc+GUON26NjDI70LnDpU96ARumeymis6/EQOk0Tb8PhYOrx4KCNPeC1r4RfI=; 25:zn1k/U9PDC65TOfK2Yuqez/VH6z95wJuiXq5krOO1bgEwUHVYvlHa+8mkaT/cgHSq77Ai4NpbFCRQaQ4C/IXEWzU/5e2S0ogy+CuzBN+omq8UY7M6/2Qptht4uaGX1LW4q+52MWimam/9KQnt7V6Ha/lusR0xui6coN21F0l7mKU9qUh2rRrx3ATuUE04hL+iFwBsS2+uyFT9d3FO9uGA4jODpfvjxGpWvOTgZYRRUCMGSs8a6Tw7CmFwlKt17aLnJ6zb5hP2i/5RSoeNz4YVuguiWg6BPwitLdkTjUNrI7J7fpdFq36MN4U159QQ7L9eSei57JtePL4EajSXW8nPw== X-MS-TrafficTypeDiagnostic: SN4PR0701MB3824: X-Microsoft-Exchange-Diagnostics: 1; SN4PR0701MB3824; 31:y/oEHYwEmrBzZGx1+0g7oEMVuXr9L7q970zWvlkFXAdEsHowFu561bgDAW2t1dFmsOAXtgSLURbQPWcfn2AR937E9zd9B81xJ3SVsEbKr4oorAMuNQnj4QvsWQbJatF9pDXfq35wuzBceI1scke4OWVIiDDs3PXKpa7BfGcfBL+kc37wTvDW3jnR7CBOPBTx+VbrK45KhTahzpqrONeXh1Pl8V+qocTIx5c8/iFLJIY=; 20:4TWgVWw5LrXYcKcZ1GrQWKy4Lx40zHKidNWekFvWhJuOiX5l+9vGiCuT3kM8k0jCu44R1et4KCBuwi/aUenjMs3cV4OMShjE6p5V2B3bei5Z9DmKQwRYaUc9rBAD2/cN/MXWtSNyEhar5lCdVlLxRQp2c5rl4n5xxrzrP5IVun1yspec2NetEAc5G1FwedilC82ritEcxy+VtO8sUu1lO4RfGqVdrTgUKYG5ZE9IECTUIyh4Fw0y8gBYmrjElcXebjhhw73iAKTgqDX0gIFR1eDRb+7YTtTNy27mFVkSPQQRePeK+0DR8LcBQq0d9D46N612fKhB0DLI+gkK56bHlAzB1FROWcNySqV1iot9fN8+WYxNoH2Izy8A674gp+YKZmkYiI+bhxDEoAPaCdfQJquNRvRJDB/xD0m7JztLE+vq23ePXPtQvtzZp8kltlr1uS9PUgObGGdN+USfM6N9sJPLLERY3kaoG6iv1t5Hmmn4yBtohPykOjwptDMkG78s 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)(3231022)(10201501046)(93006095)(93001095)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(6072148)(201708071742011); SRVR:SN4PR0701MB3824; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SN4PR0701MB3824; X-Microsoft-Exchange-Diagnostics: 1; SN4PR0701MB3824; 4:ygD1X2smBFLsfxddkiSRLc4yQDq+WPFuZfgz3yertbQ1+SBpxFyjK/fdBRlMWQe7JeJDprt7r4GgC/3oYTdQ9G+Vderj12G4rO5HPU8FHheaC+eLT89wz3kWOuDTP/AJyKtUXtIbpIqH8ugKYhMj+CUYVVv5ujS3WjbbmCksdrEmu7pDsIhBux4oOq+DuWrJjFAO968WLOo/l1iVSXIjx4xkoHh6YqkYxgonSCAgKG7e4p/EmzE/giLXBVRDBIGd9261C7XRMEN8+9J/dKTB5lCnKHnn2QKJUcodHOcJL2ImBkVnswCFEtn6842oGyha X-Forefront-PRVS: 051158ECBB X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN4PR0701MB3824; 23:TsV1tQtrc9oYHRp3woLCX9GZjB9AoCkMegX9Gk+?= =?us-ascii?Q?WnhRZ+AXiZEW1L/f4Kjy73jRNG9iZcQhURO4nJiLRj5GAqyO0OKPm7CuQTGb?= =?us-ascii?Q?E9M7UZNAjafvMwDMyDSQksTO29u/wSxA7zFXD/C7K7BxqkXViGmr4R3CWEXX?= =?us-ascii?Q?hS+ffZbrCyKmHa4Gcbpo/YnjVQdaEpGUkGcpF8OJUXV+73Hg7qI0Iz1vOaUd?= =?us-ascii?Q?OvcJmrHuhie6UcPH4mVHg2E+1Cskp8N+I9RDktJZPEuYDS20dRsg7/449P8c?= =?us-ascii?Q?nEHCkHf/8rJzIU6gYJWri4PGfQfL4zxeHzYe4dFvjMCmiygkcT3Bf8S2v5x8?= =?us-ascii?Q?Vf9usqunxqjXARMF8ut3FKeOCJG3gyTpMnsMgLQDvTEEYy87TSfjvDTapy7t?= =?us-ascii?Q?wm0ASQwo/XlHX1NvtLpQVIaJHITM+gZm8z+woFcmjuDxj7uha3WUpnFLVleK?= =?us-ascii?Q?2vG00QQMl8sqG2nXXWumQKNqoGp3fbbeD7oTI00kRB0JSWpZAU38H95dlE72?= =?us-ascii?Q?tyJNY7oj5tJ+b6jZw0QmG/tRnXMIT9CmoXzrfG4oKQXzctDJ/MJxxgxRbp8G?= =?us-ascii?Q?0QJv/J0yX40cUlNLfOVOJLmw9RnI7vdlUMXAu7rQTFfQw7iHVcpsRk5vaApn?= =?us-ascii?Q?SjltHVCGKl8ePOiZPzCV4Wz6tYag9teYR/X0LdfeuW2EgL5z45o4jpz7IVw+?= =?us-ascii?Q?1YTmkgpciO0pfm865PLOQbMSQz1Jj9bQt2M7RJKgk8NwYXrce7STCuxWWcuK?= =?us-ascii?Q?E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SfRFJTFGp1gziz7X0RlKaINk1hIfaxyzMn6f7kjOQbXHTPYI=; 7:wQlyiEA2lnLiTG+cmrPrZAVodxqwbpzNWqPHbduaVe2NyqexLSiOHaeCmnL2v97r9QhLYpx03zxG5K8BTzjk/btFA5s2rMvMG9eKZFwsK7QqvRgoPT9pmPB52HvI6glU4SAQFVWFWDMgK+CZ2dQeRira5b9YJoYScM3hFvveDie6plflWimf5fXZCx3IyHmLHCAGKTEI1wJGDSlhzqNRVyiw/aJ75rv8WcpsZG6sg5ErjCVXcKewNkD2pj3tnUto SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2017 22:45:34.6216 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 45f3a86e-f619-4e7a-19b5-08d53b68bb70 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: SN4PR0701MB3824 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);