From patchwork Wed Mar 21 06:09:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10298621 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 0E889600F6 for ; Wed, 21 Mar 2018 06:10:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0DA029716 for ; Wed, 21 Mar 2018 06:10:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2C4129722; Wed, 21 Mar 2018 06:10:05 +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 9EFE529716 for ; Wed, 21 Mar 2018 06:10:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751633AbeCUGKB (ORCPT ); Wed, 21 Mar 2018 02:10:01 -0400 Received: from mail-bl2nam02on0043.outbound.protection.outlook.com ([104.47.38.43]:45888 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751589AbeCUGJz (ORCPT ); Wed, 21 Mar 2018 02:09: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=sNKh/SWEpsSWO4g6/Y2RQKqslq1GDv6vLToNQaAbCl0=; b=mVkOtuHgwhWrUtV7iyfueA+dTA6YwtXDDcm3KrQDVVLjwjJi+GrpgsETYupP0K+ScI4leaUX+iHb1VQEf8re8qZeb0f5wsfmTnHh/Mwe5MayFDWELsUh2EwzVrYFbCEsTVzmabhDmZtapst7FyNAh1dVP9i+XHX0o+/XqQ50gg0= Received: from SN1PR0701CA0017.namprd07.prod.outlook.com (2a01:111:e400:5173::27) by DM6PR07MB4218.namprd07.prod.outlook.com (2603:10b6:5:bd::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.588.14; Wed, 21 Mar 2018 06:09:54 +0000 Received: from BL2FFO11FD022.protection.gbl (2a01:111:f400:7c09::186) by SN1PR0701CA0017.outlook.office365.com (2a01:111:e400:5173::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.609.10 via Frontend Transport; Wed, 21 Mar 2018 06:09:53 +0000 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 BL2FFO11FD022.mail.protection.outlook.com (10.173.161.101) 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; Wed, 21 Mar 2018 06:09:53 +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, 20 Mar 2018 23:09:43 -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 w2L69gB6029523; Tue, 20 Mar 2018 23:09:42 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w2L69gBX029522; Tue, 20 Mar 2018 23:09:42 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v4 05/13] qla2xxx: Add FC-NVMe abort processing Date: Tue, 20 Mar 2018 23:09:33 -0700 Message-ID: <20180321060941.29468-6-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180321060941.29468-1-himanshu.madhani@cavium.com> References: <20180321060941.29468-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)(346002)(39380400002)(39850400004)(376002)(396003)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(76176011)(6666003)(16586007)(110136005)(2950100002)(51416003)(186003)(42186006)(106466001)(6346003)(47776003)(316002)(336012)(8936002)(81156014)(356003)(72206003)(305945005)(81166006)(80596001)(105606002)(26005)(50226002)(54906003)(59450400001)(48376002)(2906002)(86362001)(69596002)(5660300001)(4326008)(50466002)(478600001)(8676002)(87636003)(36756003)(1076002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR07MB4218; 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; BL2FFO11FD022; 1:NsPv2ExKfQQj/ouBTpZSWyak9xM6KYQoVeuvNt2yH0hHrAVsRq5/iUSSnN+xD/6RKNFBDLt8b1cMA8hDPUBFbQ9pwGSDr4LgiiTs/Ko+s4TOnNzOm+pseszoD9/upo15 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f3147dd3-5b88-4f78-58d3-08d58ef25cfc X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:DM6PR07MB4218;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gGis9U7qJL94EbQWdb+DyTiGfb5vIyR0KAHzqFlFR3j3oHW3SXJ7jfA+L2OHasQP2sp3UhnHvVG9m66GTLALn8BciCXQChmpM7V6uzzYW33k+DjFg5DoGu0EbeevabeFn8xtSIo1WGOMkZkPsWQMEe85kjh40QLB2Tjm9k6mQA58A0sH4Rx3K7m4+Qcn5Wnsj2R1WfiLgobkQM+Zfq+Fxqz8gnR63Y30H8JbRy+Z2gMDWYJJjSTlx2JcOM1byszCmiU/uteHixtt6KJH/bKxBssxEJTtT3h825kfSIaZDkFW67UJTYqAVxm6NictX/Cwml+jXsptZ2M0oMVQKp4REaWGGtJ/B2QSeAUlAT5YSUJGimNAAc5kv1KE6K2ltQMVOJ96aWSPt3PAzv42dCx82y5IMo5fDBl1fa8CGTCXX/ODb3MzVlCRmW8KMHrClcR5WIpjnFqHkPe8AmrO0Iyy7FlddlP3Y4xE2i9gMAVqcTXM3heKt9K8sQ 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)(3002001)(93006095)(93001095)(3231221)(944501319)(52105095)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:DM6PR07MB4218; BCL:0; PCL:0; RULEID:; SRVR:DM6PR07MB4218; X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4218; 4:/FENX5BbUXOsNUKt8AhxiihB0O7lKExpSwv0HSVDeeRn19HtS3DcK8OcXTs1nqGPCdfZLhylFjBs4TZnmwWMDIOOvDnC7qCMIMrKRhpu1W4LLkFjIqUjzrwa+1BckV/ZqiA+Sv/cPNCeeKRYTStmoAc/3zevXMifK+y7To87n2J70dfxrSbkxyeFiUTgYO04uuIk77fC8qlYZackfq3Cle8aPH+NTKfJywbJa/tPCnjIzrHm/8K/9zTqcVzw/6mEV2GfiprTSE1AxHFpZyZ2VA== X-Forefront-PRVS: 0618E4E7E1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM6PR07MB4218; 23:Tjcun+s0myjSJrWEDdhYk6SDMEsDg0TCYnlZGZoAr?= =?us-ascii?Q?hxRgoeigEWvWNUBUbwIBvLfpzB5WX4Re8dBTwoAgosChzMxlvReOO4yRND3v?= =?us-ascii?Q?M47553GXUwF0EiKW43JZssGzsd3BrgqPJU/c4Zsf8j4ddjRq+siz+HYdEL2b?= =?us-ascii?Q?UGqMZUN13GjIkCrd4Crf14rL+ccP2gl+381AHNLVwtua+iFUGrN48BlDkEcy?= =?us-ascii?Q?4kzMr909IfMxOa5FoeRSyz9BvRnHA4CHbtrFnD3NdaGLWQAQvPoP162l6pr0?= =?us-ascii?Q?QqAM6StW9x3ruLq9bq0ATXnEGkaz39hZp6w0Aj8G1ODEiN01LqC2fA4PkrLD?= =?us-ascii?Q?Kc9tedM/zX0RpG8HaVjLup66bd8ae9tOxSR0BHtFf1BtmadWYKEQFkkLNQdo?= =?us-ascii?Q?HFcFe3qVGoW3D2CUJz59QhAd1r2AVA+0UVHAY8jEnmedloko/y/Q83ThSwY2?= =?us-ascii?Q?HSSNZbPyYVU58DlfXX7f1CI3O2YglTsoVOIhGVQ/8ZpFd6HfbFNUP6D37k+f?= =?us-ascii?Q?LesNItoeeD05jSX9XQmh6hK8kEsNDjeWz+Lhq5voJDFpv4faFaKE0VM89Luh?= =?us-ascii?Q?yt51ssJhYAoedor62klubVXqaJKH9Qs5aPHk6tZYUSg+s6tsPqtvnubC6HTL?= =?us-ascii?Q?6ygkdhQ7AcMNTIDWFhTVkOXiNLoaVpUBMMpPPkBQhl2ZfXBhufyVqaTKdGci?= =?us-ascii?Q?D+G+0u4w9pwhjTQOaJV4kvhxXCKQyOLa/MM/vXTi3O2nCCq3AcvptdBsfx19?= =?us-ascii?Q?112V5DTMS4UhIPIgNr+JMrPR36g6wDtaq7FKGIw8B/+5Y9X/6aSgAM2bO+9q?= =?us-ascii?Q?w6PScCnvdoO4zIBuGsvCXAxtDUKDXzm+Ym6Y9EslAdfy8bJ+Ilp8pzY6NYqB?= =?us-ascii?Q?0cJbcLO9iV+S+KzFhyVmhR7xzCHHTgXmCBdX2cRsShglJ43g338kZodyo7gt?= =?us-ascii?Q?9UNh01xymwNDHNvDYcjXsHKhteLY2slh4v9OCob1CxBt29m32lNftudGtpTg?= =?us-ascii?Q?5btAFIjGkd39J+sIVAXNydrcsTymPmP/WkucD8348+VYMCgAO86B6CH39CHC?= =?us-ascii?Q?Y8Vr0QzzoCfFO96Hsp1db87KWOEGP1/l0HTbJ6/kuShBWaPyFvpAbCr97duz?= =?us-ascii?Q?N9v2vQa4w8=3D?= X-Microsoft-Antispam-Message-Info: AmAuxoBPeqlBDnGgjywDf1wYSWbsMu/YnJ1317kNFL02PXeyHm64dRckPt17S33Ae2Zp0T6uysJtPAe70NsS4OtHk3OZHKJtqaEWg7WhAAcx891LHBcB9yUfLpY5zvbnZ2Jo+KWKy46alB3uPQ23+FuiXsKr5r3j9fE1LTgu/bWT07kUOuTxXHPJIdYG/kYk X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4218; 6:MFS8tS5Tp185tq/1eKyGvylLX68QIrQ/A2QE0Z47SkX/zgk0JP/qtbCHwcG8l8qjI6wZL4rZ4IFlTqmeszIqZF+Kw8kis5q4o/JwpNxACefjdfnpXOpX64xOtYEmNYi5rP62SN0z4KIem/q9qMRghwo60kGO36dDYtrZx9TWrPvr4v/N4cTjWt2PyRZIAC2crLsJRmLsW3JeRwimba6wMD3mrZ24fH7/J4texQgrNdOvp2XYcex6HHFFfZEnIVrE6hIf72OusO3Xnrubv4tx1xquhb3K9rSFHIXrZkwk3aXCUUOt/jlz6xshCvfg3g7R4VIl1/0SRBQ9sPWA+m1kYw==; 5:HLa1IzkJhDnfsCOrdCwXafdqLZpbCTsjQJpUk7sYRvxEvcTcdfFqyuTEwqnvRFvC/dUsSeViTFr1uOd13qGERNNIiKylJbJQUI2TwgBZ3g5NHqRKNj8A58IQpvxTeA4iSIx/+Aldrl66HfEM/eVq/zfYLL1Kj9gJrK6TUsc1QxA=; 24:s7tEBEtZILWt4aE9k6woEXufroJbQRSAj9rKs6jnpZf4xmAQIJ/n/NqtDDHB+vX3XcfpJrbJLLpoSXJb7JPGFAfOXkeWwtEWlHNCr0+uvys=; 7:/elkm/yPcMVqvbvhhUK7ckGpOqRLORU5KFawQ6DNq4vJwcnb7KIBbmwd+UUsVrcCKqIf94rdVo1c0GgS6wsK1HM+IEEQc2qSYDv9Hq0BMaLkns0gkRKzgFYyQUkXV8nAyH3Ok5Alx4adHQTe0MjxuHsxVsG8KOIkiuvCYs2IzYAHym563L3arxNKV0ZK3Rqt7wVS5A0UvSYh3up9ZelENzyz+LdXthzATV4LavBUVoRCLTGnK2tWlHs/2v8n5GBL SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2018 06:09:53.2632 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f3147dd3-5b88-4f78-58d3-08d58ef25cfc 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: DM6PR07MB4218 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; };