From patchwork Thu Dec 28 20:33:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10135873 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 DC43260318 for ; Thu, 28 Dec 2017 20:34:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE21F2B1F6 for ; Thu, 28 Dec 2017 20:34:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2D5A2C0FA; Thu, 28 Dec 2017 20:34:28 +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 2C21E2B1F6 for ; Thu, 28 Dec 2017 20:34:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755090AbdL1Ue1 (ORCPT ); Thu, 28 Dec 2017 15:34:27 -0500 Received: from mail-co1nam03on0089.outbound.protection.outlook.com ([104.47.40.89]:60974 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755234AbdL1UeL (ORCPT ); Thu, 28 Dec 2017 15:34:11 -0500 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=R/TX6Fx0lUk+gkliSNWmuComUGyHXVizBgL0RMxjrcc=; b=XvUjaFg6oijQYj5NnHiS3T1izLitz3IXYH2r3KNwpYgbfI+PN9VDBD6cUUh3VYfcagO3IDV9pHNKWtMlMHgk8DRowCiGVZ3jWmhXAwlg/svQqBobUaFWeY7gttGunj+ZBCIGtvRg8jozCtZ9UUGpJhlGWV7N3odedEXRMMZqevY= Received: from SN4PR0701CA0023.namprd07.prod.outlook.com (2603:10b6:803:28::33) by CY4PR0701MB3809.namprd07.prod.outlook.com (2603:10b6:910:94::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.14; Thu, 28 Dec 2017 20:34:07 +0000 Received: from BN1BFFO11FD006.protection.gbl (2a01:111:f400:7c10::1:149) by SN4PR0701CA0023.outlook.office365.com (2603:10b6:803:28::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.366.8 via Frontend Transport; Thu, 28 Dec 2017 20:34:07 +0000 Authentication-Results: spf=permerror (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=none action=none header.from=cavium.com; Received-SPF: PermError (protection.outlook.com: domain of cavium.com used an invalid SPF mechanism) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BN1BFFO11FD006.mail.protection.outlook.com (10.58.144.69) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.345.12 via Frontend Transport; Thu, 28 Dec 2017 20:33:46 +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; Thu, 28 Dec 2017 12:33:49 -0800 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 vBSKXmci002851; Thu, 28 Dec 2017 12:33:48 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id vBSKXlba002850; Thu, 28 Dec 2017 12:33:47 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 12/37] qla2xxx: Add ability to send PRLO Date: Thu, 28 Dec 2017 12:33:20 -0800 Message-ID: <20171228203345.2702-13-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171228203345.2702-1-himanshu.madhani@cavium.com> References: <20171228203345.2702-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)(39850400004)(396003)(39380400002)(346002)(376002)(2980300002)(448002)(189003)(199004)(80596001)(87636003)(47776003)(72206003)(81166006)(59450400001)(4326008)(5660300001)(69596002)(8936002)(48376002)(81156014)(76176011)(1076002)(51416003)(2906002)(50226002)(50466002)(42186006)(85326001)(316002)(106466001)(356003)(16586007)(478600001)(305945005)(110136005)(54906003)(2950100002)(86362001)(6666003)(36756003)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR0701MB3809; H:CAEXCH02.caveonetworks.com; FPR:; SPF:PermError; PTR:50-232-66-26-static.hfc.comcastbusiness.net; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD006; 1:6JnLjedb/D/u3edi+00D/rTB9J11d4Ak1dYw1wtNb7f3jKmF+pRvcAKcgHqiP7PI0IzVArzHPscKZXBr1jYeQyLdYsYpQKkATjgeDRgwQYb5FS5OZ9y5x1T/TRulvRZ5 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 02f87090-90b8-42f9-781c-08d54e324bb2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:CY4PR0701MB3809; X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3809; 3:ZvU8bTdbby9BOKk28Lyurpf9tWrS6aS+Q3nCxatXQIEo/zFz5a5mUYoA34fVY4hy2pJqPCxicBJwbJoVED4t0SnDZCQ2GwWIDDrfs2MhT0kNTScdGkJeY1Q7YsojHhkpiNhJaWXRVmoQqXKo2PzCnlR9JsE9IKzxLg9Hlbfl7zr6Z9hi5bF39EnhLNHvQc7icZMc+khFl16w0hoXvJL4FYsGGZnst3GzC4srSfb5406f4v8TwcYS6EUP27mhccdsYkkkIupLqvnjlZUvZW0m8q2nMj1YYemXEImHuyObPkpLnNdaX9SOxIM8ivOawh0Vn8WBkegXYlDdQ6AO4ydkDw==; 25:QZexaxdTm7tdxRfBOsTrmVivD8okIEGZPtYb1V587S3rgNRJ0p4CA1JDjOTSqyXo7GuqlcXNPD+NsJpZBPd5/dmh4GmY3SehIQKyzOc7RZnvrm9hFFabJcZIgxr0FbeZzzEcJq0WXBYLtpmmw9/5G15I0h/aKF0DiStHAi0ZyV0TRYxDlmfcPFc9jGpUWvJ6qhRtBqPkc4EaMWyA/ZLpdLxp1LFzXkSlUBA+mL5wLqYFRiBsjFble/U00zNjSfnH/M+cNX1VjO8loE3srRLeYKEl5UbuZO1aXO5e29HYxWxLbPjeoINgtSRTvKZ3r+ShLayc+1y6EYZBdIU3j6UVOw==; 31:ekf4Miquz2pqKQz7t4AWd1oDirSpzkXFeyxlY6D9kwq8V/fS0YWtaajC02NiaxayL9jhn53aNZj9FvYOIIuGFY5C+2eonXPWE9TRkYpka/LsmgD1oWrLh7njRQyiaaZymU1pjOIPLmIu25MCOZ3rvMGzqRJ4b7ecW8wCBQFqsvYwLx+K+zVCiEe1kEBA6U9uorWJpYmAN7ucjvX0VBULJUr966wygY2Vg368qHDUNO4= X-MS-TrafficTypeDiagnostic: CY4PR0701MB3809: X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3809; 20:dVlGd+qMpBSci6wEJu5Mb14HTsGIkzqYUfFg3P2dvSF+KM/xu4sSiQwDJfV2ED+VPdkQi0qfvq1cCBLzEyo6OlPEoem8xIKGbWhYmyLV/400VPXaCIf1Ct6931/++u6ANXtmzcjqB4RemJx+rdlDd2/fN34qjR+OCATh0A93CGuFdrPQ9aWz101FIV8eeXnFT6w9Y9wyCc3dpwaw2cIx8Nt63zBE073XUyb/wiaUUrCJDhRfrs9qW7bc/c9ckFasPi0+uuRnttfz4Y+eXMMpHwwuGs2cLrY1/PxdwhHRlLkmAUL2S94UsTPKEV8y/jMTW8boKddb+hQNWbxLbRg4J/lbLjf8AH1xZoikme9VTxA81/VZ2CQyadC8sNKgYjeuga6cSxP/MlF0SLgBGo8vzTSwujwz8djntkc4vVQZIpYmEHjE8QE5Lam14JYm9XaqOKL1FA9ArbDDnEwouc3QkhT+c72TBhbbhXf7VPjA75BVupTVzAglbketQj/6VTAr; 4:7dLWaxhoCClnUAsFEwDHLARXLDRhChO33AdiMNjdGsQjhmZlv4ZcJSYRYrI/nQLIvttja6t2RNX5S+8HGct0CsOGOP69jcA3XLEcQDp9OMtjagYTDiI6wxuP7slVrrr2+8+2qNKptWK67UT1ft4lYgPeTOG2wUlK31Tn5IqCLnIR/aqiFlh2hX6g1UENLEJ1xnuwaa453n32/gNEuue1NGBmMGVlRztSt6nhZXVEHkMO04wrDG5c668+ZyvcZN9eNZ0ImGGLzy1kp3S1833Ctg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(3002001)(3231023)(944501075)(93006095)(93001095)(10201501046)(6041268)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(6072148)(201708071742011); SRVR:CY4PR0701MB3809; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR0701MB3809; X-Forefront-PRVS: 05352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IRCWLyVKEI1R+cpvkiHP2C0/irpzbPHCRVF26oVf8XkoHKIv64d/3Whp/CyhuoINWqy+9xMbK4dlpi7X0EH6IhkEVPeiAzdiQKFM6D8kUpBUqSOtv SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2017 20:33:46.4679 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 02f87090-90b8-42f9-781c-08d54e324bb2 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: CY4PR0701MB3809 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: Quinn Tran Add ability to send Implicit PRLO to flush IOs from FW back to driver. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 3 +++ drivers/scsi/qla2xxx/qla_gbl.h | 8 ++++++ drivers/scsi/qla2xxx/qla_init.c | 59 +++++++++++++++++++++++++++++++++++++++++ drivers/scsi/qla2xxx/qla_iocb.c | 17 ++++++++++++ drivers/scsi/qla2xxx/qla_os.c | 9 +++++++ 5 files changed, 96 insertions(+) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 92dbba47d3cf..7a42aad55ec3 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -507,6 +507,7 @@ struct srb_iocb { #define SRB_NVME_LS 20 #define SRB_PRLI_CMD 21 #define SRB_CTRL_VP 22 +#define SRB_PRLO_CMD 23 enum { TYPE_SRB, @@ -3140,6 +3141,8 @@ enum qla_work_type { QLA_EVT_GNL, QLA_EVT_NACK, QLA_EVT_RELOGIN, + QLA_EVT_ASYNC_PRLO, + QLA_EVT_ASYNC_PRLO_DONE, }; diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index aabd49ef95a3..7b61c96502e4 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -66,6 +66,7 @@ extern void qla84xx_put_chip(struct scsi_qla_host *); extern int qla2x00_async_login(struct scsi_qla_host *, fc_port_t *, uint16_t *); extern int qla2x00_async_logout(struct scsi_qla_host *, fc_port_t *); +extern int qla2x00_async_prlo(struct scsi_qla_host *, fc_port_t *); extern int qla2x00_async_adisc(struct scsi_qla_host *, fc_port_t *, uint16_t *); extern int qla2x00_async_tm_cmd(fc_port_t *, uint32_t, uint32_t, uint32_t); @@ -109,6 +110,13 @@ int qla24xx_post_newsess_work(struct scsi_qla_host *, port_id_t *, u8 *, int qla24xx_fcport_handle_login(struct scsi_qla_host *, fc_port_t *); int qla24xx_detect_sfp(scsi_qla_host_t *vha); int qla24xx_post_gpdb_work(struct scsi_qla_host *, fc_port_t *, u8); +void qla2x00_async_prlo_done(struct scsi_qla_host *, fc_port_t *, + uint16_t *); +extern int qla2x00_post_async_prlo_work(struct scsi_qla_host *, fc_port_t *, + uint16_t *); +extern int qla2x00_post_async_prlo_done_work(struct scsi_qla_host *, + fc_port_t *, uint16_t *); + /* * Global Data in qla_os.c source file. */ diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 39d1edc6c2b1..56bff7856cf8 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -278,6 +278,65 @@ qla2x00_async_logout(struct scsi_qla_host *vha, fc_port_t *fcport) fcport->flags &= ~FCF_ASYNC_SENT; return rval; } + +void +qla2x00_async_prlo_done(struct scsi_qla_host *vha, fc_port_t *fcport, + uint16_t *data) +{ + /* Don't re-login in target mode */ + if (!fcport->tgt_session) + qla2x00_mark_device_lost(vha, fcport, 1, 0); + qlt_logo_completion_handler(fcport, data[0]); +} + +static void +qla2x00_async_prlo_sp_done(void *s, int res) +{ + srb_t *sp = (srb_t *)s; + struct srb_iocb *lio = &sp->u.iocb_cmd; + struct scsi_qla_host *vha = sp->vha; + + if (!test_bit(UNLOADING, &vha->dpc_flags)) + qla2x00_post_async_prlo_done_work(sp->fcport->vha, sp->fcport, + lio->u.logio.data); + sp->free(sp); +} + +int +qla2x00_async_prlo(struct scsi_qla_host *vha, fc_port_t *fcport) +{ + srb_t *sp; + struct srb_iocb *lio; + int rval; + + rval = QLA_FUNCTION_FAILED; + sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); + if (!sp) + goto done; + + sp->type = SRB_PRLO_CMD; + sp->name = "prlo"; + qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); + + lio = &sp->u.iocb_cmd; + lio->timeout = qla2x00_async_iocb_timeout; + sp->done = qla2x00_async_prlo_sp_done; + rval = qla2x00_start_sp(sp); + if (rval != QLA_SUCCESS) + goto done_free_sp; + + ql_dbg(ql_dbg_disc, vha, 0x2070, + "Async-prlo - hdl=%x loop-id=%x portid=%02x%02x%02x.\n", + sp->handle, fcport->loop_id, fcport->d_id.b.domain, + fcport->d_id.b.area, fcport->d_id.b.al_pa); + return rval; + +done_free_sp: + sp->free(sp); +done: + return rval; +} + static void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea) { diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index d1dfa784d895..14a3f6932c9c 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -3390,6 +3390,20 @@ qla25xx_ctrlvp_iocb(srb_t *sp, struct vp_ctrl_entry_24xx *vce) vce->vp_idx_map[map] |= 1 << pos; } +static void +qla24xx_prlo_iocb(srb_t *sp, struct logio_entry_24xx *logio) +{ + logio->entry_type = LOGINOUT_PORT_IOCB_TYPE; + logio->control_flags = + cpu_to_le16(LCF_COMMAND_PRLO|LCF_IMPL_PRLO); + + logio->nport_handle = cpu_to_le16(sp->fcport->loop_id); + logio->port_id[0] = sp->fcport->d_id.b.al_pa; + logio->port_id[1] = sp->fcport->d_id.b.area; + logio->port_id[2] = sp->fcport->d_id.b.domain; + logio->vp_index = sp->fcport->vha->vp_idx; +} + int qla2x00_start_sp(srb_t *sp) { @@ -3471,6 +3485,9 @@ qla2x00_start_sp(srb_t *sp) case SRB_CTRL_VP: qla25xx_ctrlvp_iocb(sp, pkt); break; + case SRB_PRLO_CMD: + qla24xx_prlo_iocb(sp, pkt); + break; default: break; } diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 487e1affacf4..aca7afc139ea 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -4690,6 +4690,8 @@ qla2x00_post_async_work(logout, QLA_EVT_ASYNC_LOGOUT); qla2x00_post_async_work(logout_done, QLA_EVT_ASYNC_LOGOUT_DONE); qla2x00_post_async_work(adisc, QLA_EVT_ASYNC_ADISC); qla2x00_post_async_work(adisc_done, QLA_EVT_ASYNC_ADISC_DONE); +qla2x00_post_async_work(prlo, QLA_EVT_ASYNC_PRLO); +qla2x00_post_async_work(prlo_done, QLA_EVT_ASYNC_PRLO_DONE); int qla2x00_post_uevent_work(struct scsi_qla_host *vha, u32 code) @@ -4943,6 +4945,13 @@ qla2x00_do_work(struct scsi_qla_host *vha) case QLA_EVT_NACK: qla24xx_do_nack_work(vha, e); break; + case QLA_EVT_ASYNC_PRLO: + qla2x00_async_prlo(vha, e->u.logio.fcport); + break; + case QLA_EVT_ASYNC_PRLO_DONE: + qla2x00_async_prlo_done(vha, e->u.logio.fcport, + e->u.logio.data); + break; } if (e->flags & QLA_EVT_FLAG_FREE) kfree(e);