Message ID | 20180425130905.6385-18-chad.dupuis@cavium.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show
Return-Path: <linux-scsi-owner@kernel.org> 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 310FE601D3 for <patchwork-linux-scsi@patchwork.kernel.org>; Wed, 25 Apr 2018 13:10:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DF6628E02 for <patchwork-linux-scsi@patchwork.kernel.org>; Wed, 25 Apr 2018 13:10:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 120DE28E15; Wed, 25 Apr 2018 13:10:03 +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 9863128E02 for <patchwork-linux-scsi@patchwork.kernel.org>; Wed, 25 Apr 2018 13:10:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753354AbeDYNKC (ORCPT <rfc822;patchwork-linux-scsi@patchwork.kernel.org>); Wed, 25 Apr 2018 09:10:02 -0400 Received: from mail-by2nam01on0074.outbound.protection.outlook.com ([104.47.34.74]:1056 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753399AbeDYNJv (ORCPT <rfc822;linux-scsi@vger.kernel.org>); Wed, 25 Apr 2018 09:09: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; bh=i6/tEGUvsNh/DbbBIcc37iwdC9I/ng0OXJa3CLkIkww=; b=Fk1F68jhDedEkdBfUCNM0noD29xd7j2v7IpxIFTnSwwsGLtluhRLwUp9ezyVBHTJOkrgpGdC3haCUydsTGPU8ZQrYmP9SpIPMYxpYSgN6Yvr31h1e8gz55cRFKvv/RR4jQkOUme1edcb7bmiZf9H05QwdhDKWw7aFHhot8j0Qfc= Received: from SN4PR0701CA0011.namprd07.prod.outlook.com (2603:10b6:803:28::21) by DM5PR07MB3179.namprd07.prod.outlook.com (2603:10b6:3:df::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Wed, 25 Apr 2018 13:09:33 +0000 Received: from BN1AFFO11FD006.protection.gbl (2a01:111:f400:7c10::187) by SN4PR0701CA0011.outlook.office365.com (2603:10b6:803:28::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.696.13 via Frontend Transport; Wed, 25 Apr 2018 13:09:32 +0000 Authentication-Results: spf=pass (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; oracle.com; dkim=none (message not signed) header.d=none;oracle.com; 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 BN1AFFO11FD006.mail.protection.outlook.com (10.58.52.66) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.653.14 via Frontend Transport; Wed, 25 Apr 2018 13:09:32 +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, 25 Apr 2018 06:09:23 -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 w3PD99gV006488; Wed, 25 Apr 2018 06:09:09 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w3PD99bi006487; Wed, 25 Apr 2018 06:09:09 -0700 From: Chad Dupuis <chad.dupuis@cavium.com> To: <martin.petersen@oracle.com> CC: <linux-scsi@vger.kernel.org>, <james.bottomley@hansenpartnership.com>, <QLogic-Storage-Upstream@cavium.com> Subject: [PATCH 17/21] qedf: Add additional checks when restarting an rport due to ABTS timeout. Date: Wed, 25 Apr 2018 06:09:01 -0700 Message-ID: <20180425130905.6385-18-chad.dupuis@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180425130905.6385-1-chad.dupuis@cavium.com> References: <20180425130905.6385-1-chad.dupuis@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(376002)(39860400002)(346002)(39380400002)(396003)(2980300002)(438002)(189003)(199004)(336012)(6916009)(5660300001)(486006)(8676002)(476003)(446003)(76176011)(51416003)(44832011)(126002)(2616005)(6666003)(11346002)(1076002)(316002)(81166006)(81156014)(8936002)(50226002)(106466001)(26005)(47776003)(50466002)(72206003)(54906003)(48376002)(42186006)(87636003)(106002)(305945005)(478600001)(86362001)(16586007)(80596001)(356003)(4326008)(36756003)(107886003)(2351001)(186003)(69596002)(2906002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3179; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Pass; LANG:en; PTR:50-232-66-26-static.hfc.comcastbusiness.net; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD006; 1:V0Woq7KrLRjFHeTJb5+MTBvycd19MoSky9g4g7ueVePS3pMKY25VVGWCJF/vgQT89Km4eJOquEJn4gqNrI0QjHLDFK6JjHz7hEmDoMRd9vms/wYgsuEt0IHTtn/P0MKJ X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:DM5PR07MB3179; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3179; 3:fCfuRJT+IYE4RTY/1lSxHtLorfLlaQs8HX29knTjZGxKFDJFknjMVkkFxNoPnBx7GgzU2t2ca8TQ50pWc6uA+Dq7NpxxGIGwnlY7I6wdJrXZE59gGkhmPFOu8d19aVt51udangr+2FtdR8GBnfIE23oqYwFk1yR1tD06e8W85jmr91aPVyC/EpO6eBfe5M+RotTYa+dDASnboBCWeEX7OUKpy+8PhOl5pPIkpI8p0PuAN4jqCtjTpT3LoSt95voU66jd4e+Zj8C8jADZxgd/RnKYTHi4gYgxMfsr9PJ3cP/USinUmedmb8fr8VPqHLl4kK+TgpkuAfbEotpMk7/j29V1Y9MDH2OF3J6D1zlYGsc=; 25:HUUqnc/stCHnQVwX90Wo+7bQsXG8CIEV4Uc/9dhaFVwCfuFnAoDGBe1xC+t7lEVtH11G1bY5K4GDSsJFRWxX22f8GhC7j0xFR7eryHGHd9fk+1c5OjcWYyTB0dtvLG+IoTHH99y3CJ35VrgvFGM7k1DsrnI+7qdoR70is7ZTV28a8UoFHAXeQCJcGG9bkKksOHtIxYR2bM48XusVToXY18MJoIAI+3mw3tjIkZeG+MqTKYh+4RRhGiSbc3oL0GYa//eA2vDnp7b7Qihru34m96r6ZZyygrz/pV0wmVS6ngW8w3wyD8Zx/6CZX1ltTpJUyrAQ52sErOFdjOeqxvD4AA== X-MS-TrafficTypeDiagnostic: DM5PR07MB3179: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3179; 31:7wuN6z366CqYptxzl1g15uuWqndDLo8I4oHubGO2pTR7RnqrL0jvNpIqQ58G5x/ujS+17MP16aHLY+Rh2iFSQkYqSTOvAEb7f248tt5jbYrOutnwRFnO4Ok5JhSjIBrjjEdiyKzJeNVHLKMpaf7fP7Ddqg3zOTM0Rzap+BQUZg5HYSfZP9BHpxmX+Qwf03iROpR+pr8uPGiqlvTwGZz/nWdbRtuMdbfOAcCmFgOpybE=; 20:HOGPSsLZzGQN+MYaL0NMFpPkLQkPDCQe2Xq953OC02qspc17sekHJSZ502ZBgj2KUgreuLhpWudyW6yncBQeQXf1SDfs64eYw6o0Hjr5dg0ySai+UT1T6pNHFdh7AqJVF6twTgl1MKzONcpaXyQevnd8JY6FaPeLDtLUq9ckiYSh8gc5SZ6ncJyCh7phqyThHOwHZgyynZOtaSAGMGTFNrXLb1/YPAs0gKdtDLX1GzvLQepIw4jQtYZgY0ct4kf7qzMlqgJaK1EB10xtIHauCmgv1c3BSLmHVCnP/3mxzyJHut/bn/t080c7nS2hVWmFwDsLODKFjXRQ55kfZ70WZiGQrCatLaA0+PDj7dGEy0QXJ/9Oh8AsotdgzHvyzB+r3gw/aWyCpV/SU6MgcVaeRu/W51StcQLifC58/Xbzdz1LUyHntw6fu8QEXF4ckMMFFkvqfvYLJzr+UZomXDi3ZzpNNOo3rVshFMzn89UlPERpZ5lGwisulWlidHEtqceD X-Microsoft-Antispam-PRVS: <DM5PR07MB3179AECE6C5E1BB6C48533C79E8F0@DM5PR07MB3179.namprd07.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231232)(944501410)(52105095)(93006095)(93004095)(6041310)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM5PR07MB3179; BCL:0; PCL:0; RULEID:; SRVR:DM5PR07MB3179; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3179; 4:znQfXL4peRMXA73lQr5BzSmpP63ylfiF3UszDkxoIgENVE8EYBVo3oOYcia7TP+bDhZ93kAdU8JoFzMS7+YTtWKKbEhGxxaiYWHZbPUZV9sUF/sXfm/CM9uuDfowyvulUFYFNHmIPwvQp8wkbBcYnZRDDsozm2CBei+HA+QfN8MenUAaG3n0AqY+vuLliYwH+oKHzowlvRm4lAWYymDLG+uKAHBqYEY2KcMwraetmHuca8JlPQQPWDqF3edt2QO5RzHgel0Ak4YwKK5jY43EzQ== X-Forefront-PRVS: 06530126A4 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR07MB3179; 23:BAkAFFqWlb3YLqo+ONRPvi0/xoBFLtYRfx3rZhSnV?= =?us-ascii?Q?c31xLT9/bH50yiipHI5LRHHMNj1kGslyLfT1wr2aAmI703vKfCij00oZjlxj?= =?us-ascii?Q?0uDG+AnVnkHi42L7mESIfwYJ7o7cLt8MqOOpdTvvNxf3hn4a3X1hLPCylUGi?= =?us-ascii?Q?O62KcU66ei75I6jlgSu4NOyEgMSTzKDRRn2yAW8Nj8lqctSAMTiCbFFySKx0?= =?us-ascii?Q?0CDxxMDbfzzMWIEL6CVHYzLmC11dq6Ym4Var9awZIpR3HbwjKZ6Bvp3oeQP/?= =?us-ascii?Q?p5vl25ys8UQuWIa1RUQMefGseLrEpoAbGM23+BOHelkpsrbM0DgLhFfxNRCF?= =?us-ascii?Q?HLpfIgQnUjbCzSF+cli8qcM0X1u1775qMkAEH35cLZ/xizjVEugoKOzx46KG?= =?us-ascii?Q?s/y5kxsUiFSHT3XSdqsgwnd/AxfBotJcUJLtBYxzgQnUdo8LpN/eMaSTBQ3v?= =?us-ascii?Q?39Jdr2q6hha7p5OmvRZqzTgUKZNEPXh+JkxwFKfTO7V+ICiCVfBJWR9r1ono?= =?us-ascii?Q?BjvP1rDAB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0iWo/KkpL9nDmMTOVbKAgeZA0douCvpjQ X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3179; 6:1IONE0vzhzQ1P87N7CMBFE7EAHpz0azzTmsMkDxRK4uTii76EXb5/uam8xT6FYRSIsUhWJ1eo5Y+XcAE45qDebFwxb1OBbOGeaVIJ9H0D1QG47wDjSYpCxmHOKxVg52Vt+akBdPPN/EDTh/6GwVZLnhrjtS8HdaOGsOue6z+yf6f81UwHhlbtINdtmjuJ6ByB1N0wVWnn9T5Z7S1vVuV2+7f7PWI5BQ6TtYgpcv572VaUTSx0j7OX3i45RMPJglNDREQ52Kxs8QGu7hqM0KtGkYQ959MyFHkdXZJR21zxU9xN6neCGkou3I+b4wqb/jAt+SQFe+QhCpgqRW2N5E/p1uPurfBx+YY125/EXhNevGkryL768LtIwVXcqZeYQBjzL8VB+OulKTSPC129D5XukaYYgPsTLA6Bh7isRjcvlv9MSdlb871aP/Ek5mOScnjwB8quqBsxnV7yqJESUNXQQ==; 5:CONJbLWDvUOG8APy7ZVNrABxiYeuXnvR82/kPtQN+OU8tUiSToU1eT1ehY8HIWC/f3GQ4jcj/HfaVHiu55F311zKMAIGb6eUxpchB+Ldy796dGOoWY9Le0LPhuEUxvA/vuG1VkxWGc4Iy1QzvNOft1j26xEAZwNo5GBtmxGAzuw=; 24:3xyZPMchrAGXKs9+4iPTzmEa8pdHvcaIegw1/6qLaLavVKHCJOj8vjqXqYLlpwpnvt/ZyPbxN+ZZotnbaOuqZHFYEfs78XEEx/K6Ezjbl2M= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3179; 7:119v7pfVyGTImyKewNFKwks3Td0kvKt8HOXf7n37tfn7McSP4PCpXNAVdIDOyYhmSwzHlyr+Y6ZduTek9AvLweYecPtpzoBAWB4Y2MIDG71CvE3yxMWW64+J3vMVpxf3blz2LMBE1ayuT4o8k3EztBaoJI35VvOXcFUZMiaeKUw5Wejf3ow0f3eqGExCfeXgadXQIxl983goZLvfxQJE8PFEKinI9DVaOr8hejaf6EofjqDiwOpUQwX4MK7RAYrM X-MS-Office365-Filtering-Correlation-Id: d6270c3e-2cf9-44e3-c3ac-08d5aaadc962 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2018 13:09:32.4274 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d6270c3e-2cf9-44e3-c3ac-08d5aaadc962 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: DM5PR07MB3179 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: <linux-scsi.vger.kernel.org> X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c index 589414f06376..f669df03f37d 100644 --- a/drivers/scsi/qedf/qedf_io.c +++ b/drivers/scsi/qedf/qedf_io.c @@ -1457,6 +1457,31 @@ void qedf_flush_active_ios(struct qedf_rport *fcport, int lun) goto free_cmd; } + if (io_req->cmd_type == QEDF_ABTS) { + rc = kref_get_unless_zero(&io_req->refcount); + if (!rc) { + QEDF_ERR(&(qedf->dbg_ctx), + "Could not get kref for abort io_req=0x%p xid=0x%x.\n", + io_req, io_req->xid); + continue; + } + QEDF_INFO(&qedf->dbg_ctx, QEDF_LOG_IO, + "Flushing abort xid=0x%x.\n", io_req->xid); + + clear_bit(QEDF_CMD_IN_ABORT, &io_req->flags); + + if (io_req->sc_cmd) { + if (io_req->return_scsi_cmd_on_abts) + qedf_scsi_done(qedf, io_req, DID_ERROR); + } + + /* Notify eh_abort handler that ABTS is complete */ + complete(&io_req->abts_done); + kref_put(&io_req->refcount, qedf_release_cmd); + + goto free_cmd; + } + if (!io_req->sc_cmd) continue; if (lun > 0) { @@ -1534,6 +1559,11 @@ int qedf_initiate_abts(struct qedf_ioreq *io_req, bool return_scsi_cmd_on_abts) goto abts_err; } + if (test_bit(QEDF_RPORT_UPLOADING_CONNECTION, &fcport->flags)) { + QEDF_ERR(&qedf->dbg_ctx, "fcport is uploading.\n"); + rc = 1; + goto out; + } kref_get(&io_req->refcount); @@ -1573,6 +1603,7 @@ int qedf_initiate_abts(struct qedf_ioreq *io_req, bool return_scsi_cmd_on_abts) * task at the firmware. */ qedf_initiate_cleanup(io_req, return_scsi_cmd_on_abts); +out: return rc; }
There are a couple of kernel cases when we restart a remote port due to ABTS timeout that we need to handle: 1. Flush any outstanding ABTS requests when flushing I/Os so that we do not hold up the eh_abort handler indefinitely causing process hangs. 2. Check if we are currently uploading a connection before issuing an ABTS. Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> --- drivers/scsi/qedf/qedf_io.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)