From patchwork Tue Sep 11 17:18:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10595991 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 65427920 for ; Tue, 11 Sep 2018 17:18:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46CE629B19 for ; Tue, 11 Sep 2018 17:18:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A85329B20; Tue, 11 Sep 2018 17:18: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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 6E95729B19 for ; Tue, 11 Sep 2018 17:18:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727682AbeIKWSv (ORCPT ); Tue, 11 Sep 2018 18:18:51 -0400 Received: from mail-sn1nam01on0072.outbound.protection.outlook.com ([104.47.32.72]:29216 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726782AbeIKWSv (ORCPT ); Tue, 11 Sep 2018 18:18: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:X-MS-Exchange-SenderADCheck; bh=ArDkzk+rs4VRnJ0hu14kaVRQJA+fqZdh/VFdBqH/Jjs=; b=jNOsO9BiSu4tZ212X9QyE9mdVQJ3TE1SQf9rku4jE/wP10bM7U+LiK68Lfz5W8A5jhc3azzcHYkXDDFemTypavH3Ny2MrI83d37ODMh2duBfO46n5pjAGoUQHX6ZA7Iq7lAcCQn4oEeO7qkOWf06fLYFgN9IYLQF5iv0o1L6C34= Received: from SN4PR0701CA0016.namprd07.prod.outlook.com (2603:10b6:803:28::26) by SN6PR07MB4397.namprd07.prod.outlook.com (2603:10b6:805:58::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.18; Tue, 11 Sep 2018 17:18:29 +0000 Received: from CO1NAM05FT054.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::203) by SN4PR0701CA0016.outlook.office365.com (2603:10b6:803:28::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1122.17 via Frontend Transport; Tue, 11 Sep 2018 17:18:29 +0000 Authentication-Results: spf=pass (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=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 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 CO1NAM05FT054.mail.protection.outlook.com (10.152.96.170) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1164.5 via Frontend Transport; Tue, 11 Sep 2018 17:18:29 +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, 11 Sep 2018 10:18:28 -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 w8BHIRPh029055; Tue, 11 Sep 2018 10:18:27 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w8BHIRJU029054; Tue, 11 Sep 2018 10:18:27 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 01/16] qla2xxx: Allow FC-NVMe underrun to be handled by transport Date: Tue, 11 Sep 2018 10:18:12 -0700 Message-ID: <20180911171827.29016-2-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180911171827.29016-1-himanshu.madhani@cavium.com> References: <20180911171827.29016-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)(39860400002)(136003)(376002)(396003)(346002)(2980300002)(438002)(199004)(189003)(186003)(106002)(316002)(42186006)(126002)(80596001)(36756003)(44832011)(106466001)(476003)(87636003)(305945005)(51416003)(76176011)(4326008)(16586007)(356003)(26005)(54906003)(110136005)(478600001)(81156014)(81166006)(2906002)(8936002)(11346002)(50466002)(47776003)(6666003)(48376002)(14444005)(50226002)(69596002)(2616005)(1076002)(446003)(72206003)(8676002)(5660300001)(336012)(86362001)(486006);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR07MB4397;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT054;1:mtfX+mfoAGPU+i6c1FEzGb0OLWyPemwZxLZSxQ1iSx2a1yWn/alo576u7hTZK28YJw6K7azzgzTZJdMgVxB8ARjmBM7Bmqmvz/PLkxvjowcAlSjNO5jWQ5l7n8W5JXNX X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 075d354a-f4be-43a5-77f8-08d6180a97d1 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:SN6PR07MB4397; X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4397;3:WniK48Cg+uAI314ziA147t1aPmPdfSHQ89jbcfL4pFttKN7WZamvAwRY0QEK0vzb1V/a9LyoXKiewDBMQVmAefkRyrUyj3n5z3L0FCZAKNaqRdb2+dK1BopIgjDc8Ou2F6MTcy+0FLDTcgMajvmc2vzfDe5JFMgEo5N/hjaynK2aUmcTQkLv1lrm3IPVidjFtepjKO0VeuCAvxsssOtNSCWH821UI+f8UsKdJFoOEHv1t6M569pDB692PBhlMgf9VWYAJkSDgiTl7H2JhxXA/L3DkO5Erk13b1eUxrIjQsW1mhXvUeqZUl6hRvc+kXya1AYHuXI6nc33hJ+NswfkJcRxlbaaSCoOSS/EwH1TecY=;25:fULK0bac1cKoeFRFRb8UapUaoxgHU66Ouq8sHHI/KBW4c0WaLx/8LKf6D2ENHV2lTuKT+hloE1rw41huJtlh2yyp/tuE3WICjZNUEjsMBqc44/9AeLfkt3MyrwYnZnPTEEKNtnFgOiDB5G/pLU24kWJfJ1cLRhpGPd40Nu3cA5RogvtafUClSLHkyBtMXkZaz4D/HEkYkEUFic15uRY+pk3YNnzIlBsy5P0ctCkCPGNP4TtyTyj8i7WFiHJ7uDyZGc6qSfrPn/55UcQTwGFwLqvRfR0DunFzSZA1p4GdKdp+alad+H3wJ8zRnizMyOtg8mxHuUt62FuUoPZm9Ask0g== X-MS-TrafficTypeDiagnostic: SN6PR07MB4397: X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4397;31:f9Ym70+yyaRu+fcrHaIYFxtD23GJfeIlUGSZ81SVtaaMLBuDR3GHXLG9FgeNLXKKLa68/hNMBHl0ja/82wd9e8jn6cZ84cy59ZYbNursqmkRH7NO9Fj23OJjHh3bfv2MLR6m2x8ll/Aanu/5LPnJu/4sSKxca3pq0MUva9Xfc0+LsQh8CBVOAHL/MJ0U5S2JK8G4f5torittrI3sAOU9OIyXPv7RIqknD+RMdM2jKM8=;20:suTUSNVXYrxB2Vs7VE2xD/7whd6DPPHZkYUuJ5mBg31/grq8EUONy6zJAOnc7JVZgFAYs4WUfdwF4G7a3A42lPwA/sqXI6k80OeYI6cw4HYtvIAUWWQcdgN+HEyyLIUqjdWAa8L1PrWFkQ0SWbM7FRF8SM8DJZTf/waj9s3Y03ChIwBb2Fy/LGxBzxlu2jJgdvgfthQtxPdnYIoiQLnZXVLcf96yO1SXwN5qdh2q6YsPwfj/+oWJia2rH8NUhmc3FLBbqzvw5ZIntlMOBPnFOr2555YYfNynHYADmBIHcbiaL2AH9R3Qg4AJ2bUVSeI1xh84rXqMC5Y1oqIxa208irt5PCOA2EJAkaT7Ix6harONHB3qwIuEvyf6bVf4tkkn2I+IWJDjTA/hqHDwyo3eENv/0vmSJay/ObNoi1NSM7xvKhDYclZZ70UgUNdYVDxErOB+7DRoTMlCHm7QUJ2O8q0ZkytvzONAjqn45REMPEwYZRJR+TErG3u0De9z+N+z X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(3002001)(93006095)(93004095)(10201501046)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699050);SRVR:SN6PR07MB4397;BCL:0;PCL:0;RULEID:;SRVR:SN6PR07MB4397; X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4397;4:KNDd2jZttbEzegPb6bzFvrd6IMRtK/ZwsKCMK7svUTG3SsEcQzlU12tA4SqZj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c/kWk+nyMt9mDwEbbB8Y8MxkwthNhGBgDrP7XRaPNjZS4Ld62DXkgr+BkQ1CkU8Uu3cPRuX53XleY9cu2JoZIfqPjxJSlWdcnzZPLt/Iat1eNjimcMRvRQNWxB/cDZqa1TfFJ6bEuHnd8Vpl48ia52hoGx1gLjEA3w/YiCAtLAEoAMzZA==;5:T4ETT7HiIFnd9dJbWVWt6DDWxpPJr0cMbNTyHkDxJy0qPWVP8rMsbILzx2ei+OSe6CLGsBD0HofBa5VhAjzkElvB/2iAb1ziLfV0m7TxvahTI1gsgg4voohOVmrzI/GOlAYSy27HINOYlutoGB9y/sOk9EY4H931ox0sSRDtJAQ=;7:Ww9uneVMEmInLYThUEpSXBX/dz8dAaRsgjci4S29IO72Sb24MrKvt6KsSnlWC0UW/CZ5USEJuTAKv6a1oQ7uiXnnou8veV1YREEJtS5uu9iLD6+5EsXRLN08bjBkhPGA6VnZvq0yG/5v4vUOwTMjOgxsTXBdDeFeTvmRvfYFKEBghzSd7NsVfL3Wci2xgg7T3QvyarAfreuDvESvnkC2JWFJmdXfF6Ko+tn21JdB4dO3uSlnPvbwAPgRgQ+zoLE2 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2018 17:18:29.2830 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 075d354a-f4be-43a5-77f8-08d6180a97d1 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: SN6PR07MB4397 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 allows FC-NVMe under-run to be handled by transport Signed-off-by: Darren Trapp Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_isr.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index bc97e3a1bef7..0087174d3766 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -1850,11 +1850,12 @@ static void qla24xx_nvme_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, struct sts_entry_24xx *sts = (struct sts_entry_24xx *)tsk; uint16_t state_flags; struct nvmefc_fcp_req *fd; - uint16_t ret = 0; + uint16_t ret = QLA_SUCCESS; + uint16_t comp_status = le16_to_cpu(sts->comp_status); iocb = &sp->u.iocb_cmd; fcport = sp->fcport; - iocb->u.nvme.comp_status = le16_to_cpu(sts->comp_status); + iocb->u.nvme.comp_status = comp_status; state_flags = le16_to_cpu(sts->state_flags); fd = iocb->u.nvme.desc; @@ -1892,28 +1893,35 @@ static void qla24xx_nvme_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, fd->transferred_length = fd->payload_length - le32_to_cpu(sts->residual_len); - switch (le16_to_cpu(sts->comp_status)) { + if (unlikely(comp_status != CS_COMPLETE)) + ql_log(ql_log_warn, fcport->vha, 0x5060, + "NVME-%s ERR Handling - hdl=%x status(%x) tr_len:%x resid=%x ox_id=%x\n", + sp->name, sp->handle, comp_status, + fd->transferred_length, le32_to_cpu(sts->residual_len), + sts->ox_id); + + /* + * If transport error then Failure (HBA rejects request) + * otherwise transport will handle. + */ + switch (comp_status) { case CS_COMPLETE: - ret = QLA_SUCCESS; break; - case CS_ABORTED: + case CS_RESET: case CS_PORT_UNAVAILABLE: case CS_PORT_LOGGED_OUT: + fcport->nvme_flag |= NVME_FLAG_RESETTING; + /* fall through */ + case CS_ABORTED: case CS_PORT_BUSY: - ql_log(ql_log_warn, fcport->vha, 0x5060, - "NVME-%s ERR Handling - hdl=%x completion status(%x) resid=%x ox_id=%x\n", - sp->name, sp->handle, sts->comp_status, - le32_to_cpu(sts->residual_len), sts->ox_id); fd->transferred_length = 0; iocb->u.nvme.rsp_pyld_len = 0; ret = QLA_ABORTED; break; + case CS_DATA_UNDERRUN: + break; default: - ql_log(ql_log_warn, fcport->vha, 0x5060, - "NVME-%s error - hdl=%x completion status(%x) resid=%x ox_id=%x\n", - sp->name, sp->handle, sts->comp_status, - le32_to_cpu(sts->residual_len), sts->ox_id); ret = QLA_FUNCTION_FAILED; break; }