From patchwork Tue May 23 13:19:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dupuis, Chad" X-Patchwork-Id: 9742569 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 4938460388 for ; Tue, 23 May 2017 13:20:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37354287B7 for ; Tue, 23 May 2017 13:20:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C403287E2; Tue, 23 May 2017 13:20:25 +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 5AAD4287DC for ; Tue, 23 May 2017 13:20:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759684AbdEWNUG (ORCPT ); Tue, 23 May 2017 09:20:06 -0400 Received: from mail-by2nam01on0061.outbound.protection.outlook.com ([104.47.34.61]:19872 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S937116AbdEWNTz (ORCPT ); Tue, 23 May 2017 09:19:55 -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; bh=U/NFASZoPXM3j+a5JusfdJYMvkI+n8oKL9jpWTQ5sGg=; b=AEW04iXNH4FwnApMJ3+8XtkJ78pcWMg601QPAiPpF7yVZ+yT5OzFLbBJFmPjTY6Rdz6BtDRNs6XeV6zrzPWo3OHU0fnycbLrVxispXCvq7dy1ASPseH0akckaPDeAx5D7T38gnhCyWImPMU7m14IewWS69xQbDX6Vi59kyWdR4U= Received: from BN6PR07CA0022.namprd07.prod.outlook.com (10.173.33.160) by BLUPR0701MB1012.namprd07.prod.outlook.com (10.160.34.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Tue, 23 May 2017 13:19:47 +0000 Received: from BN1AFFO11FD012.protection.gbl (2a01:111:f400:7c10::136) by BN6PR07CA0022.outlook.office365.com (2603:10b6:404:3a::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9 via Frontend Transport; Tue, 23 May 2017 13:19:47 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; oracle.com; dkim=none (message not signed) header.d=none; oracle.com; 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 BN1AFFO11FD012.mail.protection.outlook.com (10.58.52.72) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.1075.5 via Frontend Transport; Tue, 23 May 2017 13:19:47 +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, 23 May 2017 06:19:33 -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 v4NDJXcd001844; Tue, 23 May 2017 06:19:33 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id v4NDJXu8001843; Tue, 23 May 2017 06:19:33 -0700 From: "Dupuis, Chad" To: CC: , , Subject: [PATCH 08/15] qedf: Use same logic for SCSI host reset and FC lip_reset. Date: Tue, 23 May 2017 06:19:24 -0700 Message-ID: <20170523131931.1777-9-chad.dupuis@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170523131931.1777-1-chad.dupuis@cavium.com> References: <20170523131931.1777-1-chad.dupuis@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)(39850400002)(39840400002)(39410400002)(39450400003)(39400400002)(2980300002)(428002)(189002)(199003)(9170700003)(5003940100001)(6916009)(4326008)(47776003)(2950100002)(478600001)(105586002)(8676002)(42186005)(1076002)(81166006)(72206003)(189998001)(305945005)(80596001)(6666003)(86362001)(54906002)(48376002)(50466002)(110136004)(107886003)(38730400002)(50986999)(76176999)(33646002)(50226002)(8936002)(2351001)(106466001)(36756003)(101416001)(2906002)(356003)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1012; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD012; 1:ygyuqJjFCqDLaW9q9GUR/We+wh8X5ta2Qvd0sR+zuEd/cHIMKBVSVuK0Xwh2LsBljvO83k6wzwph4zovCg8HSqstG7Wm2PHNvYiYRU+O5LO7rNRni3NmXaejghA95IJTek26zNxvLID1GzAzj+g2O5T3ia9fl0Ax0RB7u9DgdxgKqHxE+YmA/JpvbHahJ0Zb2Xg0Jg/UTdZsTrlik1KSJkAibrx6iRUkOXJHo4ISiuraqJ2BQKcpZP2NKhVs6emX+O/gzOPz8M8RK1J98gxfbnblj2ZQzJ44Y0wJAoHSm+c9ItStnEVCmURgysmyecgVQ1m0w5sTu4jvYVh/ni0/lODI+QeU+/RJl9UH/mtdmflArNqaO6+O6qvlSg6muzaT82uheRRh0UejBGRPZDkjJwS63fFdYZT048/Rem/WchXRwsBPK8P0s0+kzkpkkXw2G7gYv96ntxokhVM3JSov/1uBEp+xIJLGEwmMJIM3ejncxr/izLZzdjtx3xFGXTYTyqmYR2Acyx6TXtsvyN7h6g== X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLUPR0701MB1012: X-MS-Office365-Filtering-Correlation-Id: cac03f4c-d59a-4fcc-07ec-08d4a1de62a8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:BLUPR0701MB1012; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1012; 3:wlmXqI2j1jmKU47xH7erkSXEyle1QCc02bCqc8J3PA4Yqeg1FvwACTUfHa92m+D34A472CnOcktpQGp5sc/pTuzShCpCX2FUNkZwb0syALURY/KtQoe0CFqyAAdVyUUR3SUjUi88DCsG7ZOFvL/HJBv+mBIiHOHvNsNojHsf6/ltHQh04lGRgGR3vJKvRuukRc6vyvsWg3hozcUQo+GbVmplV7Rkxeuon8KT8v3tzWjWHOsiVrj3j4AOcAPCe2dGyLJX4NjT/Il6YgqOfZWmFctZgbuXWD5Atcl7VT7qtgfIMkqvmyS0nzM5WidlO1TGMMun6Fy27cwebViKJQ9mh2GbhHWnvwSQm8DkGvj4yx9VSv+F/c9v757SkF+53qBcBT4JA3RfUCxxCq6tr6mYU9IK+GMF3k0sU5CGGjDLVaqk9YVxAJh1AlFnwiQ0p7H+Xpno7ULaDX9ba4VRIlwMNw== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1012; 25:rEaBGWwbwaZ0yQOuyh5YdySTaqn8tHfRHJ/KQR0GAqsOzF8jUmNgVGi4U7GpRrDlVnZP9v6HAmmWsSosicEp6kgEe+oN1IYbSrDLJrfJyTLBFZ/tqmxOCKkHRucj0DSUoIEO76EtNc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ptyJVEQv3zC1TPu/mEd0VHydmAzNh3gfgCj9+dB8elKAsutT0bletnicIuPOQMxcWCDcs6ZNSSxjjerozKMvgkaN3h4LrI+y162DyPaLf+ROD6K/voZJN4otR0rF X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(13018025)(13015025)(13017025)(13023025)(13024025)(5005006)(10201501046)(93006095)(93001095)(3002001)(6041248)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123555025)(6072148); SRVR:BLUPR0701MB1012; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1012; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1012; 4:CMdK/BASRGKrQEs6mofUvk3eZUj4JcXuwYJ2Hi82iOa/t/wXv4Ubuku7CkwwGxXjHUcyMVZ5+bGKEFMD3zm03nxeT+46hKyBIaI/jN70ydMWh1STDJQT+OrPdS/DRmK9FwPLRlCLaDOPaS5sJDRbhVCpi5o5OIQT5T/UOs2p07sr22Lt8VSb4YQ8jhfq77WV36fBl3b1qHdf16Q/HqTglm7K/kN4HC0zLynF9LaiDaR+ES/cZX5uF3i2jFB80CTHgysEghfz8cWf6/C3LSYKHgfZh1o52MzHPRPXD0Ru9nBX3Fea/duwi1sQh9rM8/ooITrO0Bmt7XALVzTjCoaF1sOkgw3BFz7ghOC8CYkQp4tmWYPbgmY4G1kf5NzOmK0DV57moNjFXQP/u5+huWVP3/OcgV8OrMTBiQMzu9kv23aTsV7hXkQkkkrPMwGeFtZ4ygQ7Lg1qmPUsR0K01I+UCjtNmKuG84M9fRuWwHEnFqrD0Xfc/uL6impnTkbXtF4p2HDF1BJd9HK0ViA+J6I/c7gM9WDC0ybJcLgvvoZ5w0nmT+V9/QBeJXpebI+IUHoe+hVhIr08cIotEgFyxqgFL4edohaf5oT8XnigyI2bDKS+6GR6ZoRMIzu+rlYX1aPQZqFHcmEaJ5613jd3jkcJB8Yfg4AyVD3YiMybJmMVBfS0USTq0y0+SIwpNcbadjX7BDo93sa0EiYE94R5mFWWB1j9nj/9wQVTLciUeRlxLJgDrwhGgwWfxQd/fkunQ8U/yzm0jeqMR59cVVKjhcCVAPlvwIR8gYz1a8GDAiThF+jlgfjLAc3hTly3IbVO1BjFveuaqP3Ua+7bMP2geTFkLL1Oz8bqV7POnpJFk8IyLfuU7YlfpUGZHDOKZ0KvK8Ph X-Forefront-PRVS: 0316567485 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1012; 23:pI4ZJYUwDMpm/lhRLFK0N4cUh+10ism+dAkiyhg?= =?us-ascii?Q?e3a6yiSY9pVR8TztOGXnLayiTsGwvjcMkrf4KPgDYjMV4UeRPlxrsrfGyXzP?= =?us-ascii?Q?8cIubseiEOjUMzdbEOfyCA9+DuhxVlPEbFtaIyxX+42/pAxm9A8cDFSoziVy?= =?us-ascii?Q?yEoYXNGzQlKrjtz1vz0kLW+B64WnrB3J5/wplXJS15qj47odX2KbZUaey1fl?= =?us-ascii?Q?20aJ/mqFd2sLvrCZb0PH04LjvrW6WP/S3CDjUyHFkk5ueAn56V3mXDiwwVsp?= =?us-ascii?Q?svTBhhmOy/YleXUGkVXM8jDJN8xmuBSox+/E4CUB/jvsaGwjCLUM/BFpcAYq?= =?us-ascii?Q?BhczsmYfKoTIZ/+pM3PSbSd+59qx9Y/q7AyI+4r2jeHa8mqiuS6xPj1PLlJY?= =?us-ascii?Q?izts9X2bzC9ds4eTjrfYUUUV/yoZmF+zwoMLCJJ92hKecjfpYYF1gLinozNd?= =?us-ascii?Q?r9FAeCvzvWbFj2iVoew9ya459NTwAepwXzSI73+ATYlIWZYoUNJhK4iPg0Xv?= =?us-ascii?Q?YquO1+wXhboNhzW848P6mtqIZTgfGHFC7+HqQrCJhyu+aCPDPVqzWrpmnRDm?= =?us-ascii?Q?POMjKU2nILOz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v/tba2wQRz4JffMpvgt6Y/r6N1Ics6jFbBKwWcOLFCkY2WiEkl43wlzHkknovLvU0LN9N56VEbZ96lpziD/UyErrO2RRiEnTPvlq+vzuR2NuJ/JjGGH7pW/i1foShxo6jaJrgstj0Amg10Gv2fmzcm5S8j6u4ZfcHlIVomW9peiYr+B2a4aDX8aBRmT/G1ug==; 5:dDsCtnYMgO0NNBlPXLymq0x+tylTl5sEFmViNk2iDrpMKU3PS5fwf1lZ3W879C5EyZSZBrTjF2ZRjL/hy8Nwrlh/dh+7BDkLtvAv4Z/nkpzKqJvNxAb1HAER+4KvLi9ngloceSxcMtGpjJP6a0BVQw==; 24:rD8fxjqcgbKd3BksQuDQ0cEVpmESatePLQSUqYJDxpuOCghuy3TO1bev80p1M7gtYFNysd4AXQzzopkOhRNpOpAS3L99wGVHs1ZVokE/b4Q= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1012; 7:bFPTUz7nMiuvYQeK5hv+lSs2+jYvApLSgW9QUfWjkxN+E84i76Z1M8x0JU5BrOFXfNlPisbCQV3p7YrYUUN7/S+mqpvoVVLyKozTC3dNI/T/cchWcGXNhbT+QjV9kjLTGro2Fm1ATBKtJZxITvujNrHzy/rbkgy83NyFpOJ3pWN+8bDDHzprbsmedAEBNvHzDrVUyL2Vb1auM8zkxa+SDeX2jFHk+MLel7Qa0EUzCXaWVx9SjA3/UWz6q8qL27g9pZ5mFeIpWPfjOj31mW2D2UoSl7VtbegqjIVvWCg60KteSI8KDqOrs9U9wXeVwDd0CSGbYCndlBzFR5oRWVmaXQ== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2017 13:19:47.2485 (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: BLUPR0701MB1012 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 We should be using the same logic to do a soft reset of the FCoE function whether it is initiated via sg_reset or the fc_host issue_lip attribute. Refactor the host reset and fcoe reset handlers to use the preferred logic which is currently contained in qedf_eh_host_reset(). Signed-off-by: Chad Dupuis Reviewed-by: Bart Van Assche --- drivers/scsi/qedf/qedf_main.c | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index d6049cd..fa5a2f8 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -640,27 +640,17 @@ void qedf_wait_for_upload(struct qedf_ctx *qedf) } } -/* Reset the host by gracefully logging out and then logging back in */ -static int qedf_eh_host_reset(struct scsi_cmnd *sc_cmd) +/* Performs soft reset of qedf_ctx by simulating a link down/up */ +static void qedf_ctx_soft_reset(struct fc_lport *lport) { - struct fc_lport *lport; struct qedf_ctx *qedf; - lport = shost_priv(sc_cmd->device->host); - if (lport->vport) { QEDF_ERR(NULL, "Cannot issue host reset on NPIV port.\n"); - return SUCCESS; + return; } - qedf = (struct qedf_ctx *)lport_priv(lport); - - if (atomic_read(&qedf->link_state) == QEDF_LINK_DOWN || - test_bit(QEDF_UNLOADING, &qedf->flags) || - test_bit(QEDF_DBG_STOP_IO, &qedf->flags)) - return FAILED; - - QEDF_ERR(&(qedf->dbg_ctx), "HOST RESET Issued..."); + qedf = lport_priv(lport); /* For host reset, essentially do a soft link up/down */ atomic_set(&qedf->link_state, QEDF_LINK_DOWN); @@ -672,6 +662,24 @@ static int qedf_eh_host_reset(struct scsi_cmnd *sc_cmd) qedf->vlan_id = 0; queue_delayed_work(qedf->link_update_wq, &qedf->link_update, 0); +} + +/* Reset the host by gracefully logging out and then logging back in */ +static int qedf_eh_host_reset(struct scsi_cmnd *sc_cmd) +{ + struct fc_lport *lport; + struct qedf_ctx *qedf; + + lport = shost_priv(sc_cmd->device->host); + qedf = lport_priv(lport); + + if (atomic_read(&qedf->link_state) == QEDF_LINK_DOWN || + test_bit(QEDF_UNLOADING, &qedf->flags)) + return FAILED; + + QEDF_ERR(&(qedf->dbg_ctx), "HOST RESET Issued..."); + + qedf_ctx_soft_reset(lport); return SUCCESS; } @@ -1670,8 +1678,7 @@ static int qedf_fcoe_reset(struct Scsi_Host *shost) { struct fc_lport *lport = shost_priv(shost); - fc_fabric_logoff(lport); - fc_fabric_login(lport); + qedf_ctx_soft_reset(lport); return 0; }