From patchwork Mon Mar 12 18:16:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10276943 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 B28E2602BD for ; Mon, 12 Mar 2018 18:17:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AAEE28E0A for ; Mon, 12 Mar 2018 18:17:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C9EC28E71; Mon, 12 Mar 2018 18:17:13 +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 4FC6F28E0A for ; Mon, 12 Mar 2018 18:17:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932773AbeCLSRL (ORCPT ); Mon, 12 Mar 2018 14:17:11 -0400 Received: from mail-sn1nam01on0083.outbound.protection.outlook.com ([104.47.32.83]:27072 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932696AbeCLSRG (ORCPT ); Mon, 12 Mar 2018 14:17:06 -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=1w4l6Z7csn9sixQsM+H0npmtSx7SRb0zkFyYfrMbFUU=; b=m6Jfvvk45hhG+k9IDRzsnEijMuNrXMK/i1RHWeiloFIRT/4VtaegCd8jC7U8YeE/QnOBW7RHm1uigWaQkirUH5Su0ryzpeiX0N0A0Zv1fjc/1zft7GRUacTiC38vrrMH36jcTd5oCoJtDeSqFOtzqprXVCTfTSErBCA//rHt/10= Received: from DM5PR07CA0042.namprd07.prod.outlook.com (2603:10b6:3:16::28) by CY1PR0701MB2092.namprd07.prod.outlook.com (2a01:111:e400:531e::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Mon, 12 Mar 2018 18:17:03 +0000 Received: from BL2FFO11OLC007.protection.gbl (2a01:111:f400:7c09::128) by DM5PR07CA0042.outlook.office365.com (2603:10b6:3:16::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.567.14 via Frontend Transport; Mon, 12 Mar 2018 18:17:03 +0000 Authentication-Results: spf=fail (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; HansenPartnership.com; dkim=none (message not signed) header.d=none;HansenPartnership.com; dmarc=none action=none header.from=cavium.com; Received-SPF: Fail (protection.outlook.com: domain of cavium.com does not designate 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BL2FFO11OLC007.mail.protection.outlook.com (10.173.160.142) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.527.18 via Frontend Transport; Mon, 12 Mar 2018 18:17:03 +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, 12 Mar 2018 11:16:52 -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 w2CIGqD8020759; Mon, 12 Mar 2018 11:16:52 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w2CIGqx2020758; Mon, 12 Mar 2018 11:16:52 -0700 From: Himanshu Madhani To: , , , , CC: , Subject: [PATCH 05/13] qla2xxx: Add FC-NVMe abort processing Date: Mon, 12 Mar 2018 11:16:42 -0700 Message-ID: <20180312181650.20704-6-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180312181650.20704-1-himanshu.madhani@cavium.com> References: <20180312181650.20704-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)(39380400002)(39860400002)(376002)(346002)(396003)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(81156014)(8936002)(186003)(316002)(305945005)(42186006)(356003)(80596001)(54906003)(59450400001)(69596002)(110136005)(86362001)(50466002)(16586007)(36756003)(47776003)(48376002)(8676002)(81166006)(26005)(336012)(50226002)(106466001)(72206003)(5660300001)(87636003)(478600001)(105606002)(85426001)(2906002)(2950100002)(51416003)(76176011)(2201001)(6666003)(1076002)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB2092; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Fail; PTR:50-232-66-26-static.hfc.comcastbusiness.net; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC007; 1:DpCvf9JnDGvaAr3pTB4/6VJMhMBmLJ7FtZ/0kBS9Xaf002Wz2nEc0dAHAx7WdcbKz/wR9gngmKkXY599nbQeERgrOIVCZmYVpxX0q2oRvuVBa8TfGtPUOEJttKOWhdLy X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fe2c64d2-b1a0-4064-fdd0-08d5884574bd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:CY1PR0701MB2092; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB2092; 3:gr6c4J71HdO6/8/FvAEIAvRnMRDKsJu9ntMn7tav3Jl0nPV6OkQH0t4Z06Keg+JiO2PnkDYcwGn3G4bH+dRkd/CBs8iIL1p0jEy607uOAE7u6ZXFBZCoXHy0h2IX8AzDg/Isn6ROJS1KZCzl6+VJGgEISV8i7dDF092bciuCOu5oD05XSc07vNT1kf7Pci8VzQ5ifscGcfTy8vKRiusUIfXXr1JpNQEBrRZnAL1GTwUHbUkzgGkeT/xY47HObdf+FSxCK+LI+GGGrOlzvdL2xtA384FiuracuF2GUihLH/gnKfCA5P0mB+7hIM2JhAjS05cLwe10hrcxQ85dTHhsTasoBYSilSG6EdK2a+uvX60=; 25:/5Cz4NHSnrU8DaF3Q/2JPDDdRZN6VcqP4mGGUiAXBvNozTXlNJ665joQxQcmRpR2MOBH+yLnnR0HfOA6JT/JsgYKPOno7SETIbIuwBEnaTuwSCLvryn7Y2HeFJojSJ5tsYM7ddGlBJYUh1EudrW26qxYRzUhy7Tl5ug0ZorecHRH3OdtUK3QuufdsWtwNNOBsWyOx1l1vFL8SfT0K0xESwChua+g9Y9Wldbs9NCaReBoaLWjl2Z+HqLkuTmrz0WMiLrpOa7mLaBGmvU09IzHtm1kgRLsCz3j20+QytE2PXRoLw+ztvSoEjvlMOT2zROL4hJ3vHtMjNxqIAzS7/9IIw== X-MS-TrafficTypeDiagnostic: CY1PR0701MB2092: X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB2092; 31:tgUFattEiTd/Nz6CoK6AzbnC5A+Z8/QIzQaS5uIEAPG3+KiifA0YiDtAbBH0YTVSQBhW4q4JxmPGkon7q93N0H+MIBa0aaJ2VHe3Q7vwe2CQmgLjSx/qdqjx7xVD84JCli0dxbK6G78Tm7+Z3g2IyEV1J4rjlppSnIsDc+hvkULU4+NIQ5BobT42+rIj4ylDU/lgK7YcqUsVAYGUtZVi/IxKZWm/w+Y7siDnFThm2+w=; 20:lEGBXDFhC8n0jYt87Tx9ARbTV5ZPshS/CrHK6b6iYD2C6b7vrjE7QiNRx1gzmt7J6urPKwlG2xAQNhQuKk8abIygRCzhv4HB8TwVH7INWrsud1du83OUqHSAiGNLKACwuLSaUZL26g83hPpwaL5iExOhKFnaghTv2h2tZN2TM7WXGTrPHN6aB8omRhT9Xh30V36AF35mkZUmmS6m/RiqyIWj7RwB8t7a7Gcn246L4d0LABeYDB9X6GFTjbV1S4x71CjvYkW0yVUACvQK28LkxcV9IjKdf5tYWREHJdS2BLzFKSzAxpLyMAl7BAm4T/2AXBiFFRmIMeM0tR5kvTw7Aw6975jVpvetYb/bJUSuZwkMwJSchH2mxX4xz7ueqHhQ4V+Nqv+jXFcm+TPoC6jSGPi50kOYcAqBOcKzRLfP/9hz+JvvHeR45uYFLlAfq+0jJJ3q8tzwi+sEctfE1TBVBbm1etHtdg6xqsarSPIqzKMmBPPbvNnfLTmjLMFze6kd X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231220)(944501244)(52105095)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:CY1PR0701MB2092; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB2092; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB2092; 4:4r7F0WVlUmRjJ/gIFZyCFGe8JmZDYNednHYr0dPF/Q2SKvgUn9BCDGzb6u02RoVW3XWqMrjbYeeENLepcbbVtiJttSMVVXvM0Tpe4iNGyN+7ITLVy6zOpcdaBLVQptDUyDUlIUQ43py3hRU3qYF+V8DzJ5rBkwcQTJO8FSU73LYpipLBlSwrPKWTvFEnZemUO5YgsKaHUwi8WsnNF+3v8nqptIWgIQ3+izJcEbjDMkwcNicRKnIdYnEUIGO/XBYu0myrhHRwJTo0p5RB7lJPNw== X-Forefront-PRVS: 06098A2863 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB2092; 23:dusZTVHDABfIfuM9p+wwNq56YWv9dzHtJgEAPdw?= =?us-ascii?Q?vOK9QmxqXd+69DaRXDldTVZRgWBwA8oeTE9/BCf6sCwziTlK9uSL8TsMX4HL?= =?us-ascii?Q?S5OOBcLvRE+5tkpgqyYeQJI5ETKt8LJFAWKcILB4T4KJeKll88lBtz4spUov?= =?us-ascii?Q?FRIOGm6V4ESZrEz3870V9yR9S5exZtR02DjAygJT+TOgnk+HfOGmo9vK3SKA?= =?us-ascii?Q?DMXb8SlQIVtg5eawvmB9IJRpR7x9pISZw9CUeEqL2FGOfmmYz3qJuINd1ZOD?= =?us-ascii?Q?+My3sBglvdmGelVqcW47bsSA2bl7x29TkAu6oBz+9MfnfioRmPS0mFoHkPIF?= =?us-ascii?Q?1/VBre5dhnvmujsrgk4FWs5wBHRkDbKeekZCF2cD0YXfG9seVzjZHwjmHloK?= =?us-ascii?Q?31Pq2EuSKO/8mdDGC5gWhFkcZ+IlbsyaDHLNZ7cwEeVLaYhHNP9V3LkBHaev?= =?us-ascii?Q?Qc9HuFvuMjW4Q3ALSG93tDrYChCQjWoSnPul7z80qUgmdOUJAOpWfEW5GD92?= =?us-ascii?Q?Qqesl4Nr+uGAzBn0QOYJAeqZU5iQR6I4AUzcYrn2C+lVtaLwIStuJpXplYH9?= =?us-ascii?Q?W+ZBFACp2xWI1xFrFoNhNa50MedYq+LrDwLBcNtBs0wT7VGrLfwiPKhJ3MH5?= =?us-ascii?Q?LLs+wQ1dfmGpctE3PSD8V08B2zP8GXGKa1q/vG8hOxXhNmJh25qxw46XLxHd?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m3AkRXsllrqT+masBiE4kOhaejT1nBD884iAEDOF3LxhPRD0pmSzR63e6tCZbz1GCP3WloOthmf98oGuIOqp1r9c/1EQHAvwLJJjwZZAMk9eY=; 5:/Si3vraRagjSH/Vlk62OJKRVIgeVmxjmbbVjiobZCV76OluuzNRGwkG8QEQcHxuRn5RUr6V6/ZXf1vVB1h4BOR/6S6ag30oE/G7ltPUqhwdOvsuaLJvquTyKi401T3Nj7TGUrrZrcsGmex+RYHLpdzzj1TzBjYUpch15qhzoVFw=; 24:NDkf8Wl/50O48n/z8EN5RG5adZm+M8ifrwBJqAXey74Byw03zQz+myP+wipwDTH8L4a6kRP2g9VKLAAZJVEqpA0nlF3UPFDLC01ZHf9xK4o=; 7:cJJYJ2+z7ODrpLR1bPD+zYcbiKoSrRsJkIZzqDLImaJ696Qc6OWTQJaI4/9gy4FziN5Hz8JKeqBmVxnPv1kK+9RbYMvDxysvirM635uvTalVYuWWNuPDWduBPEidovUgVXwcQEJlrpbQ/NoQh5sq6Y52JCrFCWcgnB5aU2uaj7/FW6nmYvUBUXxE77spsNfmVOnY3ckgRiXoxW6/TwgDELjDClXIwwNs5/EJAJTvbvzsyK+KJXHj2KjY7z0tnqkP SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2018 18:17:03.1934 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fe2c64d2-b1a0-4064-fdd0-08d5884574bd 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: CY1PR0701MB2092 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: Darren Trapp Signed-off-by: Darren Trapp Signed-off-by: Himanshu Madhani Reviewed-by: Hannes Reinecke --- drivers/scsi/qla2xxx/qla_nvme.c | 36 ++++++++++++++++++------------------ drivers/scsi/qla2xxx/qla_nvme.h | 1 + 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index 5ee447680ddd..951fbbab961f 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -181,24 +181,32 @@ static void qla_nvme_sp_done(void *ptr, int res) return; } -static void qla_nvme_ls_abort(struct nvme_fc_local_port *lport, - struct nvme_fc_remote_port *rport, struct nvmefc_ls_req *fd) +static void qla_nvme_abort_work(struct work_struct *work) { - struct nvme_private *priv = fd->private; - struct qla_nvme_rport *qla_rport = rport->private; - fc_port_t *fcport = qla_rport->fcport; + struct nvme_private *priv = + container_of(work, struct nvme_private, abort_work); srb_t *sp = priv->sp; - int rval; + fc_port_t *fcport = sp->fcport; struct qla_hw_data *ha = fcport->vha->hw; + int rval; rval = ha->isp_ops->abort_command(sp); ql_dbg(ql_dbg_io, fcport->vha, 0x212b, - "%s: %s LS command for sp=%p on fcport=%p rval=%x\n", __func__, + "%s: %s command for sp=%p on fcport=%p rval=%x\n", __func__, (rval != QLA_SUCCESS) ? "Failed to abort" : "Aborted", sp, fcport, rval); } +static void qla_nvme_ls_abort(struct nvme_fc_local_port *lport, + struct nvme_fc_remote_port *rport, struct nvmefc_ls_req *fd) +{ + struct nvme_private *priv = fd->private; + + INIT_WORK(&priv->abort_work, qla_nvme_abort_work); + schedule_work(&priv->abort_work); +} + static void qla_nvme_ls_complete(struct work_struct *work) { struct nvme_private *priv = @@ -264,18 +272,9 @@ static void qla_nvme_fcp_abort(struct nvme_fc_local_port *lport, struct nvmefc_fcp_req *fd) { struct nvme_private *priv = fd->private; - srb_t *sp = priv->sp; - int rval; - struct qla_nvme_rport *qla_rport = rport->private; - fc_port_t *fcport = qla_rport->fcport; - struct qla_hw_data *ha = fcport->vha->hw; - - rval = ha->isp_ops->abort_command(sp); - ql_dbg(ql_dbg_io, fcport->vha, 0x2127, - "%s: %s command for sp=%p on fcport=%p rval=%x\n", __func__, - (rval != QLA_SUCCESS) ? "Failed to abort" : "Aborted", - sp, fcport, rval); + INIT_WORK(&priv->abort_work, qla_nvme_abort_work); + schedule_work(&priv->abort_work); } static void qla_nvme_poll(struct nvme_fc_local_port *lport, void *hw_queue_handle) @@ -650,6 +649,7 @@ void qla_nvme_delete(struct scsi_qla_host *vha) ql_log(ql_log_info, fcport->vha, 0x2114, "%s: fcport=%p\n", __func__, fcport); + nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, 0); init_completion(&fcport->nvme_del_done); nvme_fc_unregister_remoteport(fcport->nvme_remote_port); wait_for_completion(&fcport->nvme_del_done); diff --git a/drivers/scsi/qla2xxx/qla_nvme.h b/drivers/scsi/qla2xxx/qla_nvme.h index 7becfc1b3e69..8df379478269 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.h +++ b/drivers/scsi/qla2xxx/qla_nvme.h @@ -31,6 +31,7 @@ struct nvme_private { struct srb *sp; struct nvmefc_ls_req *fd; struct work_struct ls_work; + struct work_struct abort_work; int comp_status; };