From patchwork Mon Mar 12 18:16:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10276945 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 8207B60211 for ; Mon, 12 Mar 2018 18:17:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A29628E0A for ; Mon, 12 Mar 2018 18:17:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5DB3228E72; Mon, 12 Mar 2018 18:17:15 +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 F418828E0A for ; Mon, 12 Mar 2018 18:17:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932780AbeCLSRN (ORCPT ); Mon, 12 Mar 2018 14:17:13 -0400 Received: from mail-bn3nam01on0078.outbound.protection.outlook.com ([104.47.33.78]:31104 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932745AbeCLSRH (ORCPT ); Mon, 12 Mar 2018 14:17:07 -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=XzxmMYKp5teLge0NdEFqnqZt5sWnCl+cLE14CfF2abY=; b=XfzmddLuhfPMbHjiGHAsZeQPo3nkbxr3HSfuSbZPQN4v4iMZDKAdgGjaQTyHuP8vW1BiWm/BXfMmLK229242UXT0STlcXxcgjHv1qFfxbMzHg5mMs1dkMipliIkxZPbQeicsCCWHBxbp0ryaT+tnKj7/0y1iMPsOHW2/3IEYOUI= Received: from DM5PR07CA0043.namprd07.prod.outlook.com (2603:10b6:3:16::29) by BN7PR07MB4209.namprd07.prod.outlook.com (2603:10b6:406:b2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.567.14; Mon, 12 Mar 2018 18:17:05 +0000 Received: from BL2FFO11OLC007.protection.gbl (2a01:111:f400:7c09::167) by DM5PR07CA0043.outlook.office365.com (2603:10b6:3:16::29) 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:05 +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 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:05 +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 w2CIGqcP020767; 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 w2CIGqrv020766; Mon, 12 Mar 2018 11:16:52 -0700 From: Himanshu Madhani To: , , , , CC: , Subject: [PATCH 07/13] qla2xxx: Return busy if rport going away Date: Mon, 12 Mar 2018 11:16:44 -0700 Message-ID: <20180312181650.20704-8-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)(376002)(396003)(39860400002)(346002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(105606002)(51416003)(48376002)(356003)(36756003)(106466001)(316002)(80596001)(42186006)(50466002)(16586007)(69596002)(110136005)(76176011)(54906003)(47776003)(4326008)(87636003)(2906002)(478600001)(8676002)(81156014)(8936002)(336012)(6666003)(59450400001)(2950100002)(2201001)(26005)(186003)(72206003)(305945005)(81166006)(575784001)(86362001)(5660300001)(6346003)(50226002)(1076002)(334744003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR07MB4209; 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:fvyPYC3OfpMe2OmNbCE2MvZOZaVv65tyZlLGPXkIEZ9YrfPXkmWkOtFx6DvTw9+Qh4ZHFlwgmVHm+IS1EUYn5ntPTm9+bkGUPv+R880g3PoJMLR3vSYek33c+U7/HZyx X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8830ef7f-d8cb-4904-3248-08d5884575f8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:BN7PR07MB4209; X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4209; 3:dXfF6sVN7WTgoxYTFKwTnmLMcp9/pPtOT2rZGEDJd3xC5RMpU7D2v6z/hK0M8zov/0QHzykNvlHT0t/BqGyOa4nsM+GM+dshPtGGlrM7/68Ax4EPJoWEWCFRHz/P70tC2XWfaUWmaxxBFlx2rmlRrsyjRCKe/s8ZWWwdZgrhyAM4m9w883U72fYONJm0fuUQRtGKyaniOSWn15JDfI9h1LDonIDmtsmQgNbTDMM21+YbK7211gM7xNwRtccrxcUVTRuYDItsGHDOV+VNNVnM1b+t3Nb8nwy95khRNPznA0/FzAlCTTJqbb2ZHbAbV48JWewVxre8m/55xh1Q70THoKAiVtbBOSg++LfztT0O1bY=; 25:/cTsCgjhz5qR/FYd9C0dZd4EOov7dldjjypehuwzKYqymxPRt1FZRZJXXc3eqobTvOLFZqZs93CyYw6bXjTdhKmikBuLVGzdgZ9xz24jbL+oik2NFGje9vdv1QIBQw6wUEf4iO5ZNtiKQUmVMVCGZYI699pK568Gaf3hhQaUd5Kj/RjhB8D/HunbC3zH+fzgcq5uYz2x/PxYo/AgtevLvzckWyg/a92NBRXSl9S4UdklLU1zrSslayh5cHVZRJ/KMZi0LuRlheR/MJ2/XY4yn9kpZnUYy1wjOaQZRDJ/SxgBwchmKC2qsXvSyzEZ7yP67zUpuDR138fFhIMBiwuddg== X-MS-TrafficTypeDiagnostic: BN7PR07MB4209: X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4209; 31:hsvbfuTg0vYvTV+KTvt4zJna3o6n2LCELxsAyzdAiXIEEohS+4ByKqZV18eKtrrA/Pa2kT/HxSH+eX0RmntWDKJzEwEpASBKvXthzLlExyFggEXndggzjbak0LRrQiC6iLOs4Wx4xunt9WRtIQPpkoJfQ4hAEqTK8rrYNi3pZGHZuvld6/HWmJVWjYYakobCpCKjprbjZGGp5ltFYx6lQ7U1Onp+bB192GeUiPOEZtc=; 20:LKA9ZwVnv7wVKnfleb0Uc3Kc3MMqvuwBSRQvIWuVz7I7DJskD0X9ipKlXhzB521HvFvn0CrOlA/Il6AJXFa4JkaTIFeBuvj7wHKotHVjhnlZjHvQUt9MB2SlSnF1+IxlQJ9N0rfo/kfccvWPG0QqFFsBpHGGUnblBBgKB3u+1R8UL8YMriZQIDgGFFl0Cl8k4szenPNVwprW6tc2Ncx6EMfp7b1EK/OCb30M1Kt9BfuDW1o9RDhwO2WTygPbl+/byab7+pWl9rNnYpkLtBdut58fohJiARD2BovCDKe2hBEs03fpeqBDOIAWmW5r6W5G/1PEQnuBRrbjuFXmB5x5S7d22RRMRZNdALsqOAD8Ui3gb7XVl/mTln2mE9HIpqLPxEPZf2/SOpWL6XzB/9pBBSG/17oVc3UH7CYzLfM13nlK6zUKmn6StzGl9xetH6ZlKuU1uh/Zk1qbPYBqcUJHFiqhlKwLJWyyHbpNOnmYVKf0dBIwE786Z0Pk6kzgqY4R 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)(20161123562045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:BN7PR07MB4209; BCL:0; PCL:0; RULEID:; SRVR:BN7PR07MB4209; X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4209; 4:IGchb8h6X6WCoYmbZidZ1zpxHwiNwWy1p6NaXGA+R2izhNwhA4kPYrume0dwxi7J6cas6R6+JlG7Vq0W+P3KP5OTMa//08uUmrmdiXvSZLP0+wfhEJhy3qC9cR9U5MMQO6d8SBtUwptI35pnu4nQV8QnGxM74MuJzG4qgiHr78Pbd6P7NIgXpHJwejX08sbAglupk812tdY2t5SFAEftjx+0eUTZvowi6jxTJs/pysjeazZJz1sByeQVrMJNdsez6dtja1U+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hQl0qNcU9Yt4k7ZvQuYttACZVHeGPRKbQJwFJ/Qos=; 5:sgany0hdwZf+txTIZPaWiFTJMhojnxtVa3BWfDqDleUIdpsx9j7vnZ+gbEkxhCUssjxybht1QUsHM7UyOj9r9dF7xjkax6jx5g+9p6WjUqaEGQqrIS6+jh1jaER1GLI1AIGwRUhpgKzxahW5vJ/0AzpqtXxTw9AIPjF+J9SAZLw=; 24:CK2l5i8iazj816xvWvC9UVZM7t30y5J9TtWu8duKM2W532Aeh3MEDK1em7VNX+Xhe0lctoloCHYuAv9q00sA76YAmpUiIhHKzaXLwC2kxPk=; 7:f2w9xctqnGxuMfnnFNBYs1LxlYPE+qaXYTfVuYu4PfGnhGrUCi/D560Lu+el9n2Y2urUUZO/u7PDGk3fliYo+SkpkRep/njNTycaygvf/45yy0Yv6kqfaOGhNbWfY16Vf5WRCIlCj27KVwyPjDFdHa4oNR4iXFxRWI+H64zDxyaBBDG/LwvkxaccLVeeXIROnDAg5KZXuriER1K2mcjLpA6Uo2lEQrhEfawAZfNAopsyMLZucvTexd70w4Ny8yE2 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2018 18:17:05.2526 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8830ef7f-d8cb-4904-3248-08d5884575f8 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: BN7PR07MB4209 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 retur 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 --- 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;