From patchwork Thu Mar 15 03:34:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10283885 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 5DB8B60291 for ; Thu, 15 Mar 2018 03:35:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EF42287AD for ; Thu, 15 Mar 2018 03:35:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4397328806; Thu, 15 Mar 2018 03:35:36 +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 ADEF1287AD for ; Thu, 15 Mar 2018 03:35:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752004AbeCODfY (ORCPT ); Wed, 14 Mar 2018 23:35:24 -0400 Received: from mail-bl2nam02on0059.outbound.protection.outlook.com ([104.47.38.59]:32000 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751892AbeCODfS (ORCPT ); Wed, 14 Mar 2018 23:35:18 -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=H60mkzAfZpbIPoU304glFyfdnR60dHR/cikR9wc60ec=; b=Q6cUW9NyKgxk+ap1lP2ObL4IsknnwB4ACKBbG7WqJot8Em+lQplg1xax0UiCvQedhaBMX/2RwoAGIIQssZ22kQ+E2fQuUKka5xs4bVRHSF/iHr7OqX3fPKBhatC/7ErCt3eql8MvC8niE23eiUCG6Gy3FM3rnwOXrDVvpY0QPpo= Received: from DM5PR07CA0051.namprd07.prod.outlook.com (2603:10b6:4:ad::16) 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; Thu, 15 Mar 2018 03:35:16 +0000 Received: from BY2FFO11FD011.protection.gbl (2a01:111:f400:7c0c::179) by DM5PR07CA0051.outlook.office365.com (2603:10b6:4:ad::16) 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:16 +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 BY2FFO11FD011.mail.protection.outlook.com (10.1.14.129) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.506.19 via Frontend Transport; Thu, 15 Mar 2018 03:35:15 +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:07 -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 w2F3Z6TP012691; 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 w2F3Z6I1012690; Wed, 14 Mar 2018 20:35:06 -0700 From: Himanshu Madhani To: , , , , CC: , Subject: [PATCH v2 07/13] qla2xxx: Return busy if rport going away Date: Wed, 14 Mar 2018 20:34:58 -0700 Message-ID: <20180315033504.12628-8-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)(346002)(39380400002)(376002)(396003)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(1076002)(69596002)(8936002)(48376002)(2201001)(81166006)(81156014)(72206003)(54906003)(305945005)(110136005)(105606002)(5660300001)(80596001)(186003)(336012)(356003)(106466001)(4326008)(36756003)(76176011)(50466002)(6346003)(16586007)(2950100002)(8676002)(50226002)(86362001)(42186006)(26005)(47776003)(51416003)(478600001)(6666003)(59450400001)(316002)(87636003)(2906002)(575784001)(334744003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR07MB4218; 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; BY2FFO11FD011; 1:Ixl9dDyGHbYXi3f1KC/KmVGt+NMWFa5t2sVRmIr5d8aUo/Pp9BQzIzbLH9xfY3lJ0QtUKu62jdETCz6hyRZ86ANQK0Nm/lLIE1aVS5cUjHMaOGDsw9B6wqYfvkRX4ppi X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4d6b212c-c856-4dc1-0a04-08d58a25c4b9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:DM6PR07MB4218; X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4218; 3:ZwK/iya+Jf/MZXKGbLJID6mIhJY/iLUVIpMXtLnarqlMKTkhHiKSnmmCkS15FgQFMOOqzkIoSsoxD7UYByW/dZ6FHJJ0QyeJ0ry7augateogcBgk3cKK7AeJgpIVhL9AN0zHEPbpzQYZEttR3yDvgtkPoBQyv62rNlrlXQmRVA0KmlEieWj1jNmQ/f289ceKKn25Zk3CAke2Jebj71c/aezpPuGbuKP5JWgQFC+sKgSgq6bWZlAMYTc/rhLIUOB8uS08w3jbZIBpdQ6syynB8BGcNUt/Ung61I8Ofyq3OpIhWsHqETYLrNKR5VOgExabNCclU21LU+MP9pv6xI76V2uaCs9msC0SJT7mEoitZb0=; 25:WnHQfrgE4VdEaBHs6WMWsQx56tkPqfSoiJFl3qjbPbxXwBFjnBVD8XUwfzUv344YLXy6r5+yKOuU9BrBI/xd071smX+mO006g7BkgDREM+XY2QjlqdEezB28aieodKWajljuA19IZLrGUQ1JtOjiS2nZkOETlDrxfpgkX7tdgweZVVJcaZwh7WxjhdI1QE9Cx5RbbSsXQSPzJx3miigM8rYgh0JUF2/yQGjKnhY6OTZ3ujMr19ybepGiVkqG0U1dX9U/53EFUU+BSFMyp9wBVHz0+l+7USj8MF5gDizQs5hpXma7ya7Ut+sCjnqn05nXf+HFRBn9jnYGauTtY9JDcg== X-MS-TrafficTypeDiagnostic: DM6PR07MB4218: X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4218; 31:5hDud7H2xrqiKRbspinz3iJkevGSdTYCDlE3AknOWdQITLaRHfLhZLKmHuV3AWHf6LfhS9nWqT6Z9L5lnybO/uQD4VUHpFlqRTN4OJaJHVeR1qfqyFzmp9GD8mK/zBksVbMr56SlYfSH3+OCad8+qMXT9Qk2FUcyo0QzlMFzMj62pIu0jtC/fA6KyUiEfhyILR7NJE8GF3CHgM1+8vt0ygYf6haRNYW+buhImEWIsEA=; 20:pJYuv1hGNOtTuXrdQXYNbg7T1ep/OTdZ4v75mvFr7rQtP3eFgqk4LBGMHog6akUNjLnRrfnGK7zNylpnv5So74F7ysUOnhkO6WdPZSq1ecwvQMG5V+vRH2LAEf5CEeHI9i97GM4LwwFEmVf4Pis133Hkjwvp2TUwWV+8xHoWuaDwycsd/VcpGVLMNugnGaeXu4ZFabgZFHUpELE/CdETEzgaP3IQ2YBV8EqhR7n88M1PqaKmo0k/AGGQ3mG/cikhJ0nNMRaQcP1jTYJOVHLoDcN0h7qD6TijqpYOCX0cX/cvikVpYXnd4pmbIIQsrboXNqkHQXqSuF9O0xHKCZeC8h9IOQmxpXll0+7y8pU1Fb2S1OJ/0fJaB8qVXx9ddlU9r9fdDzF4xhv65quNQGzTtrE3R+1787uVYOWBZuvKQoeAgFt91UrXk6czqceARKKdsp6iMoJn9XCLvMrBCdTYK7s4RFS4FuLwSUrRvuMuuGa50MWC1sA1usndxAChGxp7 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)(3231221)(944501270)(52105095)(93006095)(93001095)(6041310)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:DM6PR07MB4218; BCL:0; PCL:0; RULEID:; SRVR:DM6PR07MB4218; X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4218; 4:Fgu7/TUwyCi1icmpFoP9fxotIMSgJlAdSP9tygx6aoYgBE8FeaassUzgsDvDu0DRDjTehrlH0wFsvJGtxqwwfYchHdrtp8LJDrANWPJyhbHOPfr1MvcqVSh2gPFr8ROXAwwqvq1q312z6XWNfzXwjrS2gw8YQ1N+lpHoW7C9zRh0NR9OcLq6HeU/1iflqA2yQLZF2gnjxI9lvHdW8jr82NmeWmj9IAkKgl8THk8uDFo9onRcghU05D17dPce5b05jEYkE5sEzuT8jNzIuCLpsQ== X-Forefront-PRVS: 0612E553B4 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM6PR07MB4218; 23:WYlPMdKeUVQba9WzTDtlRV/2SXmfjo/eK4BJksGWS?= =?us-ascii?Q?rVeybOpLyYLzAvM8m4S19YD6AQqngPS3rqtG2M27SAaV5lynavXlDns4OWGf?= =?us-ascii?Q?7cwlDykdGlBOXITD5Wzoik2belPasEptjdhpF4FIyd/AT493l2vDpi+oB2EV?= =?us-ascii?Q?jG7DUtFIj588y2BhlijFbFPuxMa33P7BVcBh69Hwm3YgxrYuDvrM9lPb4OHd?= =?us-ascii?Q?W6sFubc8DDysoq+2ktxGakhY6SEYJcKtCv/jCHqFgRcyoqfJqUO2eXFeJp7x?= =?us-ascii?Q?9hXbzohYVavuQ0DqozdP6rnOlPRjQgNdxxlvxWNcSlW0GLt6C4emTm19cUdg?= =?us-ascii?Q?Xl8J7Ln2fF+SlTUMOo+7Pn2cbVf5+Sqbo7S15XOIFThKMUKNV/NqfIMRabgF?= =?us-ascii?Q?jQPrtfFGdtRr1FKijcdA4Y/RWjv0hjFg2vyyJCaxlPxPLXZrrvbwQVnVAtol?= =?us-ascii?Q?IiwYggOlpjumpS/hfSz2QjRjFpcTr3WRWyYAFSl7Y7k9zB53cAEPujoCfke3?= =?us-ascii?Q?rVqpwiQhB6mO2f6yq2xO8clRow7An7TRY4kK9zatAzQo8b4EsOEuXrZ05Rt9?= =?us-ascii?Q?5wlpN2U7hGTql9XnjGAPtlHMvk8oTJsCo3td3SjS/0qEHbW11KmtOALQKO+z?= =?us-ascii?Q?Gdbpv9G6DRy9mFfK5/GtpDcSRsqFMSAxxpHWkOgHeD7eRSx48Ks1vIMjTckH?= =?us-ascii?Q?Z1eMTriEZy8uiow9rqCB7wNohwH0nSNNuXxvW3HVW2oaE9WKNR+rwMSMKuhG?= =?us-ascii?Q?wpOY2hPzPqql3HZyUqsrLfMrpeJLaHK6rFtyACLs2desmsIu+JLZeRkV8hlV?= =?us-ascii?Q?MUCrJ0vcAdzypAZbzBNPk6g/9Hk4gJEO0W9jBKh1CTD2LSU3ExlcpryVyapq?= =?us-ascii?Q?nq5NT1DLPwV10HgCQ87A2hymI7YQCKVqT03AcyB6X6v6YGQEbMbrUAbT1qVT?= =?us-ascii?Q?nDzpYO9Z+gZ7NzHzK5cOdUB8hB0vSy76qjCeMPGpjFq6rx7FSOZfwUnctgcm?= =?us-ascii?Q?VxC8IHKueulDSpwqO5gf/ptiuxIzUmf4qwLvm5HyfhiXMKPxYxMyeBKAyJD1?= =?us-ascii?Q?j4AqiDxhwo2QVFzVyGnk/ivl3XV3Adr9WQHeKwBN+5QYlQlVH2uI54mr2/fc?= =?us-ascii?Q?QharSFPrkveC+2j51wjRKGdTeuAFst3J57vPGm41Js65byR0DXNiJlnfsCUO?= =?us-ascii?Q?7MdNUUbX25IcJA=3D?= X-Microsoft-Antispam-Message-Info: GhmXCO6AKLQXmUbxbEyyrI5wZn/Zn4swCXcom3sUedjwWrF8C1QW5KhlnSgcFPkBuAoXxROILIg/oGfgxtOfENWzsRG0PVa7bTElEyCo5KLgmvWRCBUYs9uczTG2c/YFkuBBsWjBLJIn/hN1TqxjW1bZvPzYPOUtCkepX0yPXYCLK2U6ro3PkRwZj0EHmaO0 X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4218; 6:LdZhyq3RC4nLaa8F4mtQVYlZySuAn3yH8yjlPvOqH9NLdM1gKi02mz5luVvhx1UuFlAIlgjTVxy7EtZW8Wf/3J90+OZUXHBZC1Ey3AkciEfspVLkAduDFUhlG2ilFUcmLj+fD/fNbAs3LzsDwZS1GQjamlYxtqAVQh1wFh0ZsNvFK9R9tIOtDqAh5RlHSs/JUhYXdMdQR3NOdxqv7+lnjTEkjJArF7pj+m7ceMGJ2EkfrkOdUpekEC0DpkoS1oCtRfbvhecuPgfWAjFwpsPGSqt3z5XW1LCFQc80Fdd0kAR8LtgKAweY5YV/5cnW5AY5LbRjdTzFRsZpfMZloEC4UOO7rL3W6XDmvdhwaP5ED+w=; 5:N8YMJucxitFYHDUpX4Hh5rrkdlxCpWmv7ArHmU9zi7mvZ3axwJWG7IietSldnCqeZxL4iu+icCkuHY9zrj+hcofl3Ea2UHHJkPgOfxpjgOdgMu7TbE57Tbc6fxpwLKbiHxyYtQKmQIdOPscBD5nof93RNTvrYEDfc9e3AYjt604=; 24:hvEIi4xGFYJPnBXWEMM+pfMqboRMOLjQqhPPoJvkijKHGAtDoV/A/WvB4Z7RL4j3P35eGAqxv91Zxtf7+LnmBHvlfS8kzDW8zYf1mq5UXvs=; 7:Oo9Z4pW82fxeUjbZ922KGu+lUKuOip+okHAV7R7BKyA9U+UXYWS2u2RMJY1IimVZS0pry5iZu9ZMeYxPqZrgLExkwBClPG+qO4o+11jqMg8OnojjusTMd6C5YP96iln+XxPx2muai+elSHTf1Ql6amoQL1CPSe/gUqWRUfqXpvKe4ezj+Hbrv//CDSBz311JMUrqynmhHQKHlDtq8AL8ZoCWQTafojv0U3RqA6n/3cuVMr25J24rVpfcycQFH6Xy SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2018 03:35:15.9649 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4d6b212c-c856-4dc1-0a04-08d58a25c4b9 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 This patch adds mechanism to return EBUSY if rport is going away to prevent exhausting FC-NVMe layer's retry counter. Signed-off-by: Darren Trapp Signed-off-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn --- drivers/scsi/qla2xxx/qla_def.h | 1 + drivers/scsi/qla2xxx/qla_isr.c | 4 +++- drivers/scsi/qla2xxx/qla_nvme.c | 31 ++++++++++++++++++++----------- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 745e6414b496..944626cc84d9 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2357,6 +2357,7 @@ typedef struct fc_port { uint8_t nvme_flag; #define NVME_FLAG_REGISTERED 4 #define NVME_FLAG_DELETING 2 +#define NVME_FLAG_RESETTING 1 struct fc_port *conflict; unsigned char logout_completed; diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index d973d0b5d8c3..07c98eb911fd 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -1911,9 +1911,11 @@ qla24xx_nvme_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, void *tsk) ret = QLA_SUCCESS; break; - case CS_ABORTED: case CS_RESET: case CS_PORT_UNAVAILABLE: + fcport->nvme_flag |= NVME_FLAG_RESETTING; + /* fall through */ + case CS_ABORTED: case CS_PORT_LOGGED_OUT: case CS_PORT_BUSY: ql_log(ql_log_warn, fcport->vha, 0x5060, diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index 951fbbab961f..adeda6a4e4fd 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -36,6 +36,7 @@ int qla_nvme_register_remote(struct scsi_qla_host *vha, struct fc_port *fcport) return 0; INIT_WORK(&fcport->nvme_del_work, qla_nvme_unregister_remote_port); + fcport->nvme_flag &= ~NVME_FLAG_RESETTING; memset(&req, 0, sizeof(struct nvme_fc_port_info)); req.port_name = wwn_to_u64(fcport->port_name); @@ -193,9 +194,9 @@ static void qla_nvme_abort_work(struct work_struct *work) rval = ha->isp_ops->abort_command(sp); ql_dbg(ql_dbg_io, fcport->vha, 0x212b, - "%s: %s command for sp=%p on fcport=%p rval=%x\n", __func__, - (rval != QLA_SUCCESS) ? "Failed to abort" : "Aborted", - sp, fcport, rval); + "%s: %s command for sp=%p, handle=%x on fcport=%p rval=%x\n", + __func__, (rval != QLA_SUCCESS) ? "Failed to abort" : "Aborted", + sp, sp->handle, fcport, rval); } static void qla_nvme_ls_abort(struct nvme_fc_local_port *lport, @@ -327,7 +328,7 @@ static int qla2x00_start_nvme_mq(srb_t *sp) } if (index == req->num_outstanding_cmds) { - rval = -1; + rval = -EBUSY; goto queuing_error; } req_cnt = qla24xx_calc_iocbs(vha, tot_dsds); @@ -341,7 +342,7 @@ static int qla2x00_start_nvme_mq(srb_t *sp) req->cnt = req->length - (req->ring_index - cnt); if (req->cnt < (req_cnt + 2)){ - rval = -1; + rval = -EBUSY; goto queuing_error; } } @@ -476,14 +477,15 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport, fc_port_t *fcport; struct srb_iocb *nvme; struct scsi_qla_host *vha; - int rval = QLA_FUNCTION_FAILED; + int rval = -ENODEV; srb_t *sp; struct qla_qpair *qpair = hw_queue_handle; struct nvme_private *priv; struct qla_nvme_rport *qla_rport = rport->private; - if (!fd) { - ql_log(ql_log_warn, NULL, 0x2134, "NO NVMe FCP request\n"); + if (!fd || !qpair) { + ql_log(ql_log_warn, NULL, 0x2134, + "NO NVMe request or Queue Handle\n"); return rval; } @@ -495,13 +497,21 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport, } vha = fcport->vha; - if (!qpair) + + /* + * If we know the dev is going away while the transport is still sending + * IO's return busy back to stall the IO Q. This happens when the + * link goes away and fw hasn't notified us yet, but IO's are being + * returned. If the dev comes back quickly we won't exhaust the IO + * retry count at the core. + */ + if (fcport->nvme_flag & NVME_FLAG_RESETTING) return -EBUSY; /* Alloc SRB structure */ sp = qla2xxx_get_qpair_sp(qpair, fcport, GFP_ATOMIC); if (!sp) - return -EIO; + return -EBUSY; atomic_set(&sp->ref_count, 1); init_waitqueue_head(&sp->nvme_ls_waitq); @@ -519,7 +529,6 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport, "qla2x00_start_nvme_mq failed = %d\n", rval); atomic_dec(&sp->ref_count); wake_up(&sp->nvme_ls_waitq); - return -EIO; } return rval;