From patchwork Tue Mar 20 05:58:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10296437 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 0867460386 for ; Tue, 20 Mar 2018 05:59:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB47128AA5 for ; Tue, 20 Mar 2018 05:59:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF61E29516; Tue, 20 Mar 2018 05:59:09 +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 6257428AA5 for ; Tue, 20 Mar 2018 05:59:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751744AbeCTF7G (ORCPT ); Tue, 20 Mar 2018 01:59:06 -0400 Received: from mail-sn1nam02on0078.outbound.protection.outlook.com ([104.47.36.78]:46256 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751508AbeCTF6v (ORCPT ); Tue, 20 Mar 2018 01:58:51 -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=sNKh/SWEpsSWO4g6/Y2RQKqslq1GDv6vLToNQaAbCl0=; b=YRptdPhic4b8Z9WNhoVW6RnxauUo27rxArjrSP8YNfEcZxjnQRCU87gpF6DiEb19SHhJFWJIzu2Gv/ze6+kGgWMp490Asjar4LpNQZLRHh9fTR9rt0fMGrBJXhhLP4Mbs4mSWwU4OIOTLN/+eVyPwe44dbP1rV9Zb73GRGQDdUM= Received: from SN1PR0701CA0032.namprd07.prod.outlook.com (2a01:111:e400:5173::42) by BLUPR0701MB2082.namprd07.prod.outlook.com (2a01:111:e400:52f4::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.588.14; Tue, 20 Mar 2018 05:58:49 +0000 Received: from BL2FFO11FD025.protection.gbl (2a01:111:f400:7c09::114) by SN1PR0701CA0032.outlook.office365.com (2a01:111:e400:5173::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.588.14 via Frontend Transport; Tue, 20 Mar 2018 05:58:49 +0000 Authentication-Results: spf=fail (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: 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 BL2FFO11FD025.mail.protection.outlook.com (10.173.161.104) 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; Tue, 20 Mar 2018 05:58:49 +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, 19 Mar 2018 22:58:39 -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 w2K5wdK1005301; Mon, 19 Mar 2018 22:58:39 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w2K5wdor005300; Mon, 19 Mar 2018 22:58:39 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 05/13] qla2xxx: Add FC-NVMe abort processing Date: Mon, 19 Mar 2018 22:58:29 -0700 Message-ID: <20180320055837.5246-6-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180320055837.5246-1-himanshu.madhani@cavium.com> References: <20180320055837.5246-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)(376002)(346002)(396003)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(48376002)(6666003)(85426001)(2950100002)(50466002)(87636003)(86362001)(72206003)(5660300001)(478600001)(305945005)(356003)(80596001)(69596002)(54906003)(105606002)(316002)(16586007)(2906002)(336012)(76176011)(42186006)(8936002)(50226002)(51416003)(1076002)(8676002)(81166006)(110136005)(26005)(47776003)(81156014)(4326008)(186003)(106466001)(59450400001)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB2082; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Fail; PTR:50-232-66-26-static.hfc.comcastbusiness.net; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD025; 1:iSVVTQYRbgdULbieRo3Yz3++uPsyL6fMWwVp76Idit3zypA33EOCvvwh5k8RtS1sRMeuzox5K2EnyShX7B6vcS4ucPbqg4VnFxotIGRN0s04AhmHIRJK0x1YOPWVTPnL X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 92b45b28-4a29-4791-97df-08d58e27a6a8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:BLUPR0701MB2082; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2082; 3:aH9W/Bw6Flp7cu0p4DUyI8tUbQSaa5CMsBN4eVNCW3FPuuMvPQWSUtwl0mnbhi8AZtYK/Zkx3TqGz5e0PargmlkiSWRXfFaTQHDm7pdwMCvUmlD8jcHgs7RQUv1HsvReWKv1nX33z4iCcMrleARbETFPP4JE9rrmm6Mc4RJCUTAg22yX4FKYXGLxvG3y1gktg0z3uq/KwM4mYyj2rt+w2ADUbAcQoemHEpT913ZUSYCU1x0IYvYaV8Yg91gxGt3Y0Ke+uod3AxChUUdIeJg6LddIHYwC9ErRuOKOC84SupH0HBRl2qMrw2B/uAdcz5NezdTEr/xgbbI3V7cVLTJjtNwjehl1bICMYIArErfeX6Q=; 25:rHaZlv0t7GMZU/JauKCkrCakDTi8E1ySaFdqRFjlTxJJBSELa9DZmDVLDWYZu51RyO7rOPLRuyrJpujrKkzafFxmHmmjZrbJZUiEv1PE/E44nvSFxfoxKMoYQ5ZMqdy8RXOhLTJGmwZ8IKvpyUEXOqcDKBlgdop1T6bfTPINkAB4P1J1uvWF+4r3m4/NnF+T5VXgUqgt1CGYEGqVSZUKulpoEwHC+o4AorK406B2FK0Ge1tJ5/GPECKv9z1JEHtMdqPxWrMQBjInu7c+iqgLS9XhneIqIQoDohri4cUJF/6C1k3eSuxIU8Nn1U80tLX5dc23G9lWwKLtjKeAuG6gSw== X-MS-TrafficTypeDiagnostic: BLUPR0701MB2082: X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2082; 31:iUdoQtAAON11Z6TQFyf+aqVjP/Lky4Bd43HBJKFLPlM8e7CgJfnBIMdlcity+Yo5/mdk0COMZtHQ6qQNts3b5eqF1pslMv+ijBj+WN9SOKVt/BuOKpn2cm0AfdQLaNfard24WXrl+wRkQ6UBODxSjDCbdyXK4Top7ikWOOCAuGI7KaHBr3XDm9Hq1GR5aZh2DZCV8R68+8BJDE+yTAVsjzS9mXL/5usItnKXepsYBGk=; 20:3uVFYdURabpB+lWFiYbH81f+dUzIcMCAPiLS5Xf+jkRhlwgACOgWbKAC/6oja5YRrSDdazfvkyY24kubKCaNxZMRXWwPfaMxjOZ28ADcrAixI7GBZ0FV3aLtylrVNQ65xILOkvQcrWkUdaYHVI2eA1Yqmkfzb7inltvMt1fP/foVEdBX4t5To4b3pyxaju5HJDaYT6JPdSzVwL2fzcE+TZb5/YLlGBEzK1B1D/GO963oMUALZ9o2qvvyo+XNRzvXbbrNyZVEYTPQRQP43nwF5IkMtZXJ2/L4wp5D/JSd4MwPD86twoY4X3Kd4tCZSj20csnZi5Ga+BncX9LOUyYQF8lZVtL2WhcBuxcZEWfyjhKwtXSY9WSTiBHQT5l5Pcx6uGXi5eqCda7lN8tJt/HYT0FszoA03Iq9djA99ej+jAy0ceEOVi7jpYS74Nj4yx2yuSfv5DWY89wP5nf+UWTX3NTtnL/A0oZ/dcaf1/HXCt12LNkzDHk9sb9z7D10ovkW 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)(3231221)(944501244)(52105095)(3002001)(93006095)(93001095)(10201501046)(6041310)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011); SRVR:BLUPR0701MB2082; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB2082; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2082; 4:FCd/1gxEKiEE3jPv+8/l5VcIXo5n1zMfMAZ6yX9szufPt1ISyloO4LO8/L35G3h5crVWUAa8OISwQvVZP2UUsaY1gtYAnIpbZ7HnS9BMXs9HyPnWPGj4AY1Bu63iRCMiWxCaBmw7Y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?us-ascii?Q?JbRQMHFy4o9QhU2nodXThWrXFa3XZMLKNbu1rIjXF286idspzcmqr7PeCCGR?= =?us-ascii?Q?awYBfkpz42OKUCZJZnQYHJCMgSg4qLN+LKfV3y6QTvKQx8lZUh5ZhY0okfSa?= =?us-ascii?Q?HQRp46hk0SaZrQBI5OnBSsAvYYc1AaAM8+PVS03Nh1eq2bXPKGnxDcn+cNYb?= =?us-ascii?Q?bP7PSGekCYQKzz+6+NNaN1lgZ8YhtJMAsf77kqkX5sSnntBv0Hs1oBWY0UNe?= =?us-ascii?Q?ZgIusGevQaTijSwYvwuG1V8xzTHB3apYKn2DL2YcD/7VMjdpiHvzAOT8Js4q?= =?us-ascii?Q?UiM9feIWl7HwDt7ODKM27/ZMBJhuH9AWPRhRY4N8yFlR3fjieyM6ZDfF51KB?= =?us-ascii?Q?ZJx7NQOUe6zNvYUw+dRPNmEDhN0nWNljXtL20uNiP+uvjNyvSe5GoRROeGo+?= =?us-ascii?Q?CimvvL2yu8hY=3D?= X-Microsoft-Antispam-Message-Info: g+9+20r4LqJ98FkYRnv9QkCjrgrZVA1Z52nxdVA8/hjJEc7woU/jKk29PsyN20KeiaygNCRZAwJMSGgE3IVKOgUWjeOxWYQYSMkkqauD7giQ5fKzDtHstP7JPPPWhpySWaGB5UFWBIn1FJHuHjB1T2QBcVUmJMCpqlf9oJJ3OAmueKALNHT0EhfcGATsgX1s X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2082; 6:ROc+8o9l0TtAtCnErgzF1rjGcqBzt28/IUflA2mgmI1RPBxolslqKc2jAFSdBWApHhzunuCT0a9gnPE/VeDRbqlVgIwdaRoy3cTWm4Aa65hf2c6npu9JCgyjTpWZJd4ZgkKk6LEwbVEMY8GKIZsxwkQrLwkPFdqwA8Weartyc6TK+vi149fxeVjLUWknlzK7BabSBPb/DMgcXP8wVfdXWSuKX5ogvd1qj3fAepV+nm1bsGkn9EcV6pDmU7IsOjer+Xqq2mcBzAeqo4HYXiafcI12VRoCUwalWhFKVHY7aRLv/0MJwlgjXOCOZ3alC9WBZDCT0s07sT77F7iIM9mHmA==; 5:z3OqPhswxyiGZhBUrMAkSXbUOVsFK18VpEIHvaVil8dsQjcZGI8ssKo8B0u1Kjyhakjo/eawMV4E4YhkutWKOk1qWwgl6QKpFG/cGLlA4LI6JuE341m4fWXPz9oeZUyZfTe9GkUmwxC/VfFdykaV+btYqk8qwcaoTlTnqu9y77w=; 24:voVqtwlL81X6YVjbJmM7hi5RZjh3ul9HhMKs3Ti3X/0gFqjYMu76bPJ/V5DnT5kQtSp27pIcW1qBnS4wR96R+/dnSRdIKubTDUpXZwxeed8=; 7:7jAxWN9XquiAfXUrC/7o+uEgs7MmYCtoXZFTNgQ9iL7e3/bj8HdlsgMzxnCuXxYPOhoXyGIIOU+mCTIWilZFEqwEbvsKk7v5hKl7a90TjRBb5ZXB9vQOk5/S2R4pim26Er45xTq5ZHhS/BsPLUUfKXbAIYz6SJJRvxDRHtE2fdwlY1J9uSxytrIFsX7jxw5C2yswh/LVbNAwQQksy2LSXUBl4ve8cnlgbZcCQ9W7CVZOXu/UlLazy97EWzyd1Bzt SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2018 05:58:49.0140 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 92b45b28-4a29-4791-97df-08d58e27a6a8 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: BLUPR0701MB2082 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 Reviewed-by: Johannes Thumshirn --- 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; };