From patchwork Thu Mar 15 03:34:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10283875 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 EC0AE602BD for ; Thu, 15 Mar 2018 03:35:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC06D287AD for ; Thu, 15 Mar 2018 03:35:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0FBC28806; Thu, 15 Mar 2018 03:35:24 +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 52F4A287FD for ; Thu, 15 Mar 2018 03:35:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751985AbeCODfX (ORCPT ); Wed, 14 Mar 2018 23:35:23 -0400 Received: from mail-dm3nam03on0062.outbound.protection.outlook.com ([104.47.41.62]:32180 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751873AbeCODfR (ORCPT ); Wed, 14 Mar 2018 23:35:17 -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=Jo+e3rT2pkpYLbKb+CwP9v/St12yJCqmUxlO89aEYAs=; b=hzAJVM6fiViv4oCP//vDt6GiSGXHQV71/OUQS7IQlAaqII9VyxEokmZs9fK3mzzqG1ahbooBVJUEG4Eha4jGsXMRgDqGYUIXdo7UtacooxFsHmGbsP8aEfCCldJuzpe5A0lI7tlfp0k9EPnVK+EkT3gvKnPztTcYTVEU6BaGOlM= Received: from CO2PR07CA0052.namprd07.prod.outlook.com (10.174.192.20) by BY2PR0701MB2088.namprd07.prod.outlook.com (10.163.156.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.567.14; Thu, 15 Mar 2018 03:35:14 +0000 Received: from BY2FFO11OLC012.protection.gbl (2a01:111:f400:7c0c::162) by CO2PR07CA0052.outlook.office365.com (2603:10b6:100::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.588.14 via Frontend Transport; Thu, 15 Mar 2018 03:35:14 +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 BY2FFO11OLC012.mail.protection.outlook.com (10.1.15.23) 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; Thu, 15 Mar 2018 03:35:14 +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; Wed, 14 Mar 2018 20:35:06 -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 w2F3Z63B012683; Wed, 14 Mar 2018 20:35:06 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w2F3Z6vd012682; Wed, 14 Mar 2018 20:35:06 -0700 From: Himanshu Madhani To: , , , , CC: , Subject: [PATCH v2 05/13] qla2xxx: Add FC-NVMe abort processing Date: Wed, 14 Mar 2018 20:34:56 -0700 Message-ID: <20180315033504.12628-6-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180315033504.12628-1-himanshu.madhani@cavium.com> References: <20180315033504.12628-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)(39860400002)(39380400002)(346002)(396003)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(86362001)(186003)(50466002)(80596001)(50226002)(85426001)(2906002)(87636003)(478600001)(42186006)(316002)(336012)(47776003)(51416003)(69596002)(76176011)(8936002)(72206003)(2950100002)(48376002)(2201001)(4326008)(105606002)(5660300001)(36756003)(110136005)(305945005)(54906003)(26005)(59450400001)(81156014)(8676002)(81166006)(106466001)(16586007)(6666003)(1076002)(356003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0701MB2088; 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; BY2FFO11OLC012; 1:w0g3eGvmeNjXI9tym32DLgUGi3YC3r+TqogI6hHQvyRA+5uFFAJnxmouH3OvyEu5mD+cfZP5TZzzfpc14fE5JeDQEmOFKuLdYOlTl7qUzqO1oRC1BXJA+JJHQhCHit7U X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 38cfa0b2-b42d-4a57-5737-08d58a25c3de X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:BY2PR0701MB2088; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0701MB2088; 3:yCgjgx8kFfMY4hZVGBjubnrjogKFBh1J5KvlsGNFyW1SYcJhzZIZpnvDlnLo37Wv+lc8COxNXmTwluA5jz3ioqtL9txqjp6Ur7VFSdDtSgZ5O7dytBwGWpf6I7MVUyiFbrT4ujczNsI6zt83vO9qMxBy/+3fA2rXZIsBU5Z2K6aXL8zeYWnDnQE3PDUCoqAH94p8W9ws6JT9EBSfmJTNiuJz+ot1jYy+hb0DN6gypcXVG9+Ohf2JrYNRoxQJfqBW+NkOs+Kb6O2tT0u0QTSy+64J1TmVWvHCTKjukOnxbZuI/hG1eGEm1xsj3gA++ZmQZM86+Me1vNBMg2fna6Vbzq+3vjpjGP+q3ton3j9xDsU=; 25:LZHMG97tZb4kHehzC5yVyg003p1SH750AZnc03A6iL5b1NduV+ipwURor14IxtZVB8iqaeFhZbbprb7b49P44VTJ/k00xQgM1rweuurzeoiOWUPctDbZf0Vofc41wFESueiSRvj5DVTIGMbL7jcCSkuqBLLTMFyYMOPvXmTUElgYamgzmCDrf/FFo/NnMB6ISIrpZKtZqw5OxXv5vWoBWF1m0LymBDEzES6cl0HtXb0JLGmKamOQYDaPEI9P5f4ZMHEpKEttOasGvcuN3BRp7YvUcHfPB92KPVKPfjxoAhKKFfW7GvcfDjhQCpZHbH/7oOZB2i6kyDs8GSXwPcy2LA== X-MS-TrafficTypeDiagnostic: BY2PR0701MB2088: X-Microsoft-Exchange-Diagnostics: 1; BY2PR0701MB2088; 31:Nr0n2aJbl5DBjPOqNMv1Uf6XykIAUjO6TDxdrfD/vshOxiCqbPE7OTlT0qc7S8NiyTRUfn+GV9XUk4MQf72422PQTaV9mS2EDuRLVBKGwsiAG9r+Uey9myHp3wuFaYo4I8hrqBgj6Tt+KbFZO8vAimk6txngp9i3S2qZeSPaHmW8KsHPhEZoxw1tdK8Z1ekNqykEZRA6O+bzKdOC5xPPxfhQkVKE09mTb6l/9rCr9Ns=; 20:kAEBByALfdS+wqHys62UpZ5zJ0xDHY3MO4x9+BZEDA7J0Ykb5xRrOnrf2DKwSpep7/gDlDxdmAz3SyjfqxAPE3mWv6i82FN6Tx3XOUY/c0k0IFFMhgcL9dDpwULx9nOK/vtxqlPcIG/Up2OQYZX22x6mwQsSRPl4ed6ihW2L6pScF2J/cMPmnj/r2oqfudly8D+uVDQW/btj611xHbTjRnPyuIh64Rm6UgHc2gFGwRgd4mBhPU2zFkW/oySpXHkU76ef/6I5YNBQnLMDNv+T0nl4VovM6Q37DThqw3kTnDsawhkunjg/aYXoo4OSWENR3HWudaVV4BGW/QPP2AnKkqvR6LYb2+23rKx8ePbGzyP8htNzXO7YuDM7q4Buw4254MvM+YQakMr4WJpxmexILDae4xeHRHHo/f9HcNUV4jyjTXckfs8thej1JI+Utcl/OE35n99OVw1y/amMcq4fe1ai8H729U1Ag3SRpmMIh5/Gjm0quCrHFD0eS5+VnzsD X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3231221)(944501244)(52105095)(3002001)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:BY2PR0701MB2088; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0701MB2088; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0701MB2088; 4:ShWYWvjQ+AdoPNtMGL60d0TeeGIV6AHN1DcBiajL+JVXRd6y5BpzqPIYMk8cBQD6eXq0LnQ9UchBn5fSROUDtm9ioH1h5sROWntidavezpojppc6o9Qzc4AMha+l1Ij8icRQQuulI4Jm9iBlphoiRl9xZ5kpbZWm1an8F3+a7pFZ4FaVqKJZw+pHvLVmZ8elvWKhLPY3QQRNdjX6VyJzesaJoA6O4xkZfb8/2sU59tVwMTHtdy8C0O30vT4h6FcpY3LH51BiUsOS8vMSMq+nrw== X-Forefront-PRVS: 0612E553B4 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0701MB2088; 23:X9SJam9yhC3YgGhrNm6OZuVzukcqLfy54i8/7K3?= =?us-ascii?Q?OxU7BFyCeUOIzOPOeUYLPLLVrkFsumvxG1nOempf4cxpGGJ1a/WWu/9aGFZF?= =?us-ascii?Q?wRxGj5B5Y/Y3TH1UMF+IHOUMQ6T7FbdV4r404WNqMquLcAeY9D6dHiB6VrS/?= =?us-ascii?Q?287S0V0RSdqmacsmkPyuOKzY+DVGFi/GUwYkBxy3cjI6RLjwKcIuio9IYDMH?= =?us-ascii?Q?ne8vpPc+tRlc1mEHbUH+vaNZjqUKc4BzNqUQc8xr34rcDq6h802jB1bAkngo?= =?us-ascii?Q?Jiv8IBpeOpeQjNAgwNPSyH6Z520ZlRZ4SRgtd1b5YJdXSFTs/LXZf9IR0WIO?= =?us-ascii?Q?IzONplmxwTsUvw7yK1uhbjH46ePhdruYDVGt+3VngnOzaiw8ACPiFSodQnLn?= =?us-ascii?Q?7HltkcftweSQbFhROWi+Oro1UaEqStIawd1yD81Ie/V6qfYbvZq/c7eT+i+h?= =?us-ascii?Q?hTqpGVlW1aP8JYlQLA+5RPvMPc/rzDwgB1b+/CfLeFEv6nRbV7JsEQv9UK3S?= =?us-ascii?Q?SM9UMndcQVlszqRjtAh7dyoX0JBY+19XHPGgJSWsmN1eADMM8rmfMNLw4Fs6?= =?us-ascii?Q?HwEFICn46V/RHqrAuMNh4E0Qc+8wtEfeTdqxkVafuwdsTRYN6dI6IJT8NBX8?= =?us-ascii?Q?uBo4Zyurl0UrCM155g5fJ4RcmK06OilIY8o1oHMP+ZXlhhsgwclEBFXlxMXC?= =?us-ascii?Q?HxINszesLuY1ucl/LQlWVJZBRbVrX6W77nCXMbZrf8T6OAPgEaWODSznGTwa?= =?us-ascii?Q?9qFrktkkKbm00/WLyBTdvxmb2off4JhyPCednR756vNUKcyw2Jrmsp8o2l4G?= =?us-ascii?Q?l6NIod91NQUWhqneRJxsR9SbuR8baUv9HN3yQSEki8c4VS6SyGevQmtZJvDy?= =?us-ascii?Q?iWkb7a6QCUo/25+A6Hb2DMGDoHyHs9vPij8/i7SRhCV6SUw1Lvdomx299yM0?= =?us-ascii?Q?ivmpOjSGHNIXh0om7NELU6hBngCdh3UpWVQ44B7ZcMrsKxmjPgjX4pGlJYGp?= =?us-ascii?Q?XV4xf4mb6oCNrm9bWxTcUWPMgqd1xCarhsPmq01WgiRgABOuFuFbT0IJHc9X?= =?us-ascii?Q?wbMH+3QcXLRxxxlegXm9EpsIYjJ/MJy9UE5V7qexAG7O+fb0XZaocNGY6Rk8?= =?us-ascii?Q?K9O+j0mAycXNknXxKJiMF49pAUfEdfVzB?= X-Microsoft-Antispam-Message-Info: t8eHBaja5MgX/lns2DzGQgS6zEYDJ54ugdMIHG1s+NMsTgxSseWll0p2sS3HWKjyXgyVWZpSOKpWdUcu45putzoYso+va8SFOfxA/1dCrCSIS9I8cHK2aanHVuQiGTHETQqZk+s99pUlJYs25FVUcGgZYzmJn2VAq0jkzwFFJkUnKmaRBk6TIAyg/NnYRoIw X-Microsoft-Exchange-Diagnostics: 1; BY2PR0701MB2088; 6:tBA/ST+sZpQkRIS7vrcqeYwmEjIzuv6sCWhLHWKe8bBld3623PICEz8it9EZN8KVHKUBCtX6CveT2OGoTNtlPnz9D73Vw9qRO9jK3ukeFhuQqw4W23SSK2xJJqUMwc2wU5lVALCkYgMOxoCKmPOABxx+EswOqAxjd3jx6xiCmAeBV/O3l45xrvSwVikxS+h1YhLkqVFspARtGjlycDB8lV96m2SQdcf5NDhAxJO47tKMF3z0eDPGlhHFD3DwXY39FpppTs4zM9XWIOloHbssIMwzAdu/aV+H1JWJ9E1CON5Zg3JD+RbRtk1Z2PdxTf+gz9VwXM4Q9zLGdfYbs2VzVl1mOx8YO8ReNubLx0zjI0U=; 5:1rfrSYUKs3x6zCkYiHLRwOFbYT65fwCg4DMp+mYfcjq+mKx1UVBcrbMLNm9xjkdtsstXkMHWy0xCcJj/efat6pzJWB/hnveZM4WhxiN12agBgzQXXzTx4cECUU+HMLjSw0F5HMHt4+r7QnAWABnwu/Ln7FJuiOH1Rzf/m6xjLPI=; 24:AqLL1D4tHvMPYzq4F1tNpudRj5NJdeSK0xP0k7JvBkHnEYAmtq1PVG0tjjBM9WOk0QZDpoqdxElQ5Gya2AD2ExITD3xnMsIN7rXTmjG6nyE=; 7:m8YSdwI3r5ZVrWBhLTVYRhrXFWnCNBZ+NsyDONT1CV6eT1HGpUeXuujk0Nemr/yCo4J23i40jepzV655VOEYvhIhNiCl4KQeLLmCLoyNajc7CPqyQZOiOt63Kh3CC8p9XnErHWPciV4d7a68B/znvZODIDyowoGfppyP2CBisYmvgjtf/j1xi7RbxaV3m8gtuNGxkSWaTVd8jwcxTVk9x0I2/yZUQmYpcYcj3HL1coKA6DIpvKbijxjX9O5QmUdj SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2018 03:35:14.5316 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 38cfa0b2-b42d-4a57-5737-08d58a25c3de 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: BY2PR0701MB2088 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; };