From patchwork Tue Nov 28 19:34:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10080941 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 25E91602DC for ; Tue, 28 Nov 2017 19:35:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19B5F280B0 for ; Tue, 28 Nov 2017 19:35:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D78E29638; Tue, 28 Nov 2017 19:35:27 +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 97209280B0 for ; Tue, 28 Nov 2017 19:35:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932152AbdK1TfZ (ORCPT ); Tue, 28 Nov 2017 14:35:25 -0500 Received: from mail-by2nam03on0052.outbound.protection.outlook.com ([104.47.42.52]:4638 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932142AbdK1TfQ (ORCPT ); Tue, 28 Nov 2017 14:35:16 -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=bXyp+v9MUzrSnDZiiocqyAbdWMyX/CSN1xfc7EGiVG1XVR9aY+3+qpUmW/tZYZ9oGCJA5yexYqYNfJPAWuXpm7AyTT362wJDG53/mOh/xRT4TgU4Raaynf4/TBMjbp95tCGU12zJ1Bcd3lAgo8AUqtxk9+2iftmV6kxTJ91BjO4= Received: from CO2PR07CA0043.namprd07.prod.outlook.com (2603:10b6:100::11) by MWHPR0701MB3820.namprd07.prod.outlook.com (2603:10b6:301:7f::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Tue, 28 Nov 2017 19:35:14 +0000 Received: from BY2FFO11FD017.protection.gbl (2a01:111:f400:7c0c::194) by CO2PR07CA0043.outlook.office365.com (2603:10b6:100::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.282.5 via Frontend Transport; Tue, 28 Nov 2017 19:35:14 +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 BY2FFO11FD017.mail.protection.outlook.com (10.1.14.105) 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; Tue, 28 Nov 2017 19:35:13 +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, 28 Nov 2017 11:35:05 -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 vASJZ57q013754; Tue, 28 Nov 2017 11:35:05 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id vASJZ5SC013753; Tue, 28 Nov 2017 11:35:05 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 06/22] qla2xxx: Retry switch command on time out Date: Tue, 28 Nov 2017 11:34:47 -0800 Message-ID: <20171128193503.13695-7-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171128193503.13695-1-himanshu.madhani@cavium.com> References: <20171128193503.13695-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)(6009001)(346002)(376002)(2980300002)(428002)(189002)(199003)(8936002)(42186006)(106466001)(50226002)(50986999)(8676002)(316002)(81166006)(81156014)(101416001)(76176999)(356003)(189998001)(305945005)(69596002)(80596001)(51416003)(47776003)(110136005)(5660300001)(478600001)(2906002)(105586002)(4326008)(54906003)(6666003)(48376002)(50466002)(86362001)(72206003)(16586007)(36756003)(1076002)(2950100002)(87636003)(33646002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR0701MB3820; 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; BY2FFO11FD017; 1:pJKCic5mnHGj2+y0xCiBmbOasyAeKS3T5TTv1VqRbeGRzsfGko668PPWX2EGkFpX6JWzGkgTg2IMBgO16Z75z1p5zcroksKldR+aOxIPqueK0FOwAZFOzSo8NxgVWrYY X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: beb23e5c-509c-46c6-d636-08d5369725e0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603258); SRVR:MWHPR0701MB3820; X-Microsoft-Exchange-Diag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/fQlWvfOWxT3InOC1OQ9hPiilPm0sjbxfuucCKS8PTtijpvsnFNK82ZcyfyamOV3h86r+a7NooXoeqNpUa98mtR0RWSs4wPQhIOGtHA8QBnS7G7gzcvPVwMtCNX2NsQeyQj/gV517YfnIcYmNVvPmKn5UG8aTeRVi6sKxGs4rvEvZNFVvRgtoRbXO8F9I1i0Tqchqsu3THi0G9PUhA4ux44pHTkNVw5jUw1KgZtS5MuFylvvH2DAHtOjidNhT5AvO2cVMenfrz4BmAh16dbkzhwlT0vNzdymZa6KJnhWJmVCbHb/1QhtJFXfNDAeFfiqbranJPB/fM+ilHaW6vHPQG46SJEuBNjFLSgxnheIb7rakbVHeJAOnzeW+ScnVaFOZwrSw9NYi7tyPWqDa8gkGi5JtbKWi240YKylq/65nfdcFI2TfxazKSP8zUahJcdrL6zHFg5AU2H40N2EzsArFhFQFzR1qsgO4UIfx6 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231022)(10201501046)(6041248)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123560025)(6072148)(201708071742011); SRVR:MWHPR0701MB3820; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:MWHPR0701MB3820; X-Microsoft-Exchange-Diagnostics: 1; MWHPR0701MB3820; 4:mnU4tT61TZacuyAc4EDPdrqIZEDzAVBa75ZBk5bx0qQ+7tjrPxfM3KtU9svir7BR2rQo2SjynBvSiwX1hN7XQ43qVN9dFAEFoKgvCgzCdUnaccovxGYRt1u/R3tdsj4GYLVBPEfFKUz1MhKla3gX05d7r45CbqtQ+TlncjZp2a9SJV8lEpng16SEN4Z7G/HSwfD7DbZIwXRXlNI5wVtnZMLmy0Gxo6BSyJDXMoBAmcHN8i9B3sJyMafsOmE6F6mfJHjmEXI06Hks2T1ekmMfiHki8YfIjBLFCujhH5iPuDrF8lpVYk/82E+XKA7pa9re X-Forefront-PRVS: 0505147DDB X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR0701MB3820; 23:QvGWWtB5Eu/z3uu0KZ/dP70aVi4MecBv9QOjDbG?= =?us-ascii?Q?S9KZGPu2xvBXH1vqgR50T/KN0ESNckzNHoEStnvjEoifA3ZbpHUz4HLVeNgT?= =?us-ascii?Q?XT14uNVoxJ/EVe+2uiOyQczEf/KngCXWoqxI1YkpqWwwElI3UcjW3Ro8IKmK?= =?us-ascii?Q?epYe6HZy0DsX2mQEn+SP+UpUe4/yn01wbG9UMGDBUv15LOjb6HlTPF0HROG6?= =?us-ascii?Q?LEbQaI+FL2IjLkoiD71eYViA+GVEJYPjBEcv5kIJko35SD+Ij7tdH5yx+pTb?= =?us-ascii?Q?KT/OOiGDyPOErk5ca2fa3fgj8xifJ/T/rEsfZ1vUNjlUHV1GM4Z0YoQmeIM0?= =?us-ascii?Q?xKTsYXLdJXC/cEBs2GklNWJQScgdmRpzU43hIvlzHj8wJTDTGm709S6JGRe9?= =?us-ascii?Q?AQX6DoG0sj7v6bDNwZs4va19xrdJMWBSNPJ6f3ZYGxib8ai2/rRJfiUpa1Ho?= =?us-ascii?Q?ZB0FtQZpyV00V/6jQjEJ6hCti9NAsX7r7q11uuL5ueb9nmZHxEJeNdta5YHR?= =?us-ascii?Q?9EJxscCDN6Nr00HuZYWJ/sfhXfThK1XJxttzESbcg5uOolSkVAUJJXNnTA24?= =?us-ascii?Q?r/l2PxSv8Brt3SCSaJAOsrv+Cp7tddpm0GSB4dWqPPRuY67y31pcvmNWGZWW?= =?us-ascii?Q?2+9d43VLm2o7GRtGOystzb5iQh29Kp13Ll4u/tufmvoIZDYkp7O8kblc/UXp?= =?us-ascii?Q?GFa48+saxQj+7CcMbW+tknAQ5Ajh4kpqp/JQOWcRIWFLpNT5nh8TkoFk01PU?= =?us-ascii?Q?1HBQaQr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fPvnwYsjYkTU0eK0L/xSLNGbB+H0JdlojUGIltlQ8kO1POuZRbTAaC7KRLFs/vvDi8fB45M+auAk8LTB1g15f9WfmqW8umbkRLdPmJVha/+sKiJ5mWpmKnFawk6VtI6H1FUByJTt71E3gDHO33ozyYCwC3c9hVv87iROum/xSHWKRD+GzNb+MWud SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2017 19:35:13.8914 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: beb23e5c-509c-46c6-d636-08d5369725e0 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: MWHPR0701MB3820 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 --- 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);