From patchwork Wed Aug 1 06:13:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10551733 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 15D471708 for ; Wed, 1 Aug 2018 06:13:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0620D2A5FC for ; Wed, 1 Aug 2018 06:13:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE22B2A64D; Wed, 1 Aug 2018 06:13:44 +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 236112A5FC for ; Wed, 1 Aug 2018 06:13:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733134AbeHAH5k (ORCPT ); Wed, 1 Aug 2018 03:57:40 -0400 Received: from mail-bn3nam01on0040.outbound.protection.outlook.com ([104.47.33.40]:7068 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733087AbeHAH5k (ORCPT ); Wed, 1 Aug 2018 03:57:40 -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=bC4Syc/8mUt4OryPbD0RqJihQofIJ8P+hGAUD466+/g=; b=fEiKUMzzGEwiL+0w9RAMWRLdZ4KpNKQEP6cfhWiAbhUCiXLsPbrVmjlD/WUgVJHMrHBmrvUEzYze8bJHDG9bLUdk4hegRw8VCDUVYTUMCZ6vVdp+l9rOJZBaE4+l4ps4ZRCjqR7VXD2M+Wg+fdVzB6QTsc8rIrEhcjMwN3ge/48= Received: from BYAPR07CA0027.namprd07.prod.outlook.com (2603:10b6:a02:bc::40) by SN1PR07MB1469.namprd07.prod.outlook.com (2a01:111:e400:5838::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Wed, 1 Aug 2018 06:13:39 +0000 Received: from BY2NAM05FT043.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by BYAPR07CA0027.outlook.office365.com (2603:10b6:a02:bc::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.17 via Frontend Transport; Wed, 1 Aug 2018 06:13:38 +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 BY2NAM05FT043.mail.protection.outlook.com (10.152.100.180) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Wed, 1 Aug 2018 06:13:38 +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, 31 Jul 2018 23:13:35 -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 w716DaAd028748; Tue, 31 Jul 2018 23:13:36 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w716DadU028747; Tue, 31 Jul 2018 23:13:36 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 01/16] qla2xxx: Cleanup for N2N code Date: Tue, 31 Jul 2018 23:13:20 -0700 Message-ID: <20180801061335.28709-2-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180801061335.28709-1-himanshu.madhani@cavium.com> References: <20180801061335.28709-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)(136003)(39850400004)(346002)(376002)(396003)(2980300002)(438002)(189003)(199004)(8936002)(575784001)(86362001)(478600001)(87636003)(2906002)(336012)(36756003)(356003)(186003)(26005)(50226002)(305945005)(72206003)(47776003)(4326008)(106002)(76176011)(1076002)(110136005)(51416003)(476003)(11346002)(446003)(6666003)(106466001)(486006)(81166006)(2616005)(126002)(50466002)(8676002)(44832011)(16586007)(54906003)(80596001)(316002)(42186006)(81156014)(48376002)(69596002)(52396003)(5660300001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR07MB1469;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;BY2NAM05FT043;1:e8w5ecUboi1MLJWIbOdxqqdWzyEFg6DNxtQoGtBZOCZoPCRex3waDla3ioupGyHoDAI0ni5nuvTf0825ujT2SqA2SYUt5AWf9lJgzsaembdkVvF3uCahogiJZNB1zUAs X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1fc6bcf4-119f-499d-6639-08d5f775ec30 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:SN1PR07MB1469; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1469;3:vPXpmMBWIIxXI8zx3ebF3D3Klj8DFN+D1S42FxrfR5riW+doayZmbk/mkIvphHFi8Fue2rN8Ly1l89UuTUqw89Qh22cyd3yuILoEBY1z8jthzFj6vG3wBXSdMvZ0rTJwPPWyNotkFdJ+jl0cMODTCdu0rsDe+s8HX3QAbIua5+Y9R1HGqngyFxX58bvZ0s1ZCIL7R6uGYA85VIUQNtUP+M1SGtPtaFNzp/gob4X9XeQDScv0k8op6F6LRV3Zcjs0xuLVcaJeBpaBbnK4W7hx6590VloU1IFTBVVbFOend58wWZdeyjAngJDSEzdtERCG9Zq7jjyug0pHdOTTm3PoB7CXSt0h0w3CvESOdHuMl6E=;25:Q3VBHCWTihaG2D4+lASCyhPHfzgZe9rBNF1FUaULZO9tHdiBQUGtLtsqZ+nwvvEi0+napX7O0/1MfrFkkh9DGDFODh3wGHOIsqVYscqpztgsf7req78vs5FISQC1FEx6w88zmyu6AipnQMGdHfWxIzMpIDLoLqr8vbNdhCNpPCasbYnACmRAu9XUXY6seUP7uz4Cf4ozrvdb3X2BbyLps9tAt8SQ2f7VEHgigTqUmKCdm871kNBXYCjzlt8Z26ljEZ8Vo06yCvCZAhl2phEAlLZlWRGRuIDygbTyHDv9u3ZF7gq8ftA7W17J1R8nYG7vjr+j8SuaC1SSjy6N1yd8+g== X-MS-TrafficTypeDiagnostic: SN1PR07MB1469: X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1469;31:GgKLi7w9K/g/9fMpxzDcH2X8PdAN226gZPm/BkpDHHlOrn2ONCeOrLMjTIMjvsEH8SumrUxo4PWEwRQFyvD1m1R0GbXLasOcA2+1oS/WQUJE3ogILMm0xbybrkNCq8M0DpDzy+nqLFxVDJZR42W9OGIYV1aEgZ0Yjlq6CmgahmE/lOeckO5hDSCHWuGKakcue5txx1/izjFwSUTUbtMRoZTU2qmaahZG4hwWRuqoQPc=;20:LJRJAECyxqNo+MLegSohJfI5BSqcSBwskEwosBIuw0Mk7Cm5Fz1axlBEwHJ/snXeWauOmZM7CUT1ULGXcQUuno1WRFsbIagtIZAz7iZ2KKKzz68fKZHR832Fx/y7UsOr+CXWRfZs55kK5IAwK76CLHnXeq5okqntEAGAXN+S/uB5ZYfAHA9ytjdVkBeiRyKVXP7x0QCyLoqNSbMlAafIF+jNxEe9RNSyYBovyWDJMNkqE6JW1P8K0SxpeDvii5Wk9z3D77O5hhWaARKgovS7QeRZ3pAsuQDfDRUfW3sfDCJe7A/3J5OHV/ir6XaNQHgsi5e/UGW5AgFstiv2VpULC3DLf6/Av9rxDhH3N64VCNPk89YFMqWP2v3dO8Y3ShkAqGzvfen05E9E3ke5g2NNrgPqBNMODkiYXUVTkwpaj0H74VFGVMsdrnlz78FiYEUaffG2nhS6epfWt2HyFYdvHNawvq3EyLcKyO3j8A91VauIabVMSEO5G1QBpFHNJD00 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)(8121501046)(5005006)(93006095)(93004095)(3002001)(10201501046)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:SN1PR07MB1469;BCL:0;PCL:0;RULEID:;SRVR:SN1PR07MB1469; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1469;4:+GkZHjmkAvnhR5nwq3pMcOiRcCvdzx9Csi9nV0KwpV3HSm45TH8vkVB/bEMhLD59u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KYr81atq7SLvG37dy0sp35NGh9XriaDU+msbxx2n8nYd+mDS5KkBG51TIyC3pmsZeaw7wGt2zfzE8uC3OCa/C/s46CED38My7UhvhhcFY+Bfc1rB/Jtrpw74c1wjue/k6x5uXiP2SLnCgiAogWtJ4EwxKzJeeJmKtMxrO4uWA8wUHm3mpqk0YE7h7xe09L93Lsg==;5:Qb/NJkP0Fp4gNm1CA5tHKpjgBmBUGrco3FpGOa8A6OwKRe8g0pMpcqOBZuecunBGM0bqeQ7zKvhT4rdYIsBOLKG5D8PVFZGqSb1h2KN9UiaS02cg6iyOuBtz4t1jb5NpC18XUMUPBL0BGfGUhT9PCRo37LyzkFHtPqy0OxbmXUM=;7:CXZWYVqZ4QRd/zGJmL7ACHdDqwHAVCXNQyJMKQKVtZaeS/TnW3Q0z42J4knbwd/OHavkN9R9AyuOvTtEsM8XpSm2Pr04FGnx8Eb/3xdBixduNZZdtOttUrnGSpFXe2XZ1gcq0oMK0gdCfSuwJ03Hy075xGImK6aeQU5c7J6CCvKqxueeoT1GPnUFzQ6aMopa0evlQFdEQyVYc24zkHFn872WeYSrIkxgK4TU/d335yMMIJQliEhU2NhaTTd16LrZ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 06:13:38.6434 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1fc6bcf4-119f-499d-6639-08d5f775ec30 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: SN1PR07MB1469 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 Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c | 112 ---------------------------------------- drivers/scsi/qla2xxx/qla_iocb.c | 25 --------- 2 files changed, 137 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 7b675243bd16..1de78697dc0d 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -4687,110 +4687,6 @@ qla2x00_configure_loop(scsi_qla_host_t *vha) } /* - * N2N Login - * Updates Fibre Channel Device Database with local loop devices. - * - * Input: - * ha = adapter block pointer. - * - * Returns: - */ -static int qla24xx_n2n_handle_login(struct scsi_qla_host *vha, - fc_port_t *fcport) -{ - struct qla_hw_data *ha = vha->hw; - int res = QLA_SUCCESS, rval; - int greater_wwpn = 0; - int logged_in = 0; - - if (ha->current_topology != ISP_CFG_N) - return res; - - if (wwn_to_u64(vha->port_name) > - wwn_to_u64(vha->n2n_port_name)) { - ql_dbg(ql_dbg_disc, vha, 0x2002, - "HBA WWPN is greater %llx > target %llx\n", - wwn_to_u64(vha->port_name), - wwn_to_u64(vha->n2n_port_name)); - greater_wwpn = 1; - fcport->d_id.b24 = vha->n2n_id; - } - - fcport->loop_id = vha->loop_id; - fcport->fc4f_nvme = 0; - fcport->query = 1; - - ql_dbg(ql_dbg_disc, vha, 0x4001, - "Initiate N2N login handler: HBA port_id=%06x loopid=%d\n", - fcport->d_id.b24, vha->loop_id); - - /* Fill in member data. */ - if (!greater_wwpn) { - rval = qla2x00_get_port_database(vha, fcport, 0); - ql_dbg(ql_dbg_disc, vha, 0x1051, - "Remote login-state (%x/%x) port_id=%06x loop_id=%x, rval=%d\n", - fcport->current_login_state, fcport->last_login_state, - fcport->d_id.b24, fcport->loop_id, rval); - - if (((fcport->current_login_state & 0xf) == 0x4) || - ((fcport->current_login_state & 0xf) == 0x6)) - logged_in = 1; - } - - if (logged_in || greater_wwpn) { - if (!vha->nvme_local_port && vha->flags.nvme_enabled) - qla_nvme_register_hba(vha); - - /* Set connected N_Port d_id */ - if (vha->flags.nvme_enabled) - fcport->fc4f_nvme = 1; - - fcport->scan_state = QLA_FCPORT_FOUND; - fcport->fw_login_state = DSC_LS_PORT_UNAVAIL; - fcport->disc_state = DSC_GNL; - fcport->n2n_flag = 1; - fcport->flags = 3; - vha->hw->flags.gpsc_supported = 0; - - if (greater_wwpn) { - ql_dbg(ql_dbg_disc, vha, 0x20e5, - "%s %d PLOGI ELS %8phC\n", - __func__, __LINE__, fcport->port_name); - - res = qla24xx_els_dcmd2_iocb(vha, ELS_DCMD_PLOGI, - fcport, fcport->d_id); - } - - if (res != QLA_SUCCESS) { - ql_log(ql_log_info, vha, 0xd04d, - "PLOGI Failed: portid=%06x - retrying\n", - fcport->d_id.b24); - res = QLA_SUCCESS; - } else { - /* State 0x6 means FCP PRLI complete */ - if ((fcport->current_login_state & 0xf) == 0x6) { - ql_dbg(ql_dbg_disc, vha, 0x2118, - "%s %d %8phC post GPDB work\n", - __func__, __LINE__, fcport->port_name); - fcport->chip_reset = - vha->hw->base_qpair->chip_reset; - qla24xx_post_gpdb_work(vha, fcport, 0); - } else { - ql_dbg(ql_dbg_disc, vha, 0x2118, - "%s %d %8phC post NVMe PRLI\n", - __func__, __LINE__, fcport->port_name); - qla24xx_post_prli_work(vha, fcport); - } - } - } else { - /* Wait for next database change */ - set_bit(N2N_LOGIN_NEEDED, &vha->dpc_flags); - } - - return res; -} - -/* * qla2x00_configure_local_loop * Updates Fibre Channel Device Database with local loop devices. * @@ -4847,14 +4743,6 @@ qla2x00_configure_local_loop(scsi_qla_host_t *vha) } new_fcport->flags &= ~FCF_FABRIC_DEVICE; - /* Inititae N2N login. */ - if (test_and_clear_bit(N2N_LOGIN_NEEDED, &vha->dpc_flags)) { - rval = qla24xx_n2n_handle_login(vha, new_fcport); - if (rval != QLA_SUCCESS) - goto cleanup_allocation; - return QLA_SUCCESS; - } - /* Add devices to port list. */ id_iter = (char *)ha->gid_list; for (index = 0; index < entries; index++) { diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index a91cca52b5d5..b349e9b94c08 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -2568,26 +2568,6 @@ qla24xx_els_logo_iocb(srb_t *sp, struct els_entry_24xx *els_iocb) } static void -qla2x00_els_dcmd2_sp_free(void *data) -{ - srb_t *sp = data; - struct srb_iocb *elsio = &sp->u.iocb_cmd; - - if (elsio->u.els_plogi.els_plogi_pyld) - dma_free_coherent(&sp->vha->hw->pdev->dev, DMA_POOL_SIZE, - elsio->u.els_plogi.els_plogi_pyld, - elsio->u.els_plogi.els_plogi_pyld_dma); - - if (elsio->u.els_plogi.els_resp_pyld) - dma_free_coherent(&sp->vha->hw->pdev->dev, DMA_POOL_SIZE, - elsio->u.els_plogi.els_resp_pyld, - elsio->u.els_plogi.els_resp_pyld_dma); - - del_timer(&elsio->timer); - qla2x00_rel_sp(sp); -} - -static void qla2x00_els_dcmd2_iocb_timeout(void *data) { srb_t *sp = data; @@ -2648,10 +2628,6 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, } elsio = &sp->u.iocb_cmd; - fcport->d_id.b.domain = remote_did.b.domain; - fcport->d_id.b.area = remote_did.b.area; - fcport->d_id.b.al_pa = remote_did.b.al_pa; - ql_dbg(ql_dbg_io, vha, 0x3073, "Enter: PLOGI portid=%06x\n", fcport->d_id.b24); @@ -2664,7 +2640,6 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, qla2x00_init_timer(sp, ELS_DCMD_TIMEOUT); sp->done = qla2x00_els_dcmd2_sp_done; - sp->free = qla2x00_els_dcmd2_sp_free; ptr = elsio->u.els_plogi.els_plogi_pyld = dma_alloc_coherent(&ha->pdev->dev, DMA_POOL_SIZE, From patchwork Wed Aug 1 06:13:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10551735 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 88ABC1822 for ; Wed, 1 Aug 2018 06:13:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71C952A5FC for ; Wed, 1 Aug 2018 06:13:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 638332A677; Wed, 1 Aug 2018 06:13:47 +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 4B9872A5FC for ; Wed, 1 Aug 2018 06:13:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733148AbeHAH5n (ORCPT ); Wed, 1 Aug 2018 03:57:43 -0400 Received: from mail-cys01nam02on0040.outbound.protection.outlook.com ([104.47.37.40]:25600 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731897AbeHAH5m (ORCPT ); Wed, 1 Aug 2018 03:57:42 -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=dVFgDZn/Y6cZRXLGR7g1G7WLept0i2/9zoTLb9m6Gz8=; b=MSGIYHVzrboXO4XU53jX/NBgD+Bo3hnkDHsy6odYMuoBu9uDcy1XQa1IF9TBn3HCEZKJFeeDHj/FvERAUoSIP69430eYQ6atliwTwyCPLvusLPqZi1gruzKj+QowsYkzWCnVHH/m+rb1B2hi3f4K+J+wn1KwBxNvtOfInaJ87w4= Received: from BYAPR07CA0027.namprd07.prod.outlook.com (2603:10b6:a02:bc::40) by DM2PR07MB1467.namprd07.prod.outlook.com (2a01:111:e400:50c3::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.20; Wed, 1 Aug 2018 06:13:40 +0000 Received: from BY2NAM05FT043.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by BYAPR07CA0027.outlook.office365.com (2603:10b6:a02:bc::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.17 via Frontend Transport; Wed, 1 Aug 2018 06:13:40 +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 BY2NAM05FT043.mail.protection.outlook.com (10.152.100.180) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Wed, 1 Aug 2018 06:13:39 +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, 31 Jul 2018 23:13:35 -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 w716DaaL028752; Tue, 31 Jul 2018 23:13:36 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w716DaZG028751; Tue, 31 Jul 2018 23:13:36 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 02/16] qla2xxx: Fix N2N link re-connect Date: Tue, 31 Jul 2018 23:13:21 -0700 Message-ID: <20180801061335.28709-3-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180801061335.28709-1-himanshu.madhani@cavium.com> References: <20180801061335.28709-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)(136003)(346002)(376002)(396003)(2980300002)(438002)(189003)(199004)(106466001)(81166006)(8936002)(2906002)(5660300001)(81156014)(6666003)(47776003)(1076002)(80596001)(11346002)(69596002)(575784001)(486006)(305945005)(44832011)(86362001)(87636003)(54906003)(110136005)(16586007)(316002)(42186006)(106002)(186003)(26005)(14444005)(48376002)(50226002)(51416003)(446003)(76176011)(52396003)(8676002)(50466002)(356003)(336012)(126002)(2616005)(4326008)(476003)(72206003)(36756003)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR07MB1467;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;BY2NAM05FT043;1:CDoEtrwCNWO/gopWk6c+4NC5QtsshFHUZs/Hz1rJULDk6v4sE2eDDeLW1zGloqpyb9RBre70VfA1jxjzddnLVojmhKCiuYINvcAxiKB88bSs+FQ7ObOtjcT/TzXS9Ldb X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7f470efb-0507-41c0-2405-08d5f775ecef X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:DM2PR07MB1467; X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB1467;3:J/9EwJLBaZmlmr6k+X9iLa1mS//U4ZW3VecCMd3l7ceozk1CeOp+qd1b7NPnpCs1vggsUM49liWm2587M4zJV76elf/5xCwfbD1ESwNkvHS0y9yqhoasSpSJgvX6Q8hBH/l3O5AcrjhKO+AfKfYibqm8lJgmiDra7XV2MmCygq2uvuwe/bUjwG9WArTjmPkFa9iAwndxRIl4jLRoCEijft3abE+m3I/rsnckVVdjuSDa9u2SCAAKYKedO+zEb+nduIphFjwr9zN7cQkCmDUG7dIx5G2kD4OqFJFfjaNgDqgTWxEjsJyvUG/Q1sZMDmhFcsSOGrxaPq1jPhiDaHelel9EnK3Uhk+N7fKRCxMfKqM=;25:B/HbRaAhwFymReFdsKZ8Fw5iQYvVs4RkfBC3ix32PZjm7FHTzoc5g2ui99uiOZpaaT/OmE0JEHN65mdzAl9tPehiHe/fa0XC+sPYJwp/J2U9ZmpiOfPgtuaRGrpI2Bm32MzvGdW9PnhwzwHvqbLEqdkvzIWeIycxig2Sj8d/znu42C3TM1858Em0BUORR4F4t34XR3p1+xhIPMSTF+01rde0dXJr9GcSVcKM63BpHKH0tVujCZ6Wa8+/yFYGqQCt6RpuOJ4lzOioKiFd1mOc+oC2zviwFaE7QXPvyn8kYdXLbRVq9GLkwGfSLpq4N32sJUTEvbJPuOFxMiBxso2v9g== X-MS-TrafficTypeDiagnostic: DM2PR07MB1467: X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB1467;31:6TqbwhS95L7QQ2VWhby9c5fOT2DvokGIHI7sXc3TGu9rkBu5y56cJ6rObzowmgawtu+F44eidzJcnlnbvDzq2YSahJDdvxZeQDucf/Xj+noOikk0nJwomoPuWlEyPt3h94qFdFm1Z1c5UTHNXdKK3JmPMYsMGeYObBsNAmBHqRF0Zqz2PpqewOrb0fmTVD6gI73fhlproJ8LwMBHbl5pGMAL602Rcs4GXFDvdzMyP30=;20:WVHrtN0GfvP7bCfJZ6O6GrOCoOiGfDK7QY4Efk2qlG2cSOACIjw6iPHkEabZTJV7JV3qXjeD8ZIzv7jxhu6HlR2yZiMlEXBTId11l9bi+NugiNQUdtGElTbCdqk7sBP8bdexNliPm/4d7VcEnmsESSvsTe3RxEs+07ChxEXlgHv7C6HfexlsrvM8UyyaV5a/clfUo1oEfG0WCcgJPpUOxanqqK2E/vXTA4KFFULtPLP/GN9cotkYQlHhIJnOQvjEKmVmx3WIt1TE1i3G4dbQ7/gR2F+6TmHnQefZXOpNEQQQSG3YTln1+SLvK65wxMZj6WQ1JiPsFMOaDIfpYq8D9xsoMgcJqXe1mRJN+koA+yoqQbi/DG/COPAhTqqGSvcosyCahYQot681ldOULagGsnhZcmrBqVWC2erTFX2NvzChyhKQJH64R8m1NQh6QWR+5RcUochvzXCzDdsncc5Kzwzawmgb3YhY9nSXeEpIT/ecYN3U07xRVNLtHORhbYoD X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(21532816269658); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(93006095)(93004095)(3002001)(10201501046)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:DM2PR07MB1467;BCL:0;PCL:0;RULEID:;SRVR:DM2PR07MB1467; X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB1467;4:oEQEDWhBebj4sqHpiXU8+piqLqwacid1w2mDmU9bBwwTPRjT0SFDu8/PNN/qC3xhX8F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vfnEeFNAo9FA5bsmboP2RVH3lutK+XvNmLI64jdUva1yvzWUd+gYBxOgFf4SxNoa6iIUwENPNBureUYhhzCC0GMPNHXAm1j41afSJmOVmSrvxOE+wBAv9OiHDOkCjBI4xA/Ny3dw+wLr1muyZ1mdHwopjsIX0dAcvu9f0TBpQMIzIUSO6n1InojhzsCX0t4B2G2rSiNWmAP6GTKsLipGPcOiY38Nz3rjqCxaMOdaaqss9oXt8Ucb7g==;5:W5aW2Z3hzQt2j5MuSNF7edy1nSKtVqKUkOdU923SIZm6bB3ngQ5qi0Y2PKMwo2MGwjbZ4J5FkMyfXWF2dKqBquK7zGWGm6RhqFa3x1duZ8e6f9Y7Ddql5w3bzP0b++ERwOZJiT5Zr9mpLR7Zo3vVro3FxoP3iSVvS7uVLTFagNg=;7:3rJ6lsogBBW178sGF9GqxblrZI3qPcg6c9rMFu1AaMbDzaB+XrgvqAErh2MI9zz3S33FfIHeanYHiuDpLjGhaBDt11osyvZafY9612JyIP0xb/5m57gZjZumLpUirWwlNsSpaReoKAYQCCFdCU05DStZuxvDiHCuoEUnwude4yeiEClbuKWgJbpfUDTCooNgPvecAYnrSvLgKN/oYCHczTLV9hWFjJPbuElwuJX7X8nCe+Z1ruU5gpZ/MB/KRJhM SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 06:13:39.8935 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7f470efb-0507-41c0-2405-08d5f775ecef 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: DM2PR07MB1467 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 In case of N2N connect, when sg_regset for bus/device/host was causing driver and firmware state to go out of sync. This patch fixes this link instablity when reconnect is attempted after link flap. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 3 +- drivers/scsi/qla2xxx/qla_init.c | 226 +++++++++++++++++++++++++------------- drivers/scsi/qla2xxx/qla_iocb.c | 15 ++- drivers/scsi/qla2xxx/qla_isr.c | 3 +- drivers/scsi/qla2xxx/qla_mbx.c | 27 +---- drivers/scsi/qla2xxx/qla_os.c | 5 + drivers/scsi/qla2xxx/qla_target.c | 9 ++ 7 files changed, 180 insertions(+), 108 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 9442e18aef6f..ee4d1f4fdf95 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -377,6 +377,7 @@ struct srb_iocb { #define SRB_LOGIN_COND_PLOGI BIT_1 #define SRB_LOGIN_SKIP_PRLI BIT_2 #define SRB_LOGIN_NVME_PRLI BIT_3 +#define SRB_LOGIN_PRLI_ONLY BIT_4 uint16_t data[2]; u32 iop[2]; } logio; @@ -4236,7 +4237,7 @@ typedef struct scsi_qla_host { #define FCOE_CTX_RESET_NEEDED 18 /* Initiate FCoE context reset */ #define MPI_RESET_NEEDED 19 /* Initiate MPI FW reset */ #define ISP_QUIESCE_NEEDED 20 /* Driver need some quiescence */ -#define FREE_BIT 21 +#define N2N_LINK_RESET 21 #define PORT_UPDATE_NEEDED 22 #define FX00_RESET_RECOVERY 23 #define FX00_TARGET_SCAN 24 diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 1de78697dc0d..17c679102fcc 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -160,6 +160,22 @@ qla2x00_async_login_sp_done(void *ptr, int res) sp->free(sp); } +static inline bool +fcport_is_smaller(fc_port_t *fcport) +{ + if (wwn_to_u64(fcport->port_name) < + wwn_to_u64(fcport->vha->port_name)) + return true; + else + return false; +} + +static inline bool +fcport_is_bigger(fc_port_t *fcport) +{ + return !fcport_is_smaller(fcport); +} + int qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport, uint16_t *data) @@ -189,13 +205,18 @@ qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport, qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); sp->done = qla2x00_async_login_sp_done; - lio->u.logio.flags |= SRB_LOGIN_COND_PLOGI; + if (N2N_TOPO(fcport->vha->hw) && fcport_is_bigger(fcport)) { + lio->u.logio.flags |= SRB_LOGIN_PRLI_ONLY; + } else { + lio->u.logio.flags |= SRB_LOGIN_COND_PLOGI; - if (fcport->fc4f_nvme) - lio->u.logio.flags |= SRB_LOGIN_SKIP_PRLI; + if (fcport->fc4f_nvme) + lio->u.logio.flags |= SRB_LOGIN_SKIP_PRLI; + + if (data[1] & QLA_LOGIO_LOGIN_RETRIED) + lio->u.logio.flags |= SRB_LOGIN_RETRIED; + } - if (data[1] & QLA_LOGIO_LOGIN_RETRIED) - lio->u.logio.flags |= SRB_LOGIN_RETRIED; rval = qla2x00_start_sp(sp); if (rval != QLA_SUCCESS) { fcport->flags |= FCF_LOGIN_NEEDED; @@ -497,15 +518,18 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, for (i = 0; i < n; i++) { e = &vha->gnl.l[i]; wwn = wwn_to_u64(e->port_name); + id.b.domain = e->port_id[2]; + id.b.area = e->port_id[1]; + id.b.al_pa = e->port_id[0]; + id.b.rsvd_1 = 0; if (memcmp((u8 *)&wwn, fcport->port_name, WWN_SIZE)) continue; + if (IS_SW_RESV_ADDR(id)) + continue; + found = 1; - id.b.domain = e->port_id[2]; - id.b.area = e->port_id[1]; - id.b.al_pa = e->port_id[0]; - id.b.rsvd_1 = 0; loop_id = le16_to_cpu(e->nport_handle); loop_id = (loop_id & 0x7fff); @@ -518,14 +542,18 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa, loop_id, fcport->loop_id); - if ((id.b24 != fcport->d_id.b24) || - ((fcport->loop_id != FC_NO_LOOP_ID) && - (fcport->loop_id != loop_id))) { - ql_dbg(ql_dbg_disc, vha, 0x20e3, - "%s %d %8phC post del sess\n", - __func__, __LINE__, fcport->port_name); - qlt_schedule_sess_for_deletion(fcport); - return; + switch (fcport->disc_state) { + case DSC_DELETE_PEND: + case DSC_DELETED: + break; + default: + if ((id.b24 != fcport->d_id.b24) || + ((fcport->loop_id != FC_NO_LOOP_ID) && + (fcport->loop_id != loop_id))) { + qlt_schedule_sess_for_deletion(fcport); + return; + } + break; } fcport->loop_id = loop_id; @@ -544,66 +572,121 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, fcport->login_pause = 1; } - if (fcport->fc4f_nvme) + if (fcport->fc4f_nvme) current_login_state = e->current_login_state >> 4; else current_login_state = e->current_login_state & 0xf; - switch (current_login_state) { - case DSC_LS_PRLI_COMP: - ql_dbg(ql_dbg_disc, vha, 0x20e4, - "%s %d %8phC post gpdb\n", - __func__, __LINE__, fcport->port_name); + switch (vha->hw->current_topology) { + default: + switch (current_login_state) { + case DSC_LS_PRLI_COMP: + ql_dbg(ql_dbg_disc + ql_dbg_verbose, + vha, 0x20e4, "%s %d %8phC post gpdb\n", + __func__, __LINE__, fcport->port_name); - if ((e->prli_svc_param_word_3[0] & BIT_4) == 0) - fcport->port_type = FCT_INITIATOR; - else - fcport->port_type = FCT_TARGET; + if ((e->prli_svc_param_word_3[0] & BIT_4) == 0) + fcport->port_type = FCT_INITIATOR; + else + fcport->port_type = FCT_TARGET; + data[0] = data[1] = 0; + qla2x00_post_async_adisc_work(vha, fcport, + data); + break; + case DSC_LS_PORT_UNAVAIL: + default: + if (fcport->loop_id != FC_NO_LOOP_ID) + qla2x00_clear_loop_id(fcport); - data[0] = data[1] = 0; - qla2x00_post_async_adisc_work(vha, fcport, data); - break; - case DSC_LS_PORT_UNAVAIL: - default: - if (fcport->loop_id == FC_NO_LOOP_ID) { - qla2x00_find_new_loop_id(vha, fcport); + fcport->loop_id = loop_id; fcport->fw_login_state = DSC_LS_PORT_UNAVAIL; + qla24xx_fcport_handle_login(vha, fcport); + break; } - ql_dbg(ql_dbg_disc, vha, 0x20e5, - "%s %d %8phC\n", - __func__, __LINE__, fcport->port_name); - qla24xx_fcport_handle_login(vha, fcport); break; - } + case ISP_CFG_N: + switch (current_login_state) { + case DSC_LS_PRLI_COMP: + if ((e->prli_svc_param_word_3[0] & BIT_4) == 0) + fcport->port_type = FCT_INITIATOR; + else + fcport->port_type = FCT_TARGET; + + data[0] = data[1] = 0; + qla2x00_post_async_adisc_work(vha, fcport, + data); + break; + case DSC_LS_PLOGI_COMP: + if (fcport_is_bigger(fcport)) { + /* local adapter is smaller */ + if (fcport->loop_id != FC_NO_LOOP_ID) + qla2x00_clear_loop_id(fcport); + + fcport->loop_id = loop_id; + qla24xx_fcport_handle_login(vha, + fcport); + break; + } + /* drop through */ + default: + if (fcport_is_smaller(fcport)) { + /* local adapter is bigger */ + if (fcport->loop_id != FC_NO_LOOP_ID) + qla2x00_clear_loop_id(fcport); + + fcport->loop_id = loop_id; + qla24xx_fcport_handle_login(vha, + fcport); + } + break; + } + break; + } /* switch (ha->current_topology) */ } if (!found) { - /* fw has no record of this port */ - for (i = 0; i < n; i++) { - e = &vha->gnl.l[i]; - id.b.domain = e->port_id[0]; - id.b.area = e->port_id[1]; - id.b.al_pa = e->port_id[2]; - id.b.rsvd_1 = 0; - loop_id = le16_to_cpu(e->nport_handle); - - if (fcport->d_id.b24 == id.b24) { - conflict_fcport = - qla2x00_find_fcport_by_wwpn(vha, - e->port_name, 0); - ql_dbg(ql_dbg_disc, vha, 0x20e6, - "%s %d %8phC post del sess\n", - __func__, __LINE__, - conflict_fcport->port_name); - qlt_schedule_sess_for_deletion - (conflict_fcport); + switch (vha->hw->current_topology) { + case ISP_CFG_F: + case ISP_CFG_FL: + for (i = 0; i < n; i++) { + e = &vha->gnl.l[i]; + id.b.domain = e->port_id[0]; + id.b.area = e->port_id[1]; + id.b.al_pa = e->port_id[2]; + id.b.rsvd_1 = 0; + loop_id = le16_to_cpu(e->nport_handle); + + if (fcport->d_id.b24 == id.b24) { + conflict_fcport = + qla2x00_find_fcport_by_wwpn(vha, + e->port_name, 0); + ql_dbg(ql_dbg_disc + ql_dbg_verbose, + "%s %d %8phC post del sess\n", + __func__, __LINE__, + conflict_fcport->port_name); + qlt_schedule_sess_for_deletion + (conflict_fcport); + } + /* + * FW already picked this loop id for + * another fcport + */ + if (fcport->loop_id == loop_id) + fcport->loop_id = FC_NO_LOOP_ID; } - - /* FW already picked this loop id for another fcport */ - if (fcport->loop_id == loop_id) - fcport->loop_id = FC_NO_LOOP_ID; + qla24xx_fcport_handle_login(vha, fcport); + break; + case ISP_CFG_N: + /* + * FW handles the initial login for n2n. + * Do link reinit to trigger this auto login. + */ + set_bit(N2N_LINK_RESET, &vha->dpc_flags); + qla2xxx_wake_dpc(vha); + break; + default: + break; } - qla24xx_fcport_handle_login(vha, fcport); } } /* gnl_event */ @@ -4590,20 +4673,10 @@ qla2x00_configure_loop(scsi_qla_host_t *vha) } else if (ha->current_topology == ISP_CFG_N) { clear_bit(RSCN_UPDATE, &flags); - if (ha->flags.rida_fmt2) { - /* With Rida Format 2, the login is already triggered. - * We know who is on the other side of the wire. - * No need to login to do login to find out or drop into - * qla2x00_configure_local_loop(). - */ + if (qla_tgt_mode_enabled(vha)) { + /* allow the other side to start the login */ clear_bit(LOCAL_LOOP_UPDATE, &flags); set_bit(RELOGIN_NEEDED, &vha->dpc_flags); - } else { - if (qla_tgt_mode_enabled(vha)) { - /* allow the other side to start the login */ - clear_bit(LOCAL_LOOP_UPDATE, &flags); - set_bit(RELOGIN_NEEDED, &vha->dpc_flags); - } } } else if (ha->current_topology == ISP_CFG_NL) { clear_bit(RSCN_UPDATE, &flags); @@ -7929,8 +8002,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha) } /* enable RIDA Format2 */ - if (qla_tgt_mode_enabled(vha) || qla_dual_mode_enabled(vha)) - icb->firmware_options_3 |= BIT_0; + icb->firmware_options_3 |= BIT_0; if (IS_QLA27XX(ha)) { icb->firmware_options_3 |= BIT_8; diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index b349e9b94c08..e1ff2e27e59f 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -2240,12 +2240,15 @@ qla24xx_login_iocb(srb_t *sp, struct logio_entry_24xx *logio) struct srb_iocb *lio = &sp->u.iocb_cmd; logio->entry_type = LOGINOUT_PORT_IOCB_TYPE; - logio->control_flags = cpu_to_le16(LCF_COMMAND_PLOGI); - - if (lio->u.logio.flags & SRB_LOGIN_COND_PLOGI) - logio->control_flags |= cpu_to_le16(LCF_COND_PLOGI); - if (lio->u.logio.flags & SRB_LOGIN_SKIP_PRLI) - logio->control_flags |= cpu_to_le16(LCF_SKIP_PRLI); + if (lio->u.logio.flags & SRB_LOGIN_PRLI_ONLY) { + logio->control_flags = cpu_to_le16(LCF_COMMAND_PRLI); + } else { + logio->control_flags = cpu_to_le16(LCF_COMMAND_PLOGI); + if (lio->u.logio.flags & SRB_LOGIN_COND_PLOGI) + logio->control_flags |= cpu_to_le16(LCF_COND_PLOGI); + if (lio->u.logio.flags & SRB_LOGIN_SKIP_PRLI) + logio->control_flags |= cpu_to_le16(LCF_SKIP_PRLI); + } 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; diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 9fa5a2557f2c..e90fb17d2121 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -908,7 +908,8 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) if (!atomic_read(&vha->loop_down_timer)) atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); - qla2x00_mark_all_devices_lost(vha, 1); + if (!N2N_TOPO(ha)) + qla2x00_mark_all_devices_lost(vha, 1); } if (vha->vp_idx) { diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 7e875f575229..4e42ce057a37 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -2177,7 +2177,10 @@ qla2x00_lip_reset(scsi_qla_host_t *vha) mcp->out_mb = MBX_2|MBX_1|MBX_0; } else if (IS_FWI2_CAPABLE(vha->hw)) { mcp->mb[0] = MBC_LIP_FULL_LOGIN; - mcp->mb[1] = BIT_6; + if (N2N_TOPO(vha->hw)) + mcp->mb[1] = BIT_4; /* re-init */ + else + mcp->mb[1] = BIT_6; /* LIP */ mcp->mb[2] = 0; mcp->mb[3] = vha->hw->loop_reset_delay; mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0; @@ -3911,28 +3914,6 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, if (fcport) { fcport->plogi_nack_done_deadline = jiffies + HZ; fcport->scan_state = QLA_FCPORT_FOUND; - switch (fcport->disc_state) { - case DSC_DELETED: - ql_dbg(ql_dbg_disc, vha, 0x210d, - "%s %d %8phC login\n", - __func__, __LINE__, fcport->port_name); - qla24xx_fcport_handle_login(vha, fcport); - break; - case DSC_DELETE_PEND: - break; - default: - qlt_schedule_sess_for_deletion(fcport); - break; - } - } else { - id.b.al_pa = rptid_entry->u.f2.remote_nport_id[0]; - id.b.area = rptid_entry->u.f2.remote_nport_id[1]; - id.b.domain = rptid_entry->u.f2.remote_nport_id[2]; - qla24xx_post_newsess_work(vha, &id, - rptid_entry->u.f2.port_name, - rptid_entry->u.f2.node_name, - NULL, - FC4_TYPE_UNKNOWN); } } } diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index e881fce7477a..eb804e2feedf 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -6186,6 +6186,11 @@ qla2x00_do_dpc(void *data) if (!IS_QLAFX00(ha)) qla2x00_do_dpc_all_vps(base_vha); + if (test_and_clear_bit(N2N_LINK_RESET, + &base_vha->dpc_flags)) { + qla2x00_lip_reset(base_vha); + } + ha->dpc_active = 0; end_loop: set_current_state(TASK_INTERRUPTIBLE); diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 3de11153d1d3..9d10989ed027 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -805,6 +805,10 @@ qlt_plogi_ack_find_add(struct scsi_qla_host *vha, port_id_t *id, list_for_each_entry(pla, &vha->plogi_ack_list, list) { if (pla->id.b24 == id->b24) { + ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0x210d, + "%s %d %8phC Term INOT due to new INOT", + __func__, __LINE__, + pla->iocb.u.isp24.port_name); qlt_send_term_imm_notif(vha, &pla->iocb, 1); memcpy(&pla->iocb, iocb, sizeof(pla->iocb)); return pla; @@ -1073,6 +1077,7 @@ void qlt_free_session_done(struct work_struct *work) struct qlt_plogi_ack_t *con = sess->plogi_link[QLT_PLOGI_LINK_CONFLICT]; struct imm_ntfy_from_isp *iocb; + own = sess->plogi_link[QLT_PLOGI_LINK_SAME_WWN]; if (con) { iocb = &con->iocb; @@ -4716,6 +4721,10 @@ static int qlt_handle_login(struct scsi_qla_host *vha, pla = qlt_plogi_ack_find_add(vha, &port_id, iocb); if (!pla) { + ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0xffff, + "%s %d %8phC Term INOT due to mem alloc fail", + __func__, __LINE__, + iocb->u.isp24.port_name); qlt_send_term_imm_notif(vha, iocb, 1); goto out; } From patchwork Wed Aug 1 06:13:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10551739 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 8C8B01708 for ; Wed, 1 Aug 2018 06:13:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7BB572A5FC for ; Wed, 1 Aug 2018 06:13:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 64D9A2A64D; Wed, 1 Aug 2018 06:13:48 +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 90CCB2A5FC for ; Wed, 1 Aug 2018 06:13:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733162AbeHAH5o (ORCPT ); Wed, 1 Aug 2018 03:57:44 -0400 Received: from mail-eopbgr700084.outbound.protection.outlook.com ([40.107.70.84]:17952 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731897AbeHAH5o (ORCPT ); Wed, 1 Aug 2018 03:57:44 -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=wFGg92CmrHD0IcbpYst0vbqBBA+HRvspvH1SlqK6aCE=; b=oEAdjJscofULbnF1V6wKqAfd4VAKWXGWHN4sTbTS23Sv0SyG3RYKZEQHBn6ZYONccOyw5snUIjgdoP/Hfp7IpDeWK6nwC1fygXFUgYlphZGrcRp6I846e72L7KDmtm4/ej6NRAx+eJjHRKvxa0vwoohwf3Yo4eqog35iCbVgQqw= Received: from BYAPR07CA0027.namprd07.prod.outlook.com (2603:10b6:a02:bc::40) by CY1PR07MB1463.namprd07.prod.outlook.com (2a01:111:e400:50eb::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Wed, 1 Aug 2018 06:13:41 +0000 Received: from BY2NAM05FT043.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by BYAPR07CA0027.outlook.office365.com (2603:10b6:a02:bc::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.17 via Frontend Transport; Wed, 1 Aug 2018 06:13:41 +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 BY2NAM05FT043.mail.protection.outlook.com (10.152.100.180) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Wed, 1 Aug 2018 06:13:41 +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, 31 Jul 2018 23:13:35 -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 w716Da2a028756; Tue, 31 Jul 2018 23:13:36 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w716Da0i028755; Tue, 31 Jul 2018 23:13:36 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 03/16] qla2xxx: Fix login retry count Date: Tue, 31 Jul 2018 23:13:22 -0700 Message-ID: <20180801061335.28709-4-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180801061335.28709-1-himanshu.madhani@cavium.com> References: <20180801061335.28709-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)(376002)(346002)(136003)(39860400002)(396003)(2980300002)(438002)(189003)(199004)(6666003)(336012)(106002)(186003)(54906003)(110136005)(316002)(16586007)(42186006)(51416003)(5660300001)(446003)(11346002)(69596002)(2616005)(575784001)(126002)(476003)(106466001)(80596001)(486006)(36756003)(8936002)(8676002)(14444005)(44832011)(305945005)(26005)(86362001)(356003)(81156014)(81166006)(48376002)(50466002)(47776003)(1076002)(76176011)(2906002)(52396003)(87636003)(478600001)(72206003)(50226002)(4326008);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB1463;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;BY2NAM05FT043;1:bT5TNogDxt7vxd1kNhAXNO8gM2fUc1g9TVpKu8Da4yzBRiGeZ2xNCs6L42TlsSC983x3waXj3GsE6KRoSqCBqUh34P32p4RDG7xM7SWirxFv3CS3MtRfffGlE71YmvXl X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5b666265-f330-4e81-3175-08d5f775ed9d X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:CY1PR07MB1463; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB1463;3:upTZ5LAJt3X0KLuqkjBk4A6xH7ARy/D1PCgF5T4QHnVsm4k6gHqvWxiyHtueiXXyaXidlF+wLGiG1w+wKRUCXWJPJzFckckVlZ5FZgbZ+R7IgtNLTWgLJPPSiVgYU+BSgnawFfOt/k6eXx7HjDNGZruzq/3dB5rqqovbsimoNKlp6Wy2zymlAeBNnwBGAEYXbn8qb/EXtEsjNNm2MtHdZODlrKWd8Zw7NRgHmOGOCK1zdN60REU5ioboEgtxuMhE/ufJKJFVgCYJjXh4adhVlKbyK9cPOXFJRaslJuI7Cyz9TEBVpVZg493IiI2UwQ7K3I9bjtkfvuMVlDaUs1j4hQFWFYviRijaSrnLEunsSsw=;25:hPzpY9gp5QVZ0Ya8jEkrv8yeiO6qV1k+pP1cp/GvLPRillF6zeCg5a9qNXoMo9RqI4O/UDZbMM1E2m7PcgDQywUTfpUeTnmVBhj8M2KtY2BWIRMLEb8csetS+GiTMjeqdR5P0I39MukZECZfR3n5rcLFzirqpZsKJA5Agt6h9hfqmTkaBnRzu/8qPDW7ig+2zgB5kiajRKi6Bdr1mX75b984R4vFk4cWO99PJmeoOR7Ua1zvjeh2YywJXbo3Xr4IhNqd9OiBLMfG2hVC0Nf0GtS7YXuAY7neAoPeFq8pZxZU5S4M5u6zWr7A5cr0RAwzR6ttqxMLxn153sdJ15eqSQ== X-MS-TrafficTypeDiagnostic: CY1PR07MB1463: X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB1463;31:+XQ1DrWGuqIrrNr6/WwMi7IRvylVld7Yoc/Rlih7KdjxhitOXjTvEILOM1idbwnNGJEChtyVY3zVJnV3WKFJqjA0dMteXso3IIz38UjWW9QLRRohmDS9xoMzygRuWVXiVoeCwHF5sxQT+dYAcRKiOnn/Ouq+4qwVj8OWgTOZvmSiygQFbvauDjMSx8ilygYEZtxIEMCtjNvFUFnoAv/Qmcrl8S/I3KgP3HRD84vc8SE=;20:ifLA9c8qX5uFsd8Aw1ZMsaan6knYgGbAD8nJZXtNgpZGTpBbKEMBQ0zaPsE55HBo6GKKFFSFholvzA+qakc9PZMWGcuTOXNh1gDsd4HfArewsMuy70V5ayCAt1NHHiyZj15lE5rYCiLfs2C6jbB0DGMYwz2Kp3N+AaezWWy37OC8dhGFD7ekEJY7lZ3Hv2qlRzPtKb3TPonvWzUSGht0lpNmVEqYhxYS6/9+USmAJnT22GMPm3NnCmXyW7wAfRp2JEAcOv8A6Fx26jmOdo1iOLXMdfrt/hDdmvqf+DCp12J3onbxtJeBtber06MrE+wj4Wk7pVBfzY5amTSjN47ypl5wWGg9qQXxAuKbEd401FyTfxH6oyZs3lQOL6XT/sIOSNG9btEK8RTiwhQEEAWreyikViv4JoE44UuDBI107FMyqgxJXaqXhWJGx0SL4TLbc97FaeqsklEA3bYxFMPjUm59tr6R9eUSbg+ZmOYASsJg9mSPc3mxJjxuy6RIXqtN 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)(10201501046)(3231311)(944501410)(52105095)(93006095)(93004095)(3002001)(149027)(150027)(6041310)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:CY1PR07MB1463;BCL:0;PCL:0;RULEID:;SRVR:CY1PR07MB1463; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB1463;4:xtq8JHwsc0H/esTnYIVbzPlUvdn5kOBHKEdJ1ipXrn6LcFNvLwFbd7+h/gB8EazBLL8Vrx4H5tdz0HvmGBI4j8Ra9AtBxUvd9xzriaSki1PpIMHcpxBHLy1LYpBk9oI0PPhZBV0Ge8PRaY2PcDSQEemj0wW415gzbG29Hhvs9biD2at9+cKLUNPOLxeDkdKoSK+lkWnRN7UFLQCsBSmo/P7Q/bENGa5mk+Fp3zCFq73B8QZYPRRtwze0b4HYDEIg45utTg2tHxnenMgpOpBBEA== X-Forefront-PRVS: 0751474A44 X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB1463;23:MLrrr/uH4ItwQSFp5lIydnu9iQDdXUEFaUQ16MiFQFZKxT1bZU0Ia14wRupcBeYycj/GqotfD5N+V68IPWF+NhTcujPAVqM7GTbYBRsFTF7ZHG5qVHT7vRLm4f30KW1cK6Nr4MysSuYVaJ6FY1PADkdJ20nf+HtBJHMWSRae+r3uo2GDUInPDmiR8qj0qE2JdjmESeVE8dsmUtpuVwSL+9Rh/NfzfDpAC95Fn0ovmDm9UHuPT6czSYC/MMs0THewh8SutGLQ2kDNPod5eOAyxpNOGKq9cZ1/dPuhg+/AUJxd4gZplf1hoTCQBdXY2ST2ALy3FNwTnShPAeFCp00UH9YYXH3YFFSB44CNEuj8cxOuLSwnkhuSwynFKlkDHbpM/YNXRZv8BKTi19YEBsLl+I3p8hKCYvDzb2Qo3qY8raZ4r9+ayIlfXNXNw5CiI0hpjwoP6tAQBf3axL3La9cMojEoct2INh92XPmTmpUFf2xZcND+GEzpX1i50cPYuCLFHQkkAIbOrayEU1RCDmNrNkfrO5tzqgSOrfIHq56j4SB1tquUx8TmJRrrLN4Nd0Jj96KQRKLVeIwZN6JDfJhzqYpE6O1lQo2gratCaxD8ubNiF99Oyx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4sZcb/+7ccjZOGBhndu9bNo9QhGHk6tLQAH2BdHYkfA2JXJ083/GhNZ3pc38gHUbv5hKGWejsiZHf8S1h5DXiFqthu8abvIlNlN8oWAhfXvfNb2n7BJtMJVbrl9VTz+f0B9H7Nh9x8LMbR/yXYBHJcCfPDcONSQczrk6rUh2o7hjSmv4cByuxLWc4xl+9xFTgIC6vofGcV/1WaKsZ1cIrLOqr04kHZLSV1bueFPKQI+1SfbN2cX17x9FZsKk+AVGjPovvu7zg5QNzkPjsnJOlhuUabYK2usmYzBPJXKw8eC5szDmGg5ylbybxHvtD3CVEHr/23Z0VASDKH9XobXsAD4hSHox8xpyNabkZ7OdHWHwfjioIdKm3WfXNaQ==;5:SHl4KtkITYKnE9RNjiIjrC8xmf1Ru+vBiC58D3nGZUjyzg+WLFpMOl75l8vb8ODZvOuHBBOhPslw6lWNa4d2JDlDsdLQqYM4m61BoAc1RNTibGwSMzy7TkmRMo45isPfXpnSOQaiRku6nacJfTBrlQ8MwX6jnD08Q3C4a7AFkgU=;7:PnxPeXzlSdT9nZrmDK2S9hu0gfEZzF/G4l6vsXvrlRravowvX3Jhlx/mWt8XwidHnoDJYX0raX5QsAERDHN9QMQ/C/Fkj361U1+Tywk3fm79KgdpLHnHzRNENV+2QQA38W39GtHtT+eUgKke8fUx16QO1ET8p/AMgmzqbGJii972n+gXQjjjYiyPNbTQGN179hbAil2TF4BvzL0btxIJQxnQgIPP2cvos5weKQ1VwgRzMxxGlMRtkee17h2ZXsNL SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 06:13:41.0498 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b666265-f330-4e81-3175-08d5f775ed9d 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: CY1PR07MB1463 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 Login retry count was not properly decrementing, which lead to endless login retry. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_gs.c | 16 +++++++ drivers/scsi/qla2xxx/qla_init.c | 23 +++------- drivers/scsi/qla2xxx/qla_mbx.c | 1 + drivers/scsi/qla2xxx/qla_os.c | 90 ++++++++++++++++++++------------------- drivers/scsi/qla2xxx/qla_target.c | 3 +- 5 files changed, 70 insertions(+), 63 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 4bc2b66b299f..5139a3577bb3 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -3475,6 +3475,14 @@ void qla24xx_handle_gpnid_event(scsi_qla_host_t *vha, struct event_arg *ea) fcport->rscn_gen++; fcport->scan_state = QLA_FCPORT_FOUND; fcport->flags |= FCF_FABRIC_DEVICE; + if (fcport->login_retry == 0) { + fcport->login_retry = + vha->hw->login_retry_count; + ql_dbg(ql_dbg_disc, vha, 0xffff, + "Port login retry %8phN, lid 0x%04x cnt=%d.\n", + fcport->port_name, fcport->loop_id, + fcport->login_retry); + } switch (fcport->disc_state) { case DSC_LOGIN_COMPLETE: /* recheck session is still intact. */ @@ -3967,6 +3975,14 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp) } else { if (fcport->rscn_rcvd || fcport->disc_state != DSC_LOGIN_COMPLETE) { + if (fcport->login_retry == 0) { + fcport->login_retry = + vha->hw->login_retry_count; + ql_dbg(ql_dbg_disc, vha, 0x20a3, + "Port login retry %8phN, lid 0x%04x retry cnt=%d.\n", + fcport->port_name, fcport->loop_id, + fcport->login_retry); + } fcport->rscn_rcvd = 0; qla24xx_fcport_handle_login(vha, fcport); } diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 17c679102fcc..848ffd602e0b 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -213,8 +213,6 @@ qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport, if (fcport->fc4f_nvme) lio->u.logio.flags |= SRB_LOGIN_SKIP_PRLI; - if (data[1] & QLA_LOGIO_LOGIN_RETRIED) - lio->u.logio.flags |= SRB_LOGIN_RETRIED; } rval = qla2x00_start_sp(sp); @@ -485,7 +483,6 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, if (ea->rc) { /* rval */ if (fcport->login_retry == 0) { - fcport->login_retry = vha->hw->login_retry_count; ql_dbg(ql_dbg_disc, vha, 0x20de, "GNL failed Port login retry %8phN, retry cnt=%d.\n", fcport->port_name, fcport->login_retry); @@ -1255,11 +1252,10 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) return 0; } - if (fcport->login_retry > 0) - fcport->login_retry--; switch (fcport->disc_state) { case DSC_DELETED: + fcport->login_retry--; wwn = wwn_to_u64(fcport->node_name); if (wwn == 0) { ql_dbg(ql_dbg_disc, vha, 0xffff, @@ -1272,6 +1268,7 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) __func__, __LINE__, fcport->port_name); qla24xx_post_gnl_work(vha, fcport); } else { + fcport->login_retry--; qla_chk_n2n_b4_login(vha, fcport); } break; @@ -1288,6 +1285,7 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) break; case DSC_LOGIN_FAILED: + fcport->login_retry--; ql_dbg(ql_dbg_disc, vha, 0x20d0, "%s %d %8phC post gidpn\n", __func__, __LINE__, fcport->port_name); @@ -1302,6 +1300,7 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) ql_dbg(ql_dbg_disc, vha, 0x20d1, "%s %d %8phC post adisc\n", __func__, __LINE__, fcport->port_name); + fcport->login_retry--; data[0] = data[1] = 0; qla2x00_post_async_adisc_work(vha, fcport, data); break; @@ -1385,17 +1384,6 @@ void qla24xx_handle_relogin_event(scsi_qla_host_t *vha, } } - if (fcport->flags & FCF_ASYNC_SENT) { - fcport->login_retry++; - set_bit(RELOGIN_NEEDED, &vha->dpc_flags); - return; - } - - if (fcport->disc_state == DSC_DELETE_PEND) { - fcport->login_retry++; - return; - } - if (fcport->last_rscn_gen != fcport->rscn_gen) { ql_dbg(ql_dbg_disc, vha, 0x20e9, "%s %d %8phC post gidpn\n", __func__, __LINE__, fcport->port_name); @@ -1881,7 +1869,6 @@ void qla2x00_async_logout_done(struct scsi_qla_host *vha, fc_port_t *fcport, uint16_t *data) { - qla2x00_mark_device_lost(vha, fcport, 1, 0); qlt_logo_completion_handler(fcport, data[0]); fcport->login_gen++; fcport->flags &= ~FCF_ASYNC_ACTIVE; @@ -5075,11 +5062,11 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) if (IS_QLAFX00(vha->hw)) { qla2x00_set_fcport_state(fcport, FCS_ONLINE); } else { - fcport->login_retry = 0; fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT); fcport->disc_state = DSC_LOGIN_COMPLETE; fcport->deleted = 0; fcport->logout_on_delete = 1; + fcport->login_retry = vha->hw->login_retry_count; qla2x00_set_fcport_state(fcport, FCS_ONLINE); } diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 4e42ce057a37..17537f0b3b54 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -3912,6 +3912,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, rptid_entry->u.f2.port_name, 1); if (fcport) { + fcport->login_retry = vha->hw->login_retry_count; fcport->plogi_nack_done_deadline = jiffies + HZ; fcport->scan_state = QLA_FCPORT_FOUND; } diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index eb804e2feedf..e218d68de532 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -3838,14 +3838,6 @@ void qla2x00_mark_device_lost(scsi_qla_host_t *vha, fc_port_t *fcport, return; set_bit(RELOGIN_NEEDED, &vha->dpc_flags); - - if (fcport->login_retry == 0) { - fcport->login_retry = vha->hw->login_retry_count; - - ql_dbg(ql_dbg_disc, vha, 0x20a3, - "Port login retry %8phN, lid 0x%04x retry cnt=%d.\n", - fcport->port_name, fcport->loop_id, fcport->login_retry); - } } /* @@ -5098,7 +5090,7 @@ int qla24xx_post_relogin_work(struct scsi_qla_host *vha) void qla2x00_relogin(struct scsi_qla_host *vha) { fc_port_t *fcport; - int status; + int status, relogin_needed = 0; struct event_arg ea; list_for_each_entry(fcport, &vha->vp_fcports, list) { @@ -5107,47 +5099,59 @@ void qla2x00_relogin(struct scsi_qla_host *vha) * to it if we haven't run out of retries. */ if (atomic_read(&fcport->state) != FCS_ONLINE && - fcport->login_retry && - !(fcport->flags & (FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE))) { - if (vha->hw->current_topology != ISP_CFG_NL) { - ql_dbg(ql_dbg_disc, fcport->vha, 0x2108, - "%s %8phC DS %d LS %d\n", __func__, - fcport->port_name, fcport->disc_state, - fcport->fw_login_state); - memset(&ea, 0, sizeof(ea)); - ea.event = FCME_RELOGIN; - ea.fcport = fcport; - qla2x00_fcport_event_handler(vha, &ea); - } else if (vha->hw->current_topology == ISP_CFG_NL) { - fcport->login_retry--; - status = qla2x00_local_device_login(vha, - fcport); - if (status == QLA_SUCCESS) { - fcport->old_loop_id = fcport->loop_id; - ql_dbg(ql_dbg_disc, vha, 0x2003, - "Port login OK: logged in ID 0x%x.\n", - fcport->loop_id); - qla2x00_update_fcport(vha, fcport); - } else if (status == 1) { - set_bit(RELOGIN_NEEDED, &vha->dpc_flags); - /* retry the login again */ - ql_dbg(ql_dbg_disc, vha, 0x2007, - "Retrying %d login again loop_id 0x%x.\n", - fcport->login_retry, - fcport->loop_id); - } else { - fcport->login_retry = 0; - } + fcport->login_retry) { + if (fcport->scan_state != QLA_FCPORT_FOUND || + fcport->disc_state == DSC_LOGIN_COMPLETE) + continue; - if (fcport->login_retry == 0 && - status != QLA_SUCCESS) - qla2x00_clear_loop_id(fcport); + if (fcport->flags & (FCF_ASYNC_SENT|FCF_ASYNC_ACTIVE) || + fcport->disc_state == DSC_DELETE_PEND) { + relogin_needed = 1; + } else { + if (vha->hw->current_topology != ISP_CFG_NL) { + memset(&ea, 0, sizeof(ea)); + ea.event = FCME_RELOGIN; + ea.fcport = fcport; + qla2x00_fcport_event_handler(vha, &ea); + } else if (vha->hw->current_topology == + ISP_CFG_NL) { + fcport->login_retry--; + status = + qla2x00_local_device_login(vha, + fcport); + if (status == QLA_SUCCESS) { + fcport->old_loop_id = + fcport->loop_id; + ql_dbg(ql_dbg_disc, vha, 0x2003, + "Port login OK: logged in ID 0x%x.\n", + fcport->loop_id); + qla2x00_update_fcport + (vha, fcport); + } else if (status == 1) { + set_bit(RELOGIN_NEEDED, + &vha->dpc_flags); + /* retry the login again */ + ql_dbg(ql_dbg_disc, vha, 0x2007, + "Retrying %d login again loop_id 0x%x.\n", + fcport->login_retry, + fcport->loop_id); + } else { + fcport->login_retry = 0; + } + + if (fcport->login_retry == 0 && + status != QLA_SUCCESS) + qla2x00_clear_loop_id(fcport); + } } } if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) break; } + if (relogin_needed) + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + ql_dbg(ql_dbg_disc, vha, 0x400e, "Relogin end.\n"); } diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 9d10989ed027..4f9c315813df 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -1057,7 +1057,6 @@ void qlt_free_session_done(struct work_struct *work) sess->disc_state = DSC_DELETED; sess->fw_login_state = DSC_LS_PORT_UNAVAIL; sess->deleted = QLA_SESS_DELETED; - sess->login_retry = vha->hw->login_retry_count; if (sess->login_succ && !IS_SW_RESV_ADDR(sess->d_id)) { vha->fcport_count--; @@ -1161,7 +1160,7 @@ void qlt_unreg_sess(struct fc_port *sess) if (sess->se_sess) vha->hw->tgt.tgt_ops->clear_nacl_from_fcport_map(sess); - qla2x00_mark_device_lost(vha, sess, 1, 1); + qla2x00_mark_device_lost(vha, sess, 0, 0); sess->deleted = QLA_SESS_DELETION_IN_PROGRESS; sess->disc_state = DSC_DELETE_PEND; From patchwork Wed Aug 1 06:13:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10551737 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 A5B9B96FA for ; Wed, 1 Aug 2018 06:13:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95E5E2A64D for ; Wed, 1 Aug 2018 06:13:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7EC9E2A645; Wed, 1 Aug 2018 06:13:47 +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 F410F2A645 for ; Wed, 1 Aug 2018 06:13:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733156AbeHAH5n (ORCPT ); Wed, 1 Aug 2018 03:57:43 -0400 Received: from mail-eopbgr700084.outbound.protection.outlook.com ([40.107.70.84]:17952 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733087AbeHAH5n (ORCPT ); Wed, 1 Aug 2018 03:57:43 -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=ZypwnS/KIZRjJhDD4wMtKbx30p+lCstCBOuLlSjO+rw=; b=fGBt+sbv4HMOvaTatFCywNzr6llngEIU8QFNyNRHnSJydjw6BAwc9P9vR1Twy/h7weJgK23CVWWlXixE4r+NuBYCF8bW0GJO9AXx878O8JQmWJ6doOl55NUhM97CQE0AuazRlzLt3qW25Mx1WlflrUiNFGBGPAsIXUooDF5B5Vc= Received: from BYAPR07CA0027.namprd07.prod.outlook.com (2603:10b6:a02:bc::40) by CY1PR07MB1463.namprd07.prod.outlook.com (2a01:111:e400:50eb::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Wed, 1 Aug 2018 06:13:42 +0000 Received: from BY2NAM05FT043.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by BYAPR07CA0027.outlook.office365.com (2603:10b6:a02:bc::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.17 via Frontend Transport; Wed, 1 Aug 2018 06:13:42 +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 BY2NAM05FT043.mail.protection.outlook.com (10.152.100.180) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Wed, 1 Aug 2018 06:13:42 +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, 31 Jul 2018 23:13:35 -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 w716DbxE028760; Tue, 31 Jul 2018 23:13:37 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w716Db72028759; Tue, 31 Jul 2018 23:13:37 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 04/16] qla2xxx: Add longer window for Chip reset Date: Tue, 31 Jul 2018 23:13:23 -0700 Message-ID: <20180801061335.28709-5-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180801061335.28709-1-himanshu.madhani@cavium.com> References: <20180801061335.28709-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)(376002)(346002)(136003)(39860400002)(396003)(2980300002)(438002)(189003)(199004)(6666003)(336012)(106002)(186003)(54906003)(110136005)(316002)(16586007)(42186006)(51416003)(5660300001)(446003)(11346002)(69596002)(2616005)(575784001)(126002)(476003)(106466001)(80596001)(486006)(36756003)(8936002)(8676002)(14444005)(44832011)(305945005)(26005)(86362001)(356003)(81156014)(81166006)(48376002)(50466002)(47776003)(1076002)(76176011)(2906002)(52396003)(87636003)(478600001)(72206003)(50226002)(4326008)(148743002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB1463;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;BY2NAM05FT043;1:tUua0vcAz8fa2oylntdneOXxowkE5h1xy+ku7kZCtJGom0ypsGbknvDBSS3zmWC5VUJCaGrWwHf24c0M1WZBd5isLJQkULGHMqrtHHJDw9wxezSP2F5viE41jJsTAqXx X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 033f9006-4b57-46c5-eec3-08d5f775ee5b X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:CY1PR07MB1463; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB1463;3:w4rqNZ0IWEjv+7DQBhrn/gKkDbpH/NWsdFlV19MXwvkpZvnEaenDJ/BZgjVCVThsW7/qS+iRvJhPJgoK6JeMDK5GW6siie+RKHw4gpflPvx9dQnOyRIPAEdVi74U2dRhKfvklBd59egwAanGGZxQEUGSxSMolYVcZCS+bACU8cAaNTUCU2EXAha+bLVMk9YYQ4KHK+XB7va9xBVQMeHD+E7oEf8E5HCLDkcvCFR546jwGJpz96QQlGptzo3aFLvJtuwS1acL6JxgjeYyvOxdDj4KEOf+8LvsC5o2QDv0kU1nPJnasj33bj+lmlFBVaqLw34e1S6/NhIZickyOoLaPk+1ftTlgdbCl146UKw/LVU=;25:/AgBjZB3JlOc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84lotWc17TKMi26ftcYzhyJURWDarNgGzAazkfmMbXwJo8jG6Ql17riN+ 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)(10201501046)(3231311)(944501410)(52105095)(93006095)(93004095)(3002001)(149027)(150027)(6041310)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:CY1PR07MB1463;BCL:0;PCL:0;RULEID:;SRVR:CY1PR07MB1463; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB1463;4:uGZ3Fb489fLCEtOMUvhlpaaER13gC04+1CS0OLv0ikMuJd/cKOJMWqlj9QIXFOVq85ySAnmORa0CPqfdKUFH9ZDWE0YTKn3526rHUuGh4Zh4WXvvCUiTzpKYNmAabnLicGTK2kp18Z4l62J5SxN4ThW0xPx76Yifnjzrn4/eCWBkdfxpC00AYTIG+5EiSSITX9Vy22+bJnytOVmaDk0mbUYs3Ex3iYqX9zchot+U2m4ImXzUJ+wWhOgXxu2PNxXv2rK/VvbfEejmIK/52vXCcg== X-Forefront-PRVS: 0751474A44 X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB1463;23:mXxUjNawW2zwTXoskDdfPgYgUH1/gLaCwM2nWt/iVNe6aoact67Vy/WZddE/FKPiO0bNXwo1ybD7+oAofs8YNh48gMmx6MDNioJCt0UY7KPso2I7j9FXTQ3ZDehwuhtMJkcL46zXicyjhLEg/2p3DfgC6Kh6P5deqpXGrGouGNbZibmpJEx9lq4qn0balgfPtJULnYuHGJgAefXFVwKweZIcoF+eOljzLVt4KsCuGG7JR34+NDdATyib+9P8ruq0zMQArDYSOKPN/C1IO1ePoHU9CuJzdqVuOqxHUVvMl/68Oi1eB02yQA9s4RJ+MJ0Z47TFsXwZP185x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kB3nm39fXZPjoqI+WbvMVswnhsnjOU+Or8p2fZypKUBaPua SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 06:13:42.2998 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 033f9006-4b57-46c5-eec3-08d5f775ee5b 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: CY1PR07MB1463 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 The qla2x00_reset_active only cover the window of turning the chip off, add check to cover Chip on. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_dbg.c | 3 +++ drivers/scsi/qla2xxx/qla_tmpl.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index 5fd44c50bbac..c7533fa7f46e 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c @@ -1130,6 +1130,7 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ha->fw_dump); goto qla24xx_fw_dump_failed; } + QLA_FW_STOPPED(ha); fw = &ha->fw_dump->isp.isp24; qla2xxx_prep_dump(ha, ha->fw_dump); @@ -1384,6 +1385,7 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ha->fw_dump); goto qla25xx_fw_dump_failed; } + QLA_FW_STOPPED(ha); fw = &ha->fw_dump->isp.isp25; qla2xxx_prep_dump(ha, ha->fw_dump); ha->fw_dump->version = htonl(2); @@ -2036,6 +2038,7 @@ qla83xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) "request...\n", ha->fw_dump); goto qla83xx_fw_dump_failed; } + QLA_FW_STOPPED(ha); fw = &ha->fw_dump->isp.isp83; qla2xxx_prep_dump(ha, ha->fw_dump); diff --git a/drivers/scsi/qla2xxx/qla_tmpl.c b/drivers/scsi/qla2xxx/qla_tmpl.c index 731ca0d8520a..b170eb54aab5 100644 --- a/drivers/scsi/qla2xxx/qla_tmpl.c +++ b/drivers/scsi/qla2xxx/qla_tmpl.c @@ -1028,8 +1028,10 @@ qla27xx_fwdump(scsi_qla_host_t *vha, int hardware_locked) ql_log(ql_log_warn, vha, 0xd300, "Firmware has been previously dumped (%p)," " -- ignoring request\n", vha->hw->fw_dump); - else + else { + QLA_FW_STOPPED(vha->hw); qla27xx_execute_fwdt_template(vha); + } #ifndef __CHECKER__ if (!hardware_locked) From patchwork Wed Aug 1 06:13:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10551741 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 650D81822 for ; Wed, 1 Aug 2018 06:13:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 559B22A662 for ; Wed, 1 Aug 2018 06:13:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A1DA2A677; Wed, 1 Aug 2018 06:13:49 +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 A7B7A2A5FC for ; Wed, 1 Aug 2018 06:13:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733165AbeHAH5p (ORCPT ); Wed, 1 Aug 2018 03:57:45 -0400 Received: from mail-cys01nam02on0040.outbound.protection.outlook.com ([104.47.37.40]:25600 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733143AbeHAH5o (ORCPT ); Wed, 1 Aug 2018 03:57:44 -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=7QEHONVogTFjNNhDELMUjRj0QSQSBj/dbCjirnDR8AQ=; b=iXOVS52Ym8rek2xLWv/U1/mIsnL0HfJ2FxLrtg3nqygnMnwQF9mJm2Ek9QPPVm2VZ7qOTkPYOl5kRCP5HdECp/DvWFh322AeHu0+6NmqOocc0NGCKzRTR1Pn/KQNhksDwvpL28RQn0fe3UKNYVlECVorn0NJVaM1Zpnfz06SJAs= Received: from BYAPR07CA0027.namprd07.prod.outlook.com (2603:10b6:a02:bc::40) by DM2PR07MB1467.namprd07.prod.outlook.com (2a01:111:e400:50c3::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.20; Wed, 1 Aug 2018 06:13:43 +0000 Received: from BY2NAM05FT043.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by BYAPR07CA0027.outlook.office365.com (2603:10b6:a02:bc::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.17 via Frontend Transport; Wed, 1 Aug 2018 06:13:43 +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 BY2NAM05FT043.mail.protection.outlook.com (10.152.100.180) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Wed, 1 Aug 2018 06:13:43 +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, 31 Jul 2018 23:13:36 -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 w716DboR028764; Tue, 31 Jul 2018 23:13:37 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w716Dbbq028763; Tue, 31 Jul 2018 23:13:37 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 05/16] qla2xxx: Prevent SysFS access when chip is down Date: Tue, 31 Jul 2018 23:13:24 -0700 Message-ID: <20180801061335.28709-6-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180801061335.28709-1-himanshu.madhani@cavium.com> References: <20180801061335.28709-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)(136003)(346002)(376002)(396003)(2980300002)(438002)(189003)(199004)(106466001)(81166006)(8936002)(2906002)(5660300001)(81156014)(6666003)(47776003)(1076002)(80596001)(11346002)(69596002)(575784001)(486006)(305945005)(44832011)(86362001)(87636003)(54906003)(110136005)(16586007)(316002)(42186006)(106002)(186003)(26005)(14444005)(48376002)(50226002)(51416003)(446003)(76176011)(52396003)(8676002)(50466002)(356003)(336012)(126002)(2616005)(4326008)(476003)(72206003)(36756003)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR07MB1467;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;BY2NAM05FT043;1:AEg6cFpKf9eyu8aNM6pgjEPrEjnL9c674xNpsLtF2um4FRXQeXnV01L9hCg134/sBzvCpbF04XWV4RIn+BDCprbzLkNOu9buyUHV1aneJGrVi8uRM0Qeohx59dqURQOF X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0e8a8b89-b560-406a-7d4e-08d5f775eece X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:DM2PR07MB1467; X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB1467;3:wTTa+0HJeFk+f91+ofi7S4dxatcCJ/YJ+y2hLVmnNLAAoM/LVDZ9JSIuV13d1gNxPnlxDmCURFBIq/+SEMabcwKHozUbxH1YbCMlbmyy0H5UioCxSSelYNg8rp7wDd+rrJK9ZwN9QizSovQU2ZhGm9ch6RTkm3ilqJhGmQdOL76lfRGLEIbSzV4QW8EnWonrBkSRfTtW2Jgds7PT/JrZ0E6S3bKf7HaW7Kjd/G00K62Wusd5Pl1py+7b1a+wnVVUNmuJpYnIS1k5fEZ6stqK90XFCl6MwkgX/v1rF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vluWz/VmbbhCA08gzt1hXVWG53ahzPs5mDatILOTMYUTGXZREHF0+sgeiLqRUkr2x/fhh7Fd8mod3RgSo1AyHJqMAL4mVoRNRs6cjAsni4m6OpU0vPzCf01P/V6T3KEAcluwWGQY+KZPCqg4md4 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)(93006095)(93004095)(3002001)(10201501046)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:DM2PR07MB1467;BCL:0;PCL:0;RULEID:;SRVR:DM2PR07MB1467; X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB1467;4:Vk4dnJDGOmpjUvdRn/1N7KYMNqbBafC89MDQra8UWZ6Pmy7+JG79GbwVVv8ATVI+T/C38cF2f1cY+24wW3LrdZ9MHRmOLNgTRfN7LhuGjq9CFAQwQ260/ebsDmdv2iY4iRsGG4rgJ3pGRHqanqki2rBQGfAkBJUHoK29kTBuEnIuSkbvrZYCjh1AasJGnDS/yjzFStZFRq0W0x12dACG2HyRpLnyzcg50iYLSPCilShJ4141bQBVx00NBnnoy7qZv1EC7tPHD+Nr0zHBW/0Q1g== X-Forefront-PRVS: 0751474A44 X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB1467;23:eaC+AIT+mg2aZjUoy5JpkaeQF6q+8bBRdk3CvRNcVzxqkeCg64jbN0ZZ1UPdS2hW7UZFf7KZpm8dvo3+YwafwhH4b6HRF8dkTcHPM2eCjERKq9ZYjv+ywlqNdDTuIfVRYfeBTmmAhMeg+RjfSU8AkT5B8IAGOWnvcEJs3/VErmgNA257xwpfRGJunJ0gaNcY1Aj/8WmogNWTY8mLq+gfoxw+h+8xzmz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SzS7ANsxFogzgbux7O12A4wcSuzv7Ju328CH/AR4voxCQGZkRMOEU+8XmgdapooDWjao42egCw9kteIh4NzUx/B1CzB12ZzHRpf3cZXH0JUaW8IXkYSSZk1RVSo4nHyjI5r6eV3woEcWKfP63RD1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 06:13:43.0506 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e8a8b89-b560-406a-7d4e-08d5f775eece 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: DM2PR07MB1467 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 Prevent user from sending commands through SysFS while FW is not running or reset is in progress. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_attr.c | 33 +++++++++++++++++++++++++++------ drivers/scsi/qla2xxx/qla_init.c | 2 +- drivers/scsi/qla2xxx/qla_inline.h | 6 ++++++ 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 89a4999fa631..cc04caf83bd3 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -518,6 +518,9 @@ qla2x00_sysfs_write_vpd(struct file *filp, struct kobject *kobj, if (unlikely(pci_channel_offline(ha->pdev))) return 0; + if (qla2x00_chip_is_down(vha)) + return 0; + if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size || !ha->isp_ops->write_nvram) return 0; @@ -570,7 +573,7 @@ qla2x00_sysfs_read_sfp(struct file *filp, struct kobject *kobj, if (!capable(CAP_SYS_ADMIN) || off != 0 || count < SFP_DEV_SIZE) return 0; - if (qla2x00_reset_active(vha)) + if (qla2x00_chip_is_down(vha)) return 0; rval = qla2x00_read_sfp_dev(vha, buf, count); @@ -733,6 +736,15 @@ qla2x00_issue_logo(struct file *filp, struct kobject *kobj, int type; port_id_t did; + if (!capable(CAP_SYS_ADMIN)) + return 0; + + if (unlikely(pci_channel_offline(vha->hw->pdev))) + return 0; + + if (qla2x00_chip_is_down(vha)) + return 0; + type = simple_strtol(buf, NULL, 10); did.b.domain = (type & 0x00ff0000) >> 16; @@ -771,6 +783,12 @@ qla2x00_sysfs_read_xgmac_stats(struct file *filp, struct kobject *kobj, if (!capable(CAP_SYS_ADMIN) || off != 0 || count > XGMAC_DATA_SIZE) return 0; + if (unlikely(pci_channel_offline(ha->pdev))) + return 0; + + if (qla2x00_chip_is_down(vha)) + return 0; + if (ha->xgmac_data) goto do_read; @@ -825,6 +843,9 @@ qla2x00_sysfs_read_dcbx_tlv(struct file *filp, struct kobject *kobj, if (ha->dcbx_tlv) goto do_read; + if (qla2x00_chip_is_down(vha)) + return 0; + ha->dcbx_tlv = dma_alloc_coherent(&ha->pdev->dev, DCBX_TLV_DATA_SIZE, &ha->dcbx_tlv_dma, GFP_KERNEL); if (!ha->dcbx_tlv) { @@ -1036,7 +1057,7 @@ qla2x00_link_state_show(struct device *dev, struct device_attribute *attr, vha->device_flags & DFLG_NO_CABLE) len = scnprintf(buf, PAGE_SIZE, "Link Down\n"); else if (atomic_read(&vha->loop_state) != LOOP_READY || - qla2x00_reset_active(vha)) + qla2x00_chip_is_down(vha)) len = scnprintf(buf, PAGE_SIZE, "Unknown Link State\n"); else { len = scnprintf(buf, PAGE_SIZE, "Link Up - "); @@ -1163,7 +1184,7 @@ qla2x00_beacon_store(struct device *dev, struct device_attribute *attr, if (IS_QLA2100(ha) || IS_QLA2200(ha)) return -EPERM; - if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags)) { + if (qla2x00_chip_is_down(vha)) { ql_log(ql_log_warn, vha, 0x707a, "Abort ISP active -- ignoring beacon request.\n"); return -EBUSY; @@ -1350,7 +1371,7 @@ qla2x00_thermal_temp_show(struct device *dev, scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); uint16_t temp = 0; - if (qla2x00_reset_active(vha)) { + if (qla2x00_chip_is_down(vha)) { ql_log(ql_log_warn, vha, 0x70dc, "ISP reset active.\n"); goto done; } @@ -1381,7 +1402,7 @@ qla2x00_fw_state_show(struct device *dev, struct device_attribute *attr, return scnprintf(buf, PAGE_SIZE, "0x%x\n", pstate); } - if (qla2x00_reset_active(vha)) + if (qla2x00_chip_is_down(vha)) ql_log(ql_log_warn, vha, 0x707c, "ISP reset active.\n"); else if (!vha->hw->flags.eeh_busy) @@ -1840,7 +1861,7 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost) if (unlikely(pci_channel_offline(ha->pdev))) goto done; - if (qla2x00_reset_active(vha)) + if (qla2x00_chip_is_down(vha)) goto done; stats = dma_zalloc_coherent(&ha->pdev->dev, sizeof(*stats), diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 848ffd602e0b..79738294b069 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -7016,7 +7016,7 @@ uint8_t qla27xx_find_valid_image(struct scsi_qla_host *vha) ha->active_image = QLA27XX_SECONDARY_IMAGE; } - ql_dbg(ql_dbg_init, vha, 0x018f, "%s image\n", + ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x018f, "%s image\n", ha->active_image == 0 ? "default bootld and fw" : ha->active_image == 1 ? "primary" : ha->active_image == 2 ? "secondary" : diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h index bcbdf28bd7b9..acf6511e8ef7 100644 --- a/drivers/scsi/qla2xxx/qla_inline.h +++ b/drivers/scsi/qla2xxx/qla_inline.h @@ -202,6 +202,12 @@ qla2x00_reset_active(scsi_qla_host_t *vha) test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags); } +static inline int +qla2x00_chip_is_down(scsi_qla_host_t *vha) +{ + return (qla2x00_reset_active(vha) || !vha->hw->flags.fw_started); +} + static inline srb_t * qla2xxx_get_qpair_sp(struct qla_qpair *qpair, fc_port_t *fcport, gfp_t flag) { From patchwork Wed Aug 1 06:13:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10551743 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 7ED1A96FA for ; Wed, 1 Aug 2018 06:13:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F1782A64D for ; Wed, 1 Aug 2018 06:13:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 620982A645; Wed, 1 Aug 2018 06:13:49 +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 02C142A645 for ; Wed, 1 Aug 2018 06:13:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733168AbeHAH5p (ORCPT ); Wed, 1 Aug 2018 03:57:45 -0400 Received: from mail-by2nam01on0074.outbound.protection.outlook.com ([104.47.34.74]:62880 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733087AbeHAH5o (ORCPT ); Wed, 1 Aug 2018 03:57:44 -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=vRRRrV6nQQ+T0x5iGi8ui+tamwxP6yomvdPrq7XDmbs=; b=kWeJNHbkW7iBysk/UWoN/4KD12JGaMYwnPGNSvX0k0WIKNRz40Rrw/wLARTqD30AiNPeXT9EcOaS7A1bvnllzANvf73AUiZ68H76/pgLSyFc6qHIiTSha4M2H2spJdWqj0e1AhQaS3CRegU2g2sI8nWtGtJf8UMcl9Frde4J1AU= Received: from BYAPR07CA0027.namprd07.prod.outlook.com (2603:10b6:a02:bc::40) by BN3PR0701MB1378.namprd07.prod.outlook.com (2a01:111:e400:4018::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.19; Wed, 1 Aug 2018 06:13:44 +0000 Received: from BY2NAM05FT043.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by BYAPR07CA0027.outlook.office365.com (2603:10b6:a02:bc::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.17 via Frontend Transport; Wed, 1 Aug 2018 06:13:44 +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 BY2NAM05FT043.mail.protection.outlook.com (10.152.100.180) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Wed, 1 Aug 2018 06:13:43 +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, 31 Jul 2018 23:13:36 -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 w716DbSh028769; Tue, 31 Jul 2018 23:13:37 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w716DbD9028768; Tue, 31 Jul 2018 23:13:37 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 06/16] qla2xxx: Silent erroneous message Date: Tue, 31 Jul 2018 23:13:25 -0700 Message-ID: <20180801061335.28709-7-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180801061335.28709-1-himanshu.madhani@cavium.com> References: <20180801061335.28709-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)(396003)(376002)(136003)(39860400002)(346002)(2980300002)(438002)(189003)(199004)(446003)(4326008)(47776003)(48376002)(110136005)(50466002)(16586007)(42186006)(476003)(6666003)(80596001)(36756003)(44832011)(54906003)(2616005)(486006)(69596002)(11346002)(50226002)(26005)(106002)(5660300001)(126002)(316002)(52396003)(478600001)(106466001)(76176011)(81166006)(72206003)(81156014)(87636003)(86362001)(2906002)(8936002)(15650500001)(305945005)(1076002)(8676002)(51416003)(356003)(14444005)(186003)(336012);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR0701MB1378;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;BY2NAM05FT043;1:Q5CuvPkukOiaVveHVwDnfVyKsg4CxM44H95Z/8bSMwfgO+1V9z23qJTclo3xSYOYFhC7Jj3pzShU/NoJ/pVcn+OeHP879XHRpoOuTTm//HvHyN5A9ruXKDrHP64DjaoP X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a561455a-5755-4987-8c7a-08d5f775ef3e X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BN3PR0701MB1378; X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;3:N/nNv/WmCU3lz7BJTCuQGMrMA79pAkoqDNUDIMHEGPJNXZkK2W6eoXRk8ZRg8LhPoCjNoic2/ek8o5OfvvHzn6i1jyNW/fC3qMLpg7P8RakC6lySrWGepMB19owEphW4fAKRvyYXgb9hrrymbeYNHiqcLdJo2Xx7fvLsCcUtzg+DMfVWoIzFc2JqjydHDISKHqhfHvERmnGeId47p0B1dXxzccJvKFYgfl6qmVLkTOVlZ9guSZr3QaCUh2KJUdg7xrgDK/r6KUN6vRJFyFjvKSX8sxCOI9HByZRLOIGo5PxbW/TI/Lf6DPNgsHHhHNZ6yOitbNa6lPMtUoan82l+LdgfGX4JrnbGxdd/9v1Jwo0=;25:IFL9Shf3Y6J7Lysczy1IrqVzgu/D13n+n+Hl0S++kZPrFxIJPG2hWsO8U5YoTIG1F9WZUrv7P/FstJD3XYHIRAoDLqDx1eA1JFG3rf+VJKnHN2bLwB2+EKtXmbsBv43VtOMYpy2FSJsY5b1nUlnivaZPNjqCQ9R3223Tnet+fWGs7ebZxmstrDbma18MGgr4oz2ZEoSykI/eCHrIAOAZ0SpQ0O83Yawy564Izwg7bxPTj7Lj//oJQOc2JmbN4hxxXmgbXUYlemSLMMss7u1u7vKQ7m82v9e0VbXFSE31yYe7idAMyCnM3gh4j0tcf/y1KQdTEZzRX6TdD6DEahNwjQ== X-MS-TrafficTypeDiagnostic: BN3PR0701MB1378: X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;31:zaZSpNo4+0INz9J9tFMLuZ4tSY6+1ESw2jsy4UsaIWz5HAzUS2SzBrZGqtvHRwsQTsKmzTEL2+Q6avFiwv3WeBVFEErwgXdAv+Al7JVdHJsNImPuuDU272RURPDw6npwtfsbtCwzRNauhzL8Ef55GrdHVn2wLq+hM6seggQ6PZ3V3PVCWDlgTYA9nl3HAvZSOtiSzKlH02cIoosg10HgaIvhHIGBHz4EdDjBbxx8m5s=;20:czCKZ4nxg/UMh+NhLgY757cKi3jAqhjDxz9hclTwtX12vifhTb/jXY4iGXyyek2dx/IG9lvCuQdqAWsAMPvQtAWm8pINvbg8dRKag9TmBj6xQSgKD9mFBIZJzS8ijuTXh8TIuueozMIVqTmcD45jbkkkwfUg6/OeN+gVEiMhVunTQL1taSgkA5ZHKxILXskK3CZAubVcNDs/juzCC+gTvgBcAv8TuPXaPzM/Iq6+cYFg8WbaeJmVaCp9M7sNc4G3/YjkYRQaJXT2V6G3eeJrKVY+12Y0EHjYoIh9rCu3ln9Y3meL8jQNl/8eT24GPg5+AdNaab/AbCR7qYpVKhoVgVksNLl+AO6KLdSOfKv2RTRN822y2sM0zf1p6lkVQMzJ713wAkkxNYYeq883W9SdknCemmTfnhy5H041t8UEzV7bIMZlTpJuDxayaCNqV3csQZpOnsXLffxgcFeFWMnMp6RygTmIScExOLFNqwD/PAQxiTIldR44Bc15xP7GoHml 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)(8121501046)(5005006)(3002001)(93006095)(93004095)(10201501046)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:BN3PR0701MB1378;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1378; X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;4:VdmmXj52ACQ72SKEREbrR0Np8vdlEU4lLzfJXuQ1AGXmv7ikuBfmFSe6SBFTsdrSpawsGKrmQiP0qsxenV47NtQQKOVLtRXAx1paQ1MB6+IMq2hyh0yoL3fhFFesPROGkD1QGAv6PoJL+4dL3wWW7clTIwG/zLsUu2Yc/bDo86Bz3L6SboM3A81eA0if9PWmzP9bD2/dYR28EoOYPAJGIwvndarue/RLuQUn8UTzwpAX1TEPO4uScMXSLkQY2pKJDd1wOi3pKSzhzfIDFWNbZw== X-Forefront-PRVS: 0751474A44 X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;23:LRqoVH5hAF3ul7/3mknggJCzYx76b7B3Hy7Ktj67FoA3Cd54oqDFdY7H0poqhtxEgvvcq5RlMfuXArnftVeE8wZIaOswL8uN94xIgk1kuGdFKVheOmb/SF6NFdsDZEAZ3/zoqZnJ31BfRRDlTXhZKjwHbnA6pWPgJZ4RbmkG4jDzqbCSLU9FKfryYxktRLih++sSoO/rqvT0x47NPU8eMRe046T3XAyywP1hsIzaDIvHmzb7TLQO5EHiyPWaRCwNv4XaKxG/iaRkMUHgycaEdJZ7zU6zzzbAZc0v2tisE6356E9wjEz8/SwuPWWGWRHrdNJG2+MtrgVAaFuBokEQBzD1krsrDAKzfD6xV55tDlsap4Dm17NlrYHYTiwT+CSCw/AYONny/Eo7vZtrJqwOxcsV7AwY82nl0RT9U5c5LRGDHlQAWXYY+pmSOT+3QW+oMjVr/aEBRtflOHYigFiy0kodYzFE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KiEzaKUnSmUlKfIhGwDouw= X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;6:0Jv9DTscf7m75L+TgORsSY8GOh/6g/grIQNamOPkfUE1pNAhaznPc7/mTjbQCP8/NlKKiz/rhaOohRCSBVaBoSpFf3Y3nlR6TGBXEnci5C9R7NwKhz1E0qR4NWu/8likt0hu+alY09JUZYR627XEhYUM8oWWsbaQTMqH202kmRS0EpAsrjqclkwoJfyUuHgFCFb3HuwIV0dRqE8PxcwiScheYQd94YjoHmwiNl0BkaeXpz6imh1jw/BPaX1LTb5yKqpO7uAu21UkJIbSOC6IC9iwcLRiODxYGr60CcMK0vrVi4S1OBoRBVX9ycdz0Qj7X8lKCjuZfrDBgP9E1Q3pVg1D1S7YqMm8/Nzh2JloD2tZgczPkFDJZeMjIs38pP4VRSMGEHM78wCApouiWGDH8FYGWfgnztvULF/+soj7JAwQ8UhpePHGx5E+1I1ZirzasTeWtabDnFHFLYbIeCuWbw==;5:KwtOfwZmLhMIfFD83fNNBQSbTk8+RJjs+tnTePv9a2qk+Q1MLP9GzI6kQf+5fY5r2ckR+Urh/S4+bD1BEtluQ3brAyYv7xRUuSQgOtvjFAXzIRFOLWbL6GEraXBuyC5y8fwjFri7XOUfbhnQi8k7L5/P9c5umsJDn0jaeZvArDA=;7:rqJPaWazkK60nr4ZqxgqDeatH4FIY3pLJ6GGCTGt+ENLC05RLkeGghz4YRKAbs9TIKPBj+0SEHPpdDnD9q0Yz+EJVLcMZTvmfJm/YCaLl1Q/U8rm3XOGpjgnr7KUUKoUhJ0SV8I3tLR/e3RVC2G0zTYxQV8yvhjTa6Y2Ibuz8n9t1J512MtqJ5KE9YV1ISRPIewf/hTFIzwV69Icugel0Z0FRjXtarOdXoL9k6T+Y6fEVLBPVteXMWPSFH5zrx2M SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 06:13:43.7850 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a561455a-5755-4987-8c7a-08d5f775ef3e 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: BN3PR0701MB1378 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 Driver uses shadow pointer instead of Mirror pointer for firmware dump collection. Skip those entries for Mirror pointers for Request/Response queue from firmware dump template reading. Following messages are printed in log messages qla27xx_fwdt_entry_t268: unknown buffer 4 qla27xx_fwdt_entry_t268: unknown buffer 5 This patch fixes these error message by adding skip_entry() to not read them from template. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_tmpl.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/scsi/qla2xxx/qla_tmpl.c b/drivers/scsi/qla2xxx/qla_tmpl.c index b170eb54aab5..0ccd06f11f12 100644 --- a/drivers/scsi/qla2xxx/qla_tmpl.c +++ b/drivers/scsi/qla2xxx/qla_tmpl.c @@ -571,6 +571,15 @@ qla27xx_fwdt_entry_t268(struct scsi_qla_host *vha, } break; + case T268_BUF_TYPE_REQ_MIRROR: + case T268_BUF_TYPE_RSP_MIRROR: + /* + * Mirror pointers are not implemented in the + * driver, instead shadow pointers are used by + * the drier. Skip these entries. + */ + qla27xx_skip_entry(ent, buf); + break; default: ql_dbg(ql_dbg_async, vha, 0xd02b, "%s: unknown buffer %x\n", __func__, ent->t268.buf_type); From patchwork Wed Aug 1 06:13:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10551745 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 CA8581708 for ; Wed, 1 Aug 2018 06:13:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B90992A5FC for ; Wed, 1 Aug 2018 06:13:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADE182A64D; Wed, 1 Aug 2018 06:13:49 +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 4D7C22A5FC for ; Wed, 1 Aug 2018 06:13:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733182AbeHAH5p (ORCPT ); Wed, 1 Aug 2018 03:57:45 -0400 Received: from mail-eopbgr690040.outbound.protection.outlook.com ([40.107.69.40]:15840 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733157AbeHAH5o (ORCPT ); Wed, 1 Aug 2018 03:57:44 -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=ufhwIdujEqTxVBCYmKi3wAB5vp6pU2rQt9eN/ImOaf0=; b=O32g9Jlc8Zu9Aa29q/zk3+pEPhlT62zsQ07HhV0f03Ggfuljqnxgrn5z9Bu3nK32nhYz7xFcRUKIZx9f7W27hEMccLHwiYMBGLASYPZM1WdhkJw0CbaC2HeFNwUzQH+qXDhAgcN+A/6wESokjh5Pybz4iPvtZA3ovKNhv00vUD8= Received: from BYAPR07CA0027.namprd07.prod.outlook.com (2603:10b6:a02:bc::40) by CY1PR0701MB1386.namprd07.prod.outlook.com (2a01:111:e400:4c1b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.21; Wed, 1 Aug 2018 06:13:45 +0000 Received: from BY2NAM05FT043.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by BYAPR07CA0027.outlook.office365.com (2603:10b6:a02:bc::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.17 via Frontend Transport; Wed, 1 Aug 2018 06:13:45 +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 BY2NAM05FT043.mail.protection.outlook.com (10.152.100.180) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Wed, 1 Aug 2018 06:13:45 +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, 31 Jul 2018 23:13:36 -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 w716DbPM028773; Tue, 31 Jul 2018 23:13:37 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w716DboD028772; Tue, 31 Jul 2018 23:13:37 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 07/16] qla2xxx: Fix redundant fc_rport registration Date: Tue, 31 Jul 2018 23:13:26 -0700 Message-ID: <20180801061335.28709-8-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180801061335.28709-1-himanshu.madhani@cavium.com> References: <20180801061335.28709-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)(136003)(39860400002)(396003)(346002)(376002)(2980300002)(438002)(189003)(199004)(87636003)(16586007)(51416003)(478600001)(52396003)(47776003)(106002)(69596002)(336012)(8676002)(14444005)(81166006)(446003)(4326008)(8936002)(186003)(86362001)(80596001)(26005)(50466002)(81156014)(76176011)(6666003)(48376002)(11346002)(356003)(316002)(54906003)(476003)(50226002)(110136005)(305945005)(72206003)(5660300001)(44832011)(486006)(126002)(1076002)(42186006)(2906002)(2616005)(106466001)(36756003);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0701MB1386;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;BY2NAM05FT043;1:HRIzdtRx3p492f167alPyB05hUMFmFVUdU8fVm2yZoyt46u6/O9JMb2qp//qndl3iACf9bViHJEcPMKVWX+0tJ5qOsuN6B2+DnAcSSYkPwwKbI9H7TdAPQSdGVbsy4HW X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0939efb2-0ebd-4028-7104-08d5f775f004 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:CY1PR0701MB1386; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1386;3:zv8jYzV5xq66PZpBI93k/XiGmcX8q9PlIwNEw4j0UFazlpsV3GrTxREU984qh0Ad5sRaJYlQgdmra69J4h0c28OSgNqfin5AF65qjtPDJABxSYVaT1S6iEzrkk86UW1byyVfQX3SLfd034Rj6822dDXOk8pPr5GEd21Vim9Jgz+3SQsZ4z5FWhdO3MAMhnWhNznMk7cnVL/P0GSyLisx0V6NvCqH9OwdTVhZliHg8sWP9Nr1dw1DPhKtX+TFjfPtdsMWE4TgCHJaa0n646XJZw20CSO9Xx6QGsM2S/Gwns8dpIC5adqwdlfdyyPOgbwzS0EN3oe6xD11evHIBXw7+08wo0PawBZj0RPUmwEjmBc=;25:b1Jvu6Bgw7HEwGYDGYA5QNbi3QYBl9LMo68aaQf2K5db1QYbBSiN9bhEaqB+Tm/UzsJ6O+wYXz2VMUS+lUwlDnwuFt2BD15euQxeV7DLvfICdEzDcTA7nZ2RWPls+As8Ppsj83CJ3t0LwWUMz2RM+acTEqn5278/oYMV1/Z0no4cXUg1ESADBC1bp0iqkLHqtnCTrjBCsFcaEHTtDfJ8VncimKeLHsd4qwaXCPof8KI/nFmO0KyXjb8xuwRy+ZPZj9sIENDpWkOp5CywsSa5UhQ7wsS1X5furfcdNJNMQJENh07JAjsytGtexSAQmW4MkYZek6P346p9vqYvna3YHg== X-MS-TrafficTypeDiagnostic: CY1PR0701MB1386: X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1386;31:8ReF8d4cmF6EjDUoiXqrsri53x1kEvJiQmWZZkLRmsd6Zj4DM8iLEIhqTSUEklRM1LkqDsIB2rKu1kRWtZMvwDl82mRB9917dNyK8hx3e83Jc6ByS4SP7RvNQjViYYMOkRQegtN953skQYUD+R46+Ib7O7Fp0NRRk1Ur6acfCGP1jwI2bYVi7nf8JOFPxc/jY6M1xIOHCR0ZZwscq3Hj6yw9u4oldRjsalQOVRImPOk=;20:+KOUCZHXNciKgGlEiYyFGGa+a05AyO+hAUDXqwtTH7Pj1AAQCQ8m7H5hr4okZ0czf7lwQnVA7bvAkNjqQvct2h9pVRO4lnz/H7XBGd8QMj2YZledFKGr3cZB4kqj2fn8O5jQGwGPQNryQ3/w3XmJywNI+tGVAtR5s5IFtAAaSUF91Ac+joigEwKVhxj410xYjggVrAJeFP25DbFiHhxuf978v69xDtwBpe4CKFETG8ri8koaoYktl4VR6tHdHH0BJPbfsdkKGxi6oEKndapp5uOHOYOKaiQSDKS9NpEbzIB+FJ985dewJvrU18DX3Lg4+chlV+lD0hzJsZnOdztU3W0ODBKMEERdt+ONGoufOuUX8Zt8wuJpwh4ALLlYKIKvAZbjciuDn2wkeBm9tqhTgv7thdADKnc/3zHLFGD7rrL2fMSoZYg+Q34ObkwBlQTkHUfRrGE7ZGFd6s1BzLubnoaTvE82dwFOo3w2XGM3PhmF65NbekXnVXStp0DpJO6O 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)(10201501046)(93006095)(93004095)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:CY1PR0701MB1386;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1386; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1386;4:Hmpvb3t3e4eUDdrqsRbdM+F3gs7O6rDJDtm4AgQazqkm/6gHMCdUlnvs3bCpvaNVhEwgFg8LMZU6PmIdS/DQFTM5wI50jLEScQlam4QGNtB69Yvc+wREfO8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7WThB0R/4+u2eTIdOKawVwe8z0A3QePCHMNOEQnqfMxr7bm/kNTopRyQwujJnMTYAlYj+3CGEoY/USkglh2O8TkRUyJtobM2UcsxYXZQWo9chfV/y6hA==;5:SbcYLB6z2nknr9A5Bjo8B3LWvgzlA1ZyL7JTa7iz4OIAUtjZ/voM2Q7aW+jtsAqfG+SQraKLZuofB6Wkn0ck754sCLSbJ05PL3FhFiLCI+nyqCI+8MGe8ukYP919twyHb++NaSVuM3w9Jmsoax/ShBzGtEk2tGg0AsyZN+4p3/U=;7:RZJ4LOBIa7xJHoG6ACRj4kCL9jJ62eHttPsp2di/lNAHL9VCyPASy/YpSeqLlppJDTz8L64GKHLz3XEodtmGDl4T/71NfEWwurERRiA9/H8Oxu22XOUvr53qcBshmmJ+N717jCk7UAo+DmGXy66PXYOYrI+kd2i2nc0jgGOIwweBJo3v7sXu/IPjy+bpGLSttN/WCSJR3z5J+GVSL8MzkUX7LO+64WMDBqbOV3jtgqtr7Lf+pXX4rWQvJEi+6UBb SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 06:13:45.0819 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0939efb2-0ebd-4028-7104-08d5f775f004 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: CY1PR0701MB1386 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 Prevent multiple registration with transport layer for the same remote port. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 79738294b069..4a89aa93c315 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -5001,6 +5001,9 @@ qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport) struct fc_rport *rport; unsigned long flags; + if (atomic_read(&fcport->state) == FCS_ONLINE) + return; + rport_ids.node_name = wwn_to_u64(fcport->node_name); rport_ids.port_name = wwn_to_u64(fcport->port_name); rport_ids.port_id = fcport->d_id.b.domain << 16 | @@ -5056,25 +5059,18 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) if (IS_SW_RESV_ADDR(fcport->d_id)) return; - ql_dbg(ql_dbg_disc, vha, 0x20ef, "%s %8phC\n", - __func__, fcport->port_name); - - if (IS_QLAFX00(vha->hw)) { - qla2x00_set_fcport_state(fcport, FCS_ONLINE); - } else { - fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT); - fcport->disc_state = DSC_LOGIN_COMPLETE; - fcport->deleted = 0; - fcport->logout_on_delete = 1; - fcport->login_retry = vha->hw->login_retry_count; - qla2x00_set_fcport_state(fcport, FCS_ONLINE); - } + fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT); + fcport->disc_state = DSC_LOGIN_COMPLETE; + fcport->deleted = 0; + fcport->logout_on_delete = 1; + fcport->login_retry = vha->hw->login_retry_count; - qla2x00_set_fcport_state(fcport, FCS_ONLINE); qla2x00_iidma_fcport(vha, fcport); if (fcport->fc4f_nvme) { qla_nvme_register_remote(vha, fcport); + fcport->disc_state = DSC_LOGIN_COMPLETE; + qla2x00_set_fcport_state(fcport, FCS_ONLINE); return; } @@ -5115,6 +5111,7 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) qla24xx_post_gpsc_work(vha, fcport); } } + qla2x00_set_fcport_state(fcport, FCS_ONLINE); } /* From patchwork Wed Aug 1 06:13:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10551747 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 5580B1822 for ; Wed, 1 Aug 2018 06:13:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 455852A5FC for ; Wed, 1 Aug 2018 06:13:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 397A52A64D; Wed, 1 Aug 2018 06:13:51 +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 C99112A5FC for ; Wed, 1 Aug 2018 06:13:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733184AbeHAH5r (ORCPT ); Wed, 1 Aug 2018 03:57:47 -0400 Received: from mail-eopbgr730043.outbound.protection.outlook.com ([40.107.73.43]:54816 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733143AbeHAH5r (ORCPT ); Wed, 1 Aug 2018 03:57:47 -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=zmfpSSgTfVtW9rAjZyxCLQrV0Iqi0rHC/pME5rVfb50=; b=O0q6c+iZcsXoPOVmTOPnrp6e1DSQt99k1UF0BrFd18gTWFs4IgGI+DA7+Qyct0mjeNFy7AUFDoAiE6QfCsCQvUXd1JW4oMIX+acShI0raUvesMH2o2lpwARRVM4qoayEwCmesPYUeItMJjsRoIlbQ00GpC4pY+jopukBpIwU8Wc= Received: from BYAPR07CA0027.namprd07.prod.outlook.com (2603:10b6:a02:bc::40) by BY1PR0701MB1384.namprd07.prod.outlook.com (2a01:111:e400:4810::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Wed, 1 Aug 2018 06:13:46 +0000 Received: from BY2NAM05FT043.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by BYAPR07CA0027.outlook.office365.com (2603:10b6:a02:bc::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.17 via Frontend Transport; Wed, 1 Aug 2018 06:13:46 +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 BY2NAM05FT043.mail.protection.outlook.com (10.152.100.180) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Wed, 1 Aug 2018 06:13: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; Tue, 31 Jul 2018 23:13:36 -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 w716DbIw028777; Tue, 31 Jul 2018 23:13:37 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w716DbfZ028776; Tue, 31 Jul 2018 23:13:37 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 08/16] qla2xxx: Fix session state stuck in Get Port DB Date: Tue, 31 Jul 2018 23:13:27 -0700 Message-ID: <20180801061335.28709-9-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180801061335.28709-1-himanshu.madhani@cavium.com> References: <20180801061335.28709-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)(136003)(39850400004)(396003)(346002)(376002)(2980300002)(438002)(199004)(189003)(186003)(6666003)(76176011)(26005)(52396003)(336012)(51416003)(478600001)(11346002)(446003)(44832011)(87636003)(316002)(16586007)(486006)(476003)(54906003)(2616005)(42186006)(1076002)(110136005)(126002)(80596001)(106002)(72206003)(5660300001)(69596002)(36756003)(86362001)(106466001)(50466002)(14444005)(50226002)(47776003)(48376002)(305945005)(356003)(4326008)(2906002)(8936002)(81166006)(8676002)(81156014);DIR:OUT;SFP:1101;SCL:1;SRVR:BY1PR0701MB1384;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;BY2NAM05FT043;1:I8wirG5+5eT0i3jFKSdPbnERCTEXSCZQacnfLjJfjwq6vBlKHjlxtEmUfFx75wZOSQlIiFuTbXK/UnEQQszl63/kOyNp2RY3r7qVowpL5tXtSAOsaXs4o5wXlqrZ2jmT X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 994919b0-a7cc-49cb-f51c-08d5f775f0a8 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:BY1PR0701MB1384; X-Microsoft-Exchange-Diagnostics: 1;BY1PR0701MB1384;3:dfsVdqBJ/m2pzHYxiAb/c+kfsrwY9D9eZrdnaLXZxHbf+MbFRo01DF1pBoPZJ5Ecx7VGzF3uHja4VEzE9/6pBespjsT+mmctna1cJn6euLVRULA9hsmkKOBGuZU1lYUmbb+aYZl6GmBpOvKLPyqOD5bmzCwsrs7gS1fFBNGRJv/qXiqSMowB9KwO64IuYIH5tg32CEWKUfGMVIAQeV50rEFwrfZnkJTfHw+Z06hn2vJFUwgvOC7q1htXLFpMrQTGiaZ77xuHMi5YaGVh6ZxLA8CF564ENRSBZulHfSgCZ+yMEbmzEBmerTwcWRZchT6oGsUVGLkqMJWKaCJkFU3v1UPSINvffMr68J+8SzuiCgo=;25:a+pKsOmyaIBq2W1jsZJ8kp3R1mM0UMNbEBl5PuDzqGKW6MNkkmiQXOfUW7bxJ0Bwx87PBosdiBHBtc5b84Uq5nhzQ8V2Etbv+XGNoOZFttmBMoN3GKkx3pnIBrRS2Q/mFi14ts9bGFD33u4JQ1nrQ0+k6nco2ZGdZ6EC4196OHpS3A6UaoHmac05A8ioXja8bjjWGG4CPVc4Tn9XRXGW7ffpbrEX6jAMqqmSLStKCK8pNoNieNXZftRxmombYw7wGGwrW9MOf9v4JuIx/GvPX8A/Y0FWDa1KBDFyXxDwsW2aJdYM+zoDr1IIVYr5Wi/nbJ5tf4GOiBXpTRlYiDEgaQ== X-MS-TrafficTypeDiagnostic: BY1PR0701MB1384: X-Microsoft-Exchange-Diagnostics: 1;BY1PR0701MB1384;31:I2B3RCPMlqhIUQ5BSCulH48Qme8FRvnF8weZbZAhQ5anOor+Iy7NKspRGiqrRC7e6OMkimFK3cJ6110DhtySEKhqf/M+h20fuPEs/hiaRqAdXj5tZniUiMtwBQgHRX/IFfgrpIk1Vspn0rUa8zIAmXfATSZhJRYLjr7DBPdnl6SApzc/vX/MMhB2RQFsKsGgIQRLXHCvmWqUnb+kldv+ZDYErLrjD2BhUSzndrUWPf0=;20:DyM5HUmDTMO7B21UJHSf85Nav/j3ISTN9QHa6P7ZEUGeL4xZUJ85pBqiETxK0hCuRJlFVMKCcCCE58SrL6IH7TmrWUnUoSpRJMfBRJl6DIxdCf2tU04hWPR1Nsjt7h9t5glvY3Hdi7nblmoV8zlegxvgSt8Sejq0i4N6cFaMvvddT1m4Q0tAM1iuYUQmvJHvlR/xJEfzLnQIhE1ji0/RZSgywQCjx+spf2j5j3ut5xVEovI+KiZhO5kVkg4q7iee7WuDCl8qGoE1F6LlVMsPMVQr3cpBmhInJyvfq8OAq+F0J9ojdDby8CxybgXpmnLqrodmb0eGUy4qD5qeQsm7VRI27b4KEYlnzWqsTNk44/SOtMWjs9PWL+EoBXc5aVxx11mQ1mLKLxaT9mCAmI4q2MEpGQYgXCw0QbcoSgkV2TjeNw7A9InUeF7EN6aIXaaV6q7pez1ru4iF8xL1lPypMYip7qOA37DW9f8wPp43SkEvDxaE4Ev2DJii5L7/4fVU 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)(93006095)(93004095)(3002001)(10201501046)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:BY1PR0701MB1384;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1384; X-Microsoft-Exchange-Diagnostics: 1;BY1PR0701MB1384;4:1YqbHTapew4t/eAIuQW+hatCfepQ2an1LH4XlB0PbJyEV0PzmOr3NhuJFfr6CX0pqzCCfadmJB0alvkXWUJOog3LMwYVsKoVG9p8p3ALpC/v7LSXWaJnr7OTgC6BQiXH92NBGcuz+L6+6ebWqmCsqnJ/MO7dRPf50gbuo/1BhxT8r7Vtz2z3wXs6r9hzx4D6LiTtHGp8G3B5K2abUlaI/uerOvzTaQtVjtUY1yW9XtRife2ty66WaKsdHiE+w9+fM2UkNo+w09A6X3dEPJQU3w== X-Forefront-PRVS: 0751474A44 X-Microsoft-Exchange-Diagnostics: 1;BY1PR0701MB1384;23:KkZInhHNCYucuU7YOz7T6SrFq3BDwd8fl1uIiGjnbthjGndaq4m8medr1XSZk3SUo96Yu7qzAAawqL5cNwlf88fctj2w5RID3DBLYTYnJX7Js1wUTQakhLaZvCjTdxhKK3Nn5wXmu+0Zj/tx+Y0dGCLqCzIM9X1kXkj7imwEuCjwE5jSlQu7DI2eVWSAdtxwW0SXwXtDEpnIWFX1WT/rKGGPN8ENTvHLARJVOc5Zk7s8GpJA28j9OnLlihvvKEqVO6ttzWDoAudpdSS+mzqGBcXSjaNCnye8I3P7VUmulF1bcayKcg0Lm2sJXTOLDuJSheVhGrcyzJes0QqoSbEZwEhyhgFHEABLK6vaZZM9ocU3FW5TBnykX8aTYIeqoz7f796XyhabYRc8832D8cWmMBxxALcYF2H3V1JnlDKgMa8ZWTO210xJl1QtRbuvjGNR/lFAFSRZgfx3p7zpMg+Iu896fHseZNzUafd1uuPeutDzmQ0CZRWAHSp8tFppa/Azf4LhGKp2ZaO/lU1IXl0AUfpIfN48JxZQ8aav/sLDpPt6Se38vbx0s3xAtQoTC5O50IUW246F3x0J6L73z+OgV4+p2GTqhkRwOCStuiSAdhJ3GQRFrhDtu5b9HFBs46qA80YLhlwuZ3lJVq+70CRff++8kOAPu8Q+ih+tcN6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NW+9llU5m/G7KluK5Ginwi4szGsrX0R0SF+VQuvpZdOyVzmKeSFfydFLkGKEFNvd49WSIFWdfgZ94IDu1GBAMA07gp53dOjUTL9Z94f9tUqeFr2gVLMhtSiE7Ql5iBvVFp+FqMuHu43NSU7Q/Wy1kqok1mLXerGB3uTRPygQPodgC25o8a0NPI3yJ2LHTCMlhDQAnsYcYfg8PAuK0+Onsd9o61SFTWUuAY8SBBOUzfJ5tSYNfcsi0oFVeabU34MT6QKKBk3Mu4Ti8vbgyYIXAXicJujT+KovHC1RIIvxJIf6m0ykfNNsz7UA==;5:RUJX6qfTyZ3UVplpX5lukZO1rJPFbEPBY7HBsMHSlvRh1Om8dbkZPaCM3cKJPEs7SKk+/81MV/gnbXO9YxlabfAQh8CcFALwVU+w+LGo+eQJKhlBWJy9GwmFE0EKbZ76SMPGWBHcGP/LTu1dZ/sfjIOQp73q5cD9WdCbwPhdOCg=;7:kMYKyxRzX1EsZ1V5QlWxOsiAsAsAe24l/uhQcC5olYCjCSTQXVGmNjjLY0d/SEi+OZALc8FObZrkwCjPkq+0aEDcVRS4UA46jhgeCo/wsZusm2C45OdeNoCv5yJ1tgRTqEEuQgKyLOd5mUBAmzdL7by1KzISvUEQoEr4ckFIpGTgvXP5M/J9I7XoOw74ZRbEX6PlcDi55QrojCpSEALni73pW793UPk8kDBddaX/Gm8pbuZkIS6JxysmPgkSubw8 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 06:13:46.1600 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 994919b0-a7cc-49cb-f51c-08d5f775f0a8 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: BY1PR0701MB1384 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 This patch sets discovery state back to GNL (Get Name List) when session is stuck at GPDB (Get Port DataBase). This will allow state machine to retry login and move session state ahead in discovery. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 4a89aa93c315..f94335301c70 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1152,9 +1152,12 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) case PDS_PLOGI_COMPLETE: case PDS_PRLI_PENDING: case PDS_PRLI2_PENDING: - ql_dbg(ql_dbg_disc, vha, 0x20d5, "%s %d %8phC relogin needed\n", - __func__, __LINE__, fcport->port_name); - set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + /* Set discovery state back to GNL to Relogin attempt */ + if (qla_dual_mode_enabled(vha) || + qla_ini_mode_enabled(vha)) { + fcport->disc_state = DSC_GNL; + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + } return; case PDS_LOGO_PENDING: case PDS_PORT_UNAVAILABLE: From patchwork Wed Aug 1 06:13:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10551753 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 4A8A51708 for ; Wed, 1 Aug 2018 06:13:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A5332A645 for ; Wed, 1 Aug 2018 06:13:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E88A2A677; Wed, 1 Aug 2018 06:13:54 +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 EC29C2A645 for ; Wed, 1 Aug 2018 06:13:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733224AbeHAH5t (ORCPT ); Wed, 1 Aug 2018 03:57:49 -0400 Received: from mail-dm3nam03on0045.outbound.protection.outlook.com ([104.47.41.45]:45694 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733157AbeHAH5t (ORCPT ); Wed, 1 Aug 2018 03:57:49 -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=q73mBtb4qToxfLr5ySc/J7IffPzGE/ckaZ8yytORsao=; b=XGMevpmFw7vrUVKKHoRaskkbgYCWoMzLfMr0cJ8eLn4FaMU020x7v6XokbPqoJS/bITejJ9eXysvo3M97cP/m4r1AgSStsDN1+BAfKNkN67OcePy7WY6eLipeG9nA4d4FK5mByBe6yjP0wKM7J+GdEzwQceF1DP6KS0XiYnhKnA= Received: from BYAPR07CA0027.namprd07.prod.outlook.com (2603:10b6:a02:bc::40) by DM2PR0701MB1392.namprd07.prod.outlook.com (2a01:111:e400:511c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.21; Wed, 1 Aug 2018 06:13:47 +0000 Received: from BY2NAM05FT043.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by BYAPR07CA0027.outlook.office365.com (2603:10b6:a02:bc::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.17 via Frontend Transport; Wed, 1 Aug 2018 06:13:47 +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 BY2NAM05FT043.mail.protection.outlook.com (10.152.100.180) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Wed, 1 Aug 2018 06:13: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; Tue, 31 Jul 2018 23:13:36 -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 w716Db7E028781; Tue, 31 Jul 2018 23:13:37 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w716DbOO028780; Tue, 31 Jul 2018 23:13:37 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 09/16] qla2xxx: Fix unintended Logout Date: Tue, 31 Jul 2018 23:13:28 -0700 Message-ID: <20180801061335.28709-10-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180801061335.28709-1-himanshu.madhani@cavium.com> References: <20180801061335.28709-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)(376002)(346002)(136003)(396003)(39850400004)(2980300002)(438002)(199004)(189003)(11346002)(336012)(50466002)(48376002)(86362001)(72206003)(446003)(476003)(87636003)(478600001)(80596001)(4326008)(44832011)(69596002)(1076002)(126002)(486006)(2616005)(76176011)(8936002)(51416003)(14444005)(8676002)(186003)(36756003)(26005)(52396003)(54906003)(316002)(47776003)(5660300001)(2906002)(81156014)(81166006)(16586007)(110136005)(50226002)(106466001)(106002)(305945005)(42186006)(6666003)(356003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR0701MB1392;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;BY2NAM05FT043;1:HZzAPXqnWUMFg/w+dwfccqX8YOCVUQxbUg3sHSnheWl0yKvZOGJRtQMwawU7JLo2pAwPBzYkAUjmkcCtfIlur6EgWOBJRB5OH666cq1BSIkOn48m4hzCbsFxkVmEv38E X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7dbe3763-121f-4572-538a-08d5f775f108 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:DM2PR0701MB1392; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1392;3:gsokiM6vfJGrk9Y6LBqpVRPUyqtNqwKnrp+NceibT9xjQiYhE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JDJH9OG2ZC9gmIGwO62RTuKXinRX0B0ypfS7cM4iFILWkqlxobFi/jyUkGkg7UJd0djZE3ATWlqFjlSv8AMKDnfG5uLrEFN3h9hvp208aDm97WCiA58rdKkCXGygCISSDuvPyotd0hqSfKh7uVcxw6GktUAer+W+z33rEqodcPvPejwvEJ5VK3mhywcwuse/266i5VmDuxZvtZrbYiZyxtajTw9pxq5wAA1/2d3Uh07o2yY8nmbUpS7tQ1WUsHtVSXf/cXnHa3yS65IGFaC1PvORU8ZeR99pgI9s0DNGB31z3UMeftDwboHc1c/D5YdMrwQJQQiRYZtfMcsu4SIIAJL+yPkIeBbiEqltcChA3rxkibCfAte5BkL3x3AzDkJh2EgkH0WMOn7CdDe 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)(8121501046)(5005006)(10201501046)(3231311)(944501410)(52105095)(3002001)(93006095)(93004095)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:DM2PR0701MB1392;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0701MB1392; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1392;4:JYsi+YWP1SrRt+pgrfW0WWnNkwAOM/L6oXoNQoNUV5tmywIq5nS5TXSIkY2G8HUgqpTvc7MmDcByKVJmfDknYYwuvaswXEUMy9WQv1hvjtHhJKrXSTBPJez3q59pD9Zvf5iFhrCRurV+S3uMWlJ3uCABqYsOaxzE0VMvGKhH8M7fezmZ/YI3WXfSZ6aoirs1fCQjc6aXkXLqWyhd10lcjLNC7x0bRiiRbCz3MaSDc85UojaW6JNGAwgNBLgTL23lgbnmnEhgh/ZdPt0bH0nzKA== X-Forefront-PRVS: 0751474A44 X-Microsoft-Exchange-Diagn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hyVb9ei5mXHnUNTEteC8bqS2LksjbqZskLv1zxgrDb1ujoWZ7ZH2+RYMtLJE/M9H/f6M7XEm+k+MFlrkBDcrNp3tG0XGYvqnKIY3PJK6KJszVpllyUudz4RecCuxkRYrr/4OIJhArnf1Yc=;7:+MMvPpgeR4wtkFqf58osC/8YjzjU3EMpq5W6QgkhVW5Y4WxCSUJk7TGEe6VmDWiKMuPZ9y+ZzFcSAnW2ZiJj6fmf28ibAOMMEHm/pSb/nFp0nuS4fEz3jC435+4Ekncdiv7htGMIcfipjlcFM5+9VLVTmTzSsbpwR5oTiGsEc4wjoz92+i+uVRT9ot0zw5HqV599rIJoRQfrVui1/tpgkVVPsyDK0IxPoANx8GQVIYhEzz2H83wJxnmTF1H5RppX SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 06:13:46.7850 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7dbe3763-121f-4572-538a-08d5f775f108 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: DM2PR0701MB1392 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 During normal IO, FW can return IO with 'port unavailble' status. Driver would send a LOGO to remote port for session resync. On an off chance, a PLOGI could arrive before sending the LOGO. This patch will skip sendiing LOGO, if a PLOGI just came in. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_target.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 4f9c315813df..f9036004f179 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -986,8 +986,9 @@ void qlt_free_session_done(struct work_struct *work) logo.id = sess->d_id; logo.cmd_count = 0; + if (!own) + qlt_send_first_logo(vha, &logo); sess->send_els_logo = 0; - qlt_send_first_logo(vha, &logo); } if (sess->logout_on_delete && sess->loop_id != FC_NO_LOOP_ID) { From patchwork Wed Aug 1 06:13:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10551751 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 941671708 for ; Wed, 1 Aug 2018 06:13:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 835A42A5FC for ; Wed, 1 Aug 2018 06:13:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7745D2A69A; Wed, 1 Aug 2018 06:13:53 +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 99E752A5FC for ; Wed, 1 Aug 2018 06:13:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733221AbeHAH5s (ORCPT ); Wed, 1 Aug 2018 03:57:48 -0400 Received: from mail-by2nam01on0054.outbound.protection.outlook.com ([104.47.34.54]:9219 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733143AbeHAH5s (ORCPT ); Wed, 1 Aug 2018 03:57:48 -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=agdFNcqpqw2bpdJoT3fg0i93RnikgVDk1tMvGSMiqhs=; b=ny+21kYJSIhDrs8Wi1qOlMIILg4SXDnPrOlq5wAKcVfzKvoPbfy72lHywtgCBUBXev5NWgh4X/swrAQJtcjQvprE3xT3+H71lwdTMEl4zBllSlJ1aNwBwwt6soiP+EuPoGCuoHMY1/e0jq34xMBwDIMNbgWK81noB/vWJ5DxmuM= Received: from BYAPR07CA0027.namprd07.prod.outlook.com (2603:10b6:a02:bc::40) by BN3PR0701MB1378.namprd07.prod.outlook.com (2a01:111:e400:4018::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.19; Wed, 1 Aug 2018 06:13:48 +0000 Received: from BY2NAM05FT043.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by BYAPR07CA0027.outlook.office365.com (2603:10b6:a02:bc::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.17 via Frontend Transport; Wed, 1 Aug 2018 06:13:48 +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 BY2NAM05FT043.mail.protection.outlook.com (10.152.100.180) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Wed, 1 Aug 2018 06:13:47 +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, 31 Jul 2018 23:13:37 -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 w716DcoW028785; Tue, 31 Jul 2018 23:13:38 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w716Dcsu028784; Tue, 31 Jul 2018 23:13:38 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 10/16] qla2xxx: Flush mailbox commands on chip reset Date: Tue, 31 Jul 2018 23:13:29 -0700 Message-ID: <20180801061335.28709-11-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180801061335.28709-1-himanshu.madhani@cavium.com> References: <20180801061335.28709-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)(396003)(376002)(136003)(39860400002)(346002)(2980300002)(438002)(189003)(199004)(446003)(4326008)(47776003)(48376002)(110136005)(50466002)(16586007)(42186006)(476003)(6666003)(80596001)(36756003)(44832011)(54906003)(2616005)(486006)(69596002)(11346002)(50226002)(26005)(106002)(5660300001)(126002)(316002)(52396003)(478600001)(106466001)(76176011)(81166006)(575784001)(72206003)(81156014)(87636003)(86362001)(2906002)(8936002)(15650500001)(305945005)(1076002)(8676002)(51416003)(356003)(14444005)(186003)(336012);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR0701MB1378;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;BY2NAM05FT043;1:+c1cw42v5tnlR1glkN5sBKUy6YxMYyX3LrjUX4zHhQAtUd8pHVMON+HIihNxQH8uqgYBxkgyVUcEMOuH1gJZuwTkNZkRs5JccfUA2Jdrk/leIH+sTv6IqLEY2SwQCZ8o X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9aee19f6-a49b-45ab-74cc-08d5f775f1aa X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BN3PR0701MB1378; X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;3:VIh+q7CGNHoafR8lmxtJwH/MXTyvlLAIe7HaF1O2penWlcG0mx7HvLyjO9G/TZ/vNNcymuk68HOyDMDZsHQjA/EljNG/tU2Jtb+odSu6B6oWoEhMzGHm1EYm3/R7RDPcEalPAKVXK2ze8ZFqApe9mJmOdtjISuAAvdB38FoQ5L/R+XfjRcW/DrUkh6CgDMtvObnKqxoUyKdwPQVzwIG9XMXSPltZ1x2YhcyVqum2CSZ5Pjy2H/70Vqx7jh+ofBhz+GIBRMwt2AUSbZRj7WDBzE9Xmq1mGQxtjJv1xv1FKC7G0uGEc/QmEUEvzXBUFex6Oc2nMASx+GT3EGh4Azdte2Yzv1HVzlPTESxoFWm2WXI=;25:1kn+IObkn24tOCR3fNw1sr9HS4GJDc7auhaVu32Av3SiE3i9qD6H6gjQrA23SSLHF6pNoxs0YpEHO+JcQBtQo3S71wI9Rs0adAarnPMEkowVXH0QfDQse9jTWHlr3jAunfNBojbhTR5ESekdsh5AsPWkJR2vucclt6cR92/emSa/hrZ6CZbQCDnlNddypobM3VnZpMHD0Oa/D27AhJ1OGEgdorR4r/Qp++maYNJi3nhJ17nQDTjmHgdfrS4A/xIFcI0xKSSpDePe8NvHOxjy89AWpRltUePMCsIUkfSEkJd98bjQrEgWbAlwiH7XYahB/EkpYy3bCnUH+GEdLghufA== X-MS-TrafficTypeDiagnostic: BN3PR0701MB1378: X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;31:AYbgaD1ty4SKIzbYVFUYJaj3tUitbOfJMbFi+rn8ZE1nZGMp6DdSpjuDmqLzXHNVUlqyCyPapfe9afktul9u/htoA3poe8m1A+lWDILoCzVQxSCTxsbGc/IIbumuzoEl9gom6y0PuPECwyFldeO+OM1AxQiUAu4ZOh3hVgp6eli2ZKcU0oIfSNOAyJ9T37I/4GRmFbSRGpwP5xA5mgbeBQbkyCneJUcVwZAMcYqVEsM=;20:N/vy8/D73NRN6qp8hQgN8OlWQr6QlZzvF4Af0mLAHNSzSPCznmrco8ootwqIu6SxhSfRWTUQCvhitAODWygA3Pa4X4rWZEQa3lf+M7ep/MOJeoSb8SJYe/yA7ffRbo3ani1k/dCpnlmFMPwuB8NGtkGATj0l5feuuM9EQLNgVEBmOu5Y4ibbSn7hyQauywiXqhDrL2W47grQ063qx+n2Pr2DcGkn2Wmld/XDtOmzZ9xcDSVPzSQgRqPo801z/0EkXywuFtrCSkL86zgs8nSPZqeszsp3k1pcCQpJ06a1lDAr6PPYH+4BZChYHasHpkkC1jGXVZVBarMRYutN9Boks0kTZ9xeCXFxEEr+dK+elCssL4+qC7q0WrV0vP+dN6pnD51HS58wWhCx79Kuoawh/Wxpq83Li2vtP26my/uz01sEEbIlumgJCEeASJu6VDRxrW4IfS9lR5cN7vZrDwEbePoPCe4K8LcfMwQQou0J5gcyJa+Oh8G0jAa++OHZEKET 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)(8121501046)(5005006)(3002001)(93006095)(93004095)(10201501046)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:BN3PR0701MB1378;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1378; X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;4:ARGoajpDpSViaUesxAybFIirJ9A9bXLzikjZhJKi1nyocsu4cjRbMbqbQNoH4qjFtRS6JcBK6hhAITWvyMatez5ZLDhISmm71Y6EB6XETnfbHGFCHengmFe4+t3xaV82ZnSV5H1fTWYGz23KqYzwlYwOYzStkLjs1lEt78i53CyfW/7ZDY9/SflgqI0/KmIzgh/0RidKb8i0hfu+xf9i5yXzsP2TFRGyIHBHwGCBL+DsI5iJjSov4nwR+YSePXRLqeTp0SuFjFornzsECr9NtQ== X-Forefront-PRVS: 0751474A44 X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;23:xk6r2fDzgX+jfABO53wxeGmsMGc8Z+X4B+7a/7aLzcXXO0+nYd2kCR3YKdwEml/a3qc63UvEWpsTjYAAOPDqdTnKYx3vmSwh2i8Sqa6phk1/AaLpeTE9xHdK7JO8iPiUNAYZCAG+mpsKbDMQLJ2XSb2vNEhGoFwjiqS68ltTbL4Dhk+jtLRN/6jPcDKVRn4asisPRV2wt0FUTosV6ArIH0fGrDZjwcR3dIG7ncew8hvyaGSdC8r7lgRNpcvLxzKwOmrqgtjXFSaw4YW/FHFsY7KzGmRvVS70/dpzVXTIppqFFhboWs5dafQI0rYmKtlaXHCRUnXgDicb9P8HC89u6jXKsOWxm7zSzO+yBe0heekJMIlJTcUsYOtxF8x+U7KEa5rvy9uRtKe5gl9ZG2GAOhHW456w2OlXOXWvmXuMOctUQSF3O59wsoE++nlhTNhBgHVd9dLPtrFrzPwEPMJtfmw/JvWtDzDwEX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x0FnAz4Zd0RqVoVNU4KEIJBQ20q0UA8nyn90r98wI= X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;6:8SENZ2Q6juknulDFtZFcpWO3LRD5x6OpBsmX1QiuSLeL/KR8HwLDeejIIORRQBrou3xhEgjv7EwYBaHPuLcJen5HbBxqeDz8kYvLROpwDY9iC11S+NVmSwGQqoCRWpLVonmKXvEh5M95UU6weG2+3Ugq/ZWdNc+Wr+JRHe60KrQVwrGqqCFSj3ZXos2HzRaS84rC5EYe2vtOB3HV3tFIwFalq5GYXqCI5RXkT/Kz7ZRuRowB7EvQPxPayS/NTW4xgDIbBB2XmvRownGGCfYZRbUhbqM6w2XV73+djS0mV/EQ9V0RNqdwMTO8pvE9UyWh0QxcDI5F6JldlHblzoNcMDDDOToByTUnIhBLoP21ynkiqV0ZP7+lEYwjc9JkaL3X9/4YkJFdCP8nu7DC08C7QeTSFYkPdYWZjgUnRxY4tcdUhyvxEIzrGFisAH7nrlieTC3eLVZLWXMkGmIe5GUNnQ==;5:n936RukMV2KnsrpqvqllMAx2Ck9xeSWwiAnet4H0lMvDIgNWTeWTvL/9BeM2Qih9wWd0aCwMGC4O9wHcB21Vgi+CXmxNvSMn7WBjvKrf8JepuNSWIwCfDmQU3cBAAAzDLIpeClY4TZHQV5SOu7VNjdxtaQenLeNhNJ8KJh9OpAE=;7:ssTo5Q0YNwRctzOsrJzi5v/U8A2CNMAyNHQmOa1nu5MvCFepMSfBU1eUnj9vhXLNMBmsxgpSEDtls0YBg6O+sNt6MHs5XsdWyK9iUdxg6aYLKIMKGJMPwEu7j/L+BLukYB4kS1p2esrUkyl9tOZKEfd5cfuzImxExA4mLt1DX9Q2juJRIz+bRREuwZKVeKS6TR3UMbZB3JXpXSXGxY5WN7wfn6uLshl1eVIM613BdzSFgVx1rLGgzRxm3lCMbgqU SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 06:13:47.8319 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9aee19f6-a49b-45ab-74cc-08d5f775f1aa 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: BN3PR0701MB1378 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 Flush pending mailbox commands on chip reset. Wake up command that's waiting for an interrupt and wait for mailbox counters to go to zero. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 5 +++++ drivers/scsi/qla2xxx/qla_init.c | 21 ++++++++++++++++- drivers/scsi/qla2xxx/qla_mbx.c | 50 +++++++++++++++++++++++++++++++++++++---- drivers/scsi/qla2xxx/qla_os.c | 3 +++ 4 files changed, 74 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index ee4d1f4fdf95..40bcf938cf4f 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -3598,6 +3598,7 @@ struct qla_hw_data { uint32_t detected_lr_sfp:1; uint32_t using_lr_setting:1; uint32_t rida_fmt2:1; + uint32_t purge_mbox:1; } flags; uint16_t max_exchg; @@ -3843,6 +3844,9 @@ struct qla_hw_data { int port_down_retry_count; uint8_t mbx_count; uint8_t aen_mbx_count; + atomic_t num_pend_mbx_stage1; + atomic_t num_pend_mbx_stage2; + atomic_t num_pend_mbx_stage3; uint32_t login_retry_count; /* SNS command interfaces. */ @@ -4156,6 +4160,7 @@ struct qla_hw_data { struct work_struct board_disable; struct mr_data_fx00 mr; + uint32_t chip_reset; struct qlt_hw_data tgt; int allow_cna_fw_dump; diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index f94335301c70..7a984f5e6f11 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -6282,6 +6282,7 @@ qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha) ql_log(ql_log_info, vha, 0x00af, "Performing ISP error recovery - ha=%p.\n", ha); + ha->flags.purge_mbox = 1; /* For ISP82XX, reset_chip is just disabling interrupts. * Driver waits for the completion of the commands. * the interrupts need to be enabled. @@ -6296,13 +6297,31 @@ qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha) ha->current_topology = 0; ha->flags.fw_started = 0; ha->flags.fw_init_done = 0; - ha->base_qpair->chip_reset++; + ha->chip_reset++; + ha->base_qpair->chip_reset = ha->chip_reset; for (i = 0; i < ha->max_qpairs; i++) { if (ha->queue_pair_map[i]) ha->queue_pair_map[i]->chip_reset = ha->base_qpair->chip_reset; } + /* purge MBox commands */ + if (atomic_read(&ha->num_pend_mbx_stage3)) { + clear_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags); + complete(&ha->mbx_intr_comp); + } + + i = 0; + while (atomic_read(&ha->num_pend_mbx_stage3) || + atomic_read(&ha->num_pend_mbx_stage2) || + atomic_read(&ha->num_pend_mbx_stage1)) { + msleep(20); + i++; + if (i > 50) + break; + } + ha->flags.purge_mbox = 0; + atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); if (atomic_read(&vha->loop_state) != LOOP_DOWN) { atomic_set(&vha->loop_state, LOOP_DOWN); diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 17537f0b3b54..10847cdca093 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -110,6 +110,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) unsigned long wait_time; struct qla_hw_data *ha = vha->hw; scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev); + u32 chip_reset; ql_dbg(ql_dbg_mbx, vha, 0x1000, "Entered %s.\n", __func__); @@ -140,7 +141,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) rval = QLA_SUCCESS; abort_active = test_bit(ABORT_ISP_ACTIVE, &base_vha->dpc_flags); - + chip_reset = ha->chip_reset; if (ha->flags.pci_channel_io_perm_failure) { ql_log(ql_log_warn, vha, 0x1003, @@ -167,6 +168,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) return QLA_FUNCTION_TIMEOUT; } + atomic_inc(&ha->num_pend_mbx_stage1); /* * Wait for active mailbox commands to finish by waiting at most tov * seconds. This is to serialize actual issuing of mailbox cmds during @@ -177,8 +179,14 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) ql_log(ql_log_warn, vha, 0xd035, "Cmd access timeout, cmd=0x%x, Exiting.\n", mcp->mb[0]); + atomic_dec(&ha->num_pend_mbx_stage1); return QLA_FUNCTION_TIMEOUT; } + atomic_dec(&ha->num_pend_mbx_stage1); + if (ha->flags.purge_mbox || chip_reset != ha->chip_reset) { + rval = QLA_ABORTED; + goto premature_exit; + } ha->flags.mbox_busy = 1; /* Save mailbox command for debug */ @@ -189,6 +197,13 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) spin_lock_irqsave(&ha->hardware_lock, flags); + if (ha->flags.purge_mbox || chip_reset != ha->chip_reset) { + rval = QLA_ABORTED; + ha->flags.mbox_busy = 0; + spin_unlock_irqrestore(&ha->hardware_lock, flags); + goto premature_exit; + } + /* Load mailbox registers. */ if (IS_P3P_TYPE(ha)) optr = (uint16_t __iomem *)®->isp82.mailbox_in[0]; @@ -231,7 +246,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) "jiffies=%lx.\n", jiffies); /* Wait for mbx cmd completion until timeout */ - + atomic_inc(&ha->num_pend_mbx_stage2); if ((!abort_active && io_lock_on) || IS_NOPOLLING_TYPE(ha)) { set_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags); @@ -241,6 +256,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) spin_unlock_irqrestore(&ha->hardware_lock, flags); ha->flags.mbox_busy = 0; + atomic_dec(&ha->num_pend_mbx_stage2); ql_dbg(ql_dbg_mbx, vha, 0x1010, "Pending mailbox timeout, exiting.\n"); rval = QLA_FUNCTION_TIMEOUT; @@ -254,6 +270,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) spin_unlock_irqrestore(&ha->hardware_lock, flags); wait_time = jiffies; + atomic_inc(&ha->num_pend_mbx_stage3); if (!wait_for_completion_timeout(&ha->mbx_intr_comp, mcp->tov * HZ)) { ql_dbg(ql_dbg_mbx, vha, 0x117a, @@ -261,7 +278,17 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) spin_lock_irqsave(&ha->hardware_lock, flags); clear_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags); spin_unlock_irqrestore(&ha->hardware_lock, flags); + + } else if (ha->flags.purge_mbox || + chip_reset != ha->chip_reset) { + ha->flags.mbox_busy = 0; + atomic_dec(&ha->num_pend_mbx_stage2); + atomic_dec(&ha->num_pend_mbx_stage3); + rval = QLA_ABORTED; + goto premature_exit; } + atomic_dec(&ha->num_pend_mbx_stage3); + if (time_after(jiffies, wait_time + 5 * HZ)) ql_log(ql_log_warn, vha, 0x1015, "cmd=0x%x, waited %d msecs\n", command, jiffies_to_msecs(jiffies - wait_time)); @@ -275,6 +302,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) spin_unlock_irqrestore(&ha->hardware_lock, flags); ha->flags.mbox_busy = 0; + atomic_dec(&ha->num_pend_mbx_stage2); ql_dbg(ql_dbg_mbx, vha, 0x1012, "Pending mailbox timeout, exiting.\n"); rval = QLA_FUNCTION_TIMEOUT; @@ -289,6 +317,14 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) wait_time = jiffies + mcp->tov * HZ; /* wait at most tov secs */ while (!ha->flags.mbox_int) { + if (ha->flags.purge_mbox || + chip_reset != ha->chip_reset) { + ha->flags.mbox_busy = 0; + atomic_dec(&ha->num_pend_mbx_stage2); + rval = QLA_ABORTED; + goto premature_exit; + } + if (time_after(jiffies, wait_time)) break; @@ -312,6 +348,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) "Waited %d sec.\n", (uint)((jiffies - (wait_time - (mcp->tov * HZ)))/HZ)); } + atomic_dec(&ha->num_pend_mbx_stage2); /* Check whether we timed out */ if (ha->flags.mbox_int) { @@ -390,7 +427,8 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) /* Capture FW dump only, if PCI device active */ if (!pci_channel_offline(vha->hw->pdev)) { pci_read_config_word(ha->pdev, PCI_VENDOR_ID, &w); - if (w == 0xffff || ictrl == 0xffffffff) { + if (w == 0xffff || ictrl == 0xffffffff || + (chip_reset != ha->chip_reset)) { /* This is special case if there is unload * of driver happening and if PCI device go * into bad state due to PCI error condition @@ -497,7 +535,11 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) complete(&ha->mbx_cmd_comp); mbx_done: - if (rval) { + if (rval == QLA_ABORTED) { + ql_log(ql_log_info, vha, 0xd035, + "Chip Reset in progress. Purging Mbox cmd=0x%x.\n", + mcp->mb[0]); + } else if (rval) { if (ql2xextended_error_logging & (ql_dbg_disc|ql_dbg_mbx)) { pr_warn("%s [%s]-%04x:%ld: **** Failed", QL_MSGHDR, dev_name(&ha->pdev->dev), 0x1020+0x800, diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index e218d68de532..04e0c7f51e68 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -2815,6 +2815,9 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ha->link_data_rate = PORT_SPEED_UNKNOWN; ha->optrom_size = OPTROM_SIZE_2300; ha->max_exchg = FW_MAX_EXCHANGES_CNT; + atomic_set(&ha->num_pend_mbx_stage1, 0); + atomic_set(&ha->num_pend_mbx_stage2, 0); + atomic_set(&ha->num_pend_mbx_stage3, 0); /* Assign ISP specific operations. */ if (IS_QLA2100(ha)) { From patchwork Wed Aug 1 06:13:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10551749 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 21ED01822 for ; Wed, 1 Aug 2018 06:13:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11D582A5FC for ; Wed, 1 Aug 2018 06:13:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 063A52A64D; Wed, 1 Aug 2018 06:13:52 +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 83E3E2A5FC for ; Wed, 1 Aug 2018 06:13:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733213AbeHAH5s (ORCPT ); Wed, 1 Aug 2018 03:57:48 -0400 Received: from mail-co1nam03on0061.outbound.protection.outlook.com ([104.47.40.61]:11199 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733192AbeHAH5s (ORCPT ); Wed, 1 Aug 2018 03:57:48 -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=KBn17moMSoV7prm30SawXzlwX+QON0zoK5a9MZkcIWE=; b=dg1p2XZFza7lg4LEeAaXBc8mptR2g65S+PH5clJcc5oUWHlLUDmwWQhjRD1LqXYG/M7Mk0sQjsAnG8FGXe5r5XBUKNr0dEUZj/ODsW4qMkovaQY/ecXRnwS53hVZ/n9pExSVjKShCeQhls26c/Szz+U6OVGJZCoqUqi5hS5BChE= Received: from SN4PR0701CA0007.namprd07.prod.outlook.com (2603:10b6:803:28::17) by SN1PR07MB4077.namprd07.prod.outlook.com (2603:10b6:802:2c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.14; Wed, 1 Aug 2018 06:13:49 +0000 Received: from BY2NAM05FT053.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::207) by SN4PR0701CA0007.outlook.office365.com (2603:10b6:803:28::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.14 via Frontend Transport; Wed, 1 Aug 2018 06:13:49 +0000 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 BY2NAM05FT053.mail.protection.outlook.com (10.152.100.190) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Wed, 1 Aug 2018 06:13:48 +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, 31 Jul 2018 23:13:37 -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 w716DcLs028789; Tue, 31 Jul 2018 23:13:38 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w716DcVJ028788; Tue, 31 Jul 2018 23:13:38 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 11/16] qla2xxx: Fix Management Server NPort handle reservation logic Date: Tue, 31 Jul 2018 23:13:30 -0700 Message-ID: <20180801061335.28709-12-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180801061335.28709-1-himanshu.madhani@cavium.com> References: <20180801061335.28709-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)(376002)(396003)(346002)(136003)(39850400004)(2980300002)(438002)(199004)(189003)(110136005)(54906003)(8676002)(81166006)(81156014)(5660300001)(50226002)(8936002)(52396003)(305945005)(6666003)(316002)(356003)(16586007)(42186006)(80596001)(69596002)(4326008)(51416003)(47776003)(186003)(44832011)(478600001)(48376002)(11346002)(50466002)(72206003)(106466001)(336012)(126002)(476003)(14444005)(76176011)(106002)(2906002)(1076002)(36756003)(446003)(87636003)(486006)(575784001)(86362001)(6346003)(26005)(2616005);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR07MB4077;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;BY2NAM05FT053;1:Z/VsnJFran8u1dxn4b6zEBkaQXqS0N4FFs3EVpXxSyXmqaWiK63N+Zb45zYvUBdOiae+kepWtdKQzTF/sWdVDPhBSqZx8okSHY0+8YlXPT/yX/4d2A4vahcgQV8VcySK X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 463db2b0-c0c0-4e27-0266-08d5f775f21d X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:SN1PR07MB4077; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB4077;3:Niis/i2hUmjg0rK508ICtUlGj73WShqwpNlTvuMX0kQkIFqGuJjmAl8xH8MCU3rehYHQchSDVH2a7x/kh+Y//yEFMxxztBwP0N0d+R2kM91OB5xjyyx5ZEqnJzPXugUbH+EBVePdDNcL8yDW5SGhDx2t3+t/xF+U4n2gPHWV5NQUoj7s+AXXQbCm/87l9OcmXh8gvF7BS3Kq0Q4piPJZojRRWiCsL1z6aDSAJ6glQCPAFNF7RauMTSXVIN9ggsu7cTKqgkRLdTRQWlFrymrrfR4UYF8rjnHbXyMJN1tDvlP/JyWex6mNi0KhvB5jn9LcxY8k4q1COQMKKFuIUMowsvUQc4zMIEkI/MGQDwGCgsI=;25:sswpXQbsXoQ/JqgmEVggRWxzYWvBMMe3Sdcfrdfu7MK4KPuxpXswCRyiXlj9M6nYyrZrqH+HBQ6jRSk86qdXdktllB/8ho28DB+tb/ChkhnAR0noIlc0j3vUZELefuxj8824CobgXPe5WOIrNURJ8FG88PRr582PxuaJhnHNz9SQtPjYd1nX8Oayousq3LUlAIVaDfPTXdZ3lQIulpii/EKM0TUlmaZHiD8b3IgINHhZpQQHlW2FpH82UieZiq9xlHr2uBLLrToVFhf6Cc7zY5FscZOy2uW9znpRK0sWI2ZvIpIsaV1XbOWbrJNXQTwTPG3i+TyLE83vEtavClJVXQ== X-MS-TrafficTypeDiagnostic: SN1PR07MB4077: X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB4077;31:3WkjtW3CAQhQ8IJUX5J58VGVPpruzqprWdBC9PHecVrDwPLSMCUd7Kt2pAnMfCvG5ydScZOvt4ilvxKwj8P7lxvMN73WgDoVBWNgq/wfUjMcDF9Pr4iyrSfid4cOVHPXsLPDAK0jnWA0D4WLn60Ls8ZlDS64GidKVBOIkCZLRSr3kQJE/kv2kJXT85gtAsdf06TYWg6tnhVb3mTDGGAPgJPAMnBe49llO2gjgmWDEoE=;20:U8NNMW3xjDh0APLQxcInjic0KhSXn343qS0uc+zEjTfrs+06hOIL9UUnYIIFxe0tO/yIEubkJwAfTy43nTeAo3+KResgGXJBgGie64DorSKHB7vR/dUsDcKTEaOUOqukUTGDrcTZEHj8htRy0LT8g2tGGcctuCFvbLo3r0ZB/RgRCs4zXU4NraT9NiTYRoaRlIKsU4gEqCvlCWMyE1AFWUfVAmHLNIbdkuiTCKcBOMifY/LfLov2pNzp4tmkaae2RDPnaCU8+YuaDiHFVp98B3FrbqcBRLT6KlS/W/8spq0vDI7P3ZnXkKmS3BVIq3oAzPcRbLTP8MgERwCvRTSgnRDjR0luiTppxJrzpR0DPKtMavO/Ffm1gOYzs6XCNIIro/Wv2L7wgvI4bDrlKLRdLFXIUWsN/1duI+aH2KENLyw0Af3VpVbrZjbOfqqXspho3drJao39f16EmjAxgnE+YvKjT4Gb4a35KkkgXg8L9osMDGdpuKxTPW/hVSzwwTbf X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(158342451672863); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93004095)(3002001)(10201501046)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:SN1PR07MB4077;BCL:0;PCL:0;RULEID:;SRVR:SN1PR07MB4077; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB4077;4:FFZqpvgIqYEFeHV2Gt+eqE7fJzIwe2sLTASK/nUknsFRjpDPub9okPWNpS/NkopnDzKf7yxBUanKq+8YwoBI62lKyz+yLYYCraaHbIxdv7M4x3+54DaynKHjNqAJ6XZ8sYFfQUL7MAYhJMUM+/xPtb7aZ6YBsD3UfmPgGy4EwHhYOMMhthJG+I4i0ELvB8CzG5ZIMH1FR9vFKL3d8Od2tVMWBmvkz60MHetH9K+GgLPoIgEtfOlB7gFSKxHoYzZpC9811M6qcO+adJTqy85sn0COmstYO+pzOj6ZmVyoaOos1ZaGWNyNiRu5WJoWbTFU X-Forefront-PRVS: 0751474A44 X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB4077;23:sBgw/Xn2LmDagt17uiuT2ryODuRErthbltvsNEaeuMHO1WJ2zLNhquxMFFQ+KlyI3COzQSkX0GkvetCNrMMh7wFWW4/PQHevA0946aLN0R1gIItm0hrLIYP7KjKY1Em7Py+xulPJUEJ7csxwUytq9UnuFji2+FKBbClmmLJASRkbu6uHxtkST6VIZw9G5LldscKrYYKHnCsI7P4E8Wb7Gr/62oz1IcPJfgeU9K0yknhQGNoM4fge30qQ/NXvWce00KwDWkxZYa8kPkrlxta7HupNj67MlPlgebIekyF9rFWun5+7LAAX2+v/X8Y8VNYFCU0gZo1UjqZS2JXbms8kMcDBykeaT5B1qmg+BxqmHd4tLPTe4AcJcOi9m5xlZ3w/DPidCFCePfy07JwA62riCEvJplp1i+HPf04D+11gGwS3137/9Shp3PsXDSyEZNL3ZDeVmf5CsiWaiam1wTMHe19UO2HJJYd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S7y8ikDXXj8anNltFkXUlTmPwPrcKzUICW+s= X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB4077;6:k7IUuOKcGA6BpxpbxtqNodxWlBmlDrCOKCARj5I4+oGEJLmw3Svt5i8tlhytdalU1rze+aKQIZ7EgjPX2KqqodhRX1gU+TfJ66kEgEY9OgRwYVluz1S/MUjK4r86///s2BEG6frB+fY82tKjBA8k+BMMm6INkMbqVIr6QLiSQROR3CRSWvjTDLxpW6xpnyL5vGi+fXg+tZlV4Neatqb9YSTa/lmgTsQpoM3OXepZw2n2RmhPNxzLngdVFq1E2RlsKlSEDyajBY3/q+8w1bAdUy5U+76DxKk3/UIsDxf5Bu2pXcY4TvCdQEpF0KJLiBJekJ3rZe0QemsZixyhX0h/LzTnT1+9NIYkT1lF5Oi1b1+Q2hD2sRwhBkBRfQLlvoAt9b1Tw0QkSYttR4U5Godgs+kLuUCJGMd4I9JJfSsE39i+vswxko4XK5aL7NlvpRVyOH9y4zYEaeILVK+NPhBQsw==;5:mhEqbzj51M7iNN4UtsH2wRLlkNiALUE4OIi/Jgd6KpI8d6LKysTLJeXSGUEz8ZXsK7RbLn1QjODCNt4ZkZvMx18l4PBzuxaEnLTStDcVsUAj9EXMaiC//iIJIUnMtr+3CT+BYTAXdSWLxYBgYDD7zHpEzM4H4zlP5dS9g3uFod8=;7:fVFjziTOStBYL+bhqMlI9pKvSjYUTTXrchYa3sY/3dMG8ddw77tFTfrA5WXo88CqoftJ5iMnBS0IGFo2jhtFpWFKQa0CPyXdwwUYTjnfr0zlr1PzRzkR71PgzEtQiGSz0u+orWkGpGLuMQ7KnYF/bqsSfQYm5cUFLP7bovKreBtFdQwRYPZIE7Xt6Wkgg32jsoyNE1JGHOT122xd0yia1jFC+M2JcUyaVE8qC0UczC/U5MUe6lpOmdZR5rMCSiPI SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 06:13:48.5827 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 463db2b0-c0c0-4e27-0266-08d5f775f21d 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: SN1PR07MB4077 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 After selecting the NPort handle/loop_id, set a bit in the loop_id_map to prevent others from selecting the same NPort handle. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_gbl.h | 1 + drivers/scsi/qla2xxx/qla_init.c | 28 ++++++++++++++++++++++++++++ drivers/scsi/qla2xxx/qla_mid.c | 2 +- drivers/scsi/qla2xxx/qla_os.c | 3 ++- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index f68eb6096559..00fbd49a9a7a 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -118,6 +118,7 @@ extern int qla2x00_post_async_prlo_done_work(struct scsi_qla_host *, fc_port_t *, uint16_t *); int qla_post_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport); void qla_do_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport); +int qla2x00_reserve_mgmt_server_loop_id(scsi_qla_host_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 7a984f5e6f11..e92f60a73bc3 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -5615,6 +5615,34 @@ qla2x00_find_new_loop_id(scsi_qla_host_t *vha, fc_port_t *dev) } +/* FW does not set aside Loop id for MGMT Server/FFFFFAh */ +int +qla2x00_reserve_mgmt_server_loop_id(scsi_qla_host_t *vha) +{ + int loop_id = FC_NO_LOOP_ID; + int lid = NPH_MGMT_SERVER - vha->vp_idx; + unsigned long flags; + struct qla_hw_data *ha = vha->hw; + + if (vha->vp_idx == 0) { + set_bit(NPH_MGMT_SERVER, ha->loop_id_map); + return NPH_MGMT_SERVER; + } + + /* pick id from high and work down to low */ + spin_lock_irqsave(&ha->vport_slock, flags); + for (; lid > 0; lid--) { + if (!test_bit(lid, vha->hw->loop_id_map)) { + set_bit(lid, vha->hw->loop_id_map); + loop_id = lid; + break; + } + } + spin_unlock_irqrestore(&ha->vport_slock, flags); + + return loop_id; +} + /* * qla2x00_fabric_login * Issue fabric login command. diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index f6f0a759a7c2..14bc88bc4a5a 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c @@ -485,7 +485,7 @@ qla24xx_create_vhost(struct fc_vport *fc_vport) "Couldn't allocate vp_id.\n"); goto create_vhost_failed; } - vha->mgmt_svr_loop_id = NPH_MGMT_SERVER; + vha->mgmt_svr_loop_id = qla2x00_reserve_mgmt_server_loop_id(vha); vha->dpc_flags = 0L; diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 04e0c7f51e68..48d1003c8178 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -3048,7 +3048,8 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) host = base_vha->host; base_vha->req = req; if (IS_QLA2XXX_MIDTYPE(ha)) - base_vha->mgmt_svr_loop_id = NPH_MGMT_SERVER; + base_vha->mgmt_svr_loop_id = + qla2x00_reserve_mgmt_server_loop_id(base_vha); else base_vha->mgmt_svr_loop_id = MANAGEMENT_SERVER + base_vha->vp_idx; From patchwork Wed Aug 1 06:13:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10551757 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 A6BCC1708 for ; Wed, 1 Aug 2018 06:13:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 962662A5FC for ; Wed, 1 Aug 2018 06:13:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A8782A64D; Wed, 1 Aug 2018 06:13:58 +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 DB9032A5FC for ; Wed, 1 Aug 2018 06:13:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733237AbeHAH5y (ORCPT ); Wed, 1 Aug 2018 03:57:54 -0400 Received: from mail-sn1nam01on0046.outbound.protection.outlook.com ([104.47.32.46]:9984 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733192AbeHAH5y (ORCPT ); Wed, 1 Aug 2018 03:57:54 -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=vaURhft9TNxojcJOSshPQDonXV/1FJ1uyP6fb+S6Nk8=; b=Mk5O3oK9gAwuMttcwWj+gCBqM4BAPm7NdWHNlDZU8EAeiXNQxj4Rq8ntk8y3JbMpUzwwTbjR+4rLbNFW8csEGnyvfgm+NidIxeaXwU7/8UXvdEQ+jUs0dXC3ViZ5jQNjvOAUA0xGelZVfyjXjBwRudL8JkfxjA6MGFYxMTG+3ok= Received: from SN4PR0701CA0007.namprd07.prod.outlook.com (2603:10b6:803:28::17) by SN1PR07MB1470.namprd07.prod.outlook.com (2a01:111:e400:5838::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.14; Wed, 1 Aug 2018 06:13:50 +0000 Received: from BY2NAM05FT053.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::207) by SN4PR0701CA0007.outlook.office365.com (2603:10b6:803:28::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.14 via Frontend Transport; Wed, 1 Aug 2018 06:13:49 +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 BY2NAM05FT053.mail.protection.outlook.com (10.152.100.190) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Wed, 1 Aug 2018 06:13:49 +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, 31 Jul 2018 23:13:37 -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 w716DcR9028793; Tue, 31 Jul 2018 23:13:38 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w716Dcre028792; Tue, 31 Jul 2018 23:13:38 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 12/16] qla2xxx: Fix race between switch cmd completion and timeout Date: Tue, 31 Jul 2018 23:13:31 -0700 Message-ID: <20180801061335.28709-13-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180801061335.28709-1-himanshu.madhani@cavium.com> References: <20180801061335.28709-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)(979002)(396003)(376002)(136003)(39850400004)(346002)(2980300002)(438002)(199004)(189003)(8676002)(50466002)(316002)(87636003)(8936002)(305945005)(6666003)(52396003)(44832011)(51416003)(356003)(2616005)(86362001)(14444005)(76176011)(47776003)(72206003)(48376002)(42186006)(11346002)(478600001)(69596002)(16586007)(80596001)(126002)(110136005)(1076002)(81156014)(81166006)(476003)(486006)(4326008)(446003)(106002)(336012)(2906002)(36756003)(106466001)(5660300001)(26005)(186003)(50226002)(54906003)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR07MB1470;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;BY2NAM05FT053;1:tN3c/JBUKT69Z5jLF7gFpiqfdoR0ADga4kBl03DVPyktC85dgmTpN2LOFzqNfbYU/lyIYF3hJ2vR6UsW92yVJHjHQp+xt2Yz9HFjisil5XwGVJ2b0fra07p7fjqn5eBA X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bcc6ab4c-7a67-4537-39c4-08d5f775f294 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:SN1PR07MB1470; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1470;3:fH+rtyzdUJXM8XTd97JN1Y8fi5x5BCMMYZBEMFqJe9Fjelj8A1x7Egxp2J21pemVWZ4QgmhB++tdzmXbB59v/Lo8lz9ug4sELzjYvXr14rXbkw3/gkwHE/qkZESQjhIOd1B+KpIFxQ6HCk1YtARLPnKe9BqTbqW64mLqtNwCosobX7rnb3ctbuIGlfswY/EUmdpGqHYq8ZXE5ih803J9YCQQvs8VJBlS7v2MkM45FjKrf+dvIK9lBf7K6W0ygUeGURArFRA089ZkxzWr+Zt1dWmVXPjJftECJYyd+RM/9551/1aWIzItix7QhAFdRVv1fR3lFCrKZWzh5pbNJC/zss2TE+7MiTbrPOEV+Haa2/U=;25:3K8XvV/WT4jY+aJ4aHBSL+FBF+LpBlD0qtmkdKsOPwM7tC20QkbcvwkysLIpO4oAE5tQD4m5jWvAyjR9dBF25YawESZHkANN9//6W+uU0nGUqfVSWDvMcTR+qUS1E19TzC7n5YHgFja1vJfYIQHqOC1s48cEezf+GvRQbHNQTOS5Oa1GEcrqJSoeCwRvxudMDoi9t1GxIjVLRnsOAPnDaHoNpTv+v0g0axh8BM8j06w6Rny/lqaHkKwtUfxEGJMYG6fgk8Cl38WbGvckaUE3zN3ujKKMQ3D/DeetYcFht3dLv45aAarRXjFu/ZnpG18zVRRc9MkzyBYUE+fFXCo3NQ== X-MS-TrafficTypeDiagnostic: SN1PR07MB1470: X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1470;31:/n0IvUDJ0/rLhUTwSEKwDvtsbyDRuA+FbJyCc5ONDFj+soIO94DbkJh7Xa18zixB74YJEun/TsrLs+wr2A/Yn+D51k72gk8NVNUfHjkBIrNmceUac9KfrenxkBdZBInFZkrOrDzjT2FXen/8OcvIxVSsgsyLDG7L6HISoRjQvEfLl7uEwL69XfU8F8kTfoneGi1KuCuLT3mqmDNIE/IS6gEQsStz85CaSWRAO2DfmMo=;20:q9KSOrF03jYNHH1TiUHnxRoxHJwA8az+pK6vkDV3rr2w8hkuS/QzRLKX+cQgm9SYEibX+mMaPs/2+VElP7xk72o8rJ9b33+ah+kequXT/lKlUsGmXhlFmUGwxU7k2b6/7PYwJPYG8R/CH7Z19mtJo8l4yosylGY/myZRC9acjYvtcO+z/0dCe8tI8FYgjs4NOBOY0eXKGo8W8d61aFet/WI1Tb6mNz8gggtzaYTGhVZ6kTjN0Jis7v2jdSaHj0kE32vM47S3eFoz7ToVAXShRtdkDdGCmAEuSfcD5TqV3QaNN3XyC4aWmrs8AxOMaDzqIyoWHaz36tNCZjXYD1fc+noeFHXg58GwgZnDKS1ph0YvBw2tqP3XEstkq4lpP1dfdoFH2zvTxm1TRZ0v1Rey0OBaeNdo5RVxygrkOvjvzrCO+1ppvoPSHifPiVo62zAKWp6J2w0iwSCev/FYhJAsM3d4VtgcIlLkZqKIGyEBb7hvE9FIPlYbobkjtInjcU4Y 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)(8121501046)(5005006)(3002001)(93006095)(93004095)(10201501046)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:SN1PR07MB1470;BCL:0;PCL:0;RULEID:;SRVR:SN1PR07MB1470; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1470;4:pDTKOnpgAqGwFTxIyIWSXGz2sBHq5zRovuxMJTWSqge9bRfk1QPb2UAUkkZV9YynC3hdnz+tRmwluNiszZACYYpuXho22vP0iuwDR4t4iVJkulmjbU7Ec99Wpv37NsVfB8g1Vm4p3120NaK74jIavxqTYBFfViQqsxZg53au9uVrln2/d4FpP03/BJHmYel/Sw4+x/ScoKhiTEOkxbIc5XqoFtk0szyJaCXFbmykdYCVW0VIAzLZVal3/oBhsxwPMj1SgB9VWO/9DtGEonXVbw== X-Forefront-PRVS: 0751474A44 X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1470;23:LXkuDE4VQQwSM5AH3z9RGYsMe+CGNnFJ/zfTSXsBsgA+UTngURFjCc1+O9GYLQv59cdilhzzSzQUAQJMG7yEHCgd2of1qV/KRRGxcLGAgCL3coYn5UapED7VoUnOCZfM+ULThKI282KQ7vhYINX54hBw4jscOFd5u09MHdrf7zgpiIwwe8b+wFRRVf2XLyvzMvKxVvUFNeZRjhLn29xejZGl3P2SE2PVthjGw9iyrusHqEOI8rO61jNsAKLLb4EQcQ5O1PWP04O0cK8LAJgGLW+zixVdAZPu+sT7tdX1IN9renXV45RLkChkbmDIqCpF0qZQ8NZEzk8d/bMeQqVPJhH8mfdF2xu8oiCHYl4ohTIDBJeSAOx9/amzdoRdROR9OlxLuR/1wraHi7Oj//xwiNCA2tKFPcexBd8U1nmPEgbp7yNASgF7cIXA2say9+8iAfMzyqu/xzdKVnRiSdwJciT/E02+MA5LKhIdXHQ0wEFXtpnPn2FrO0uRzUnfgT3vLjP7cTrAotvCXuKr/8Tu5XqpKL4o5t+CP253kShgBY8uWbeUyWNSCk3LC25nc5cH3AoLXEbM9Dts+ONYN2djE3rDzYIA38XVxaaQqfhIq4F92P/8Yr7AA7OfexEwf+244R/Kii3qz8H5wiuaWaERftr01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JGPapOddCK5SY0YGz67Zx9yrYkXEuWYSC1UMz3vsPi7uT0hyohNMvYixNcS8/8CMhkKosVgSxTKMLf29rXNQ9n/VLLf6a8wnjEFtUr07W5L01/ti+Ti1iwMGIFNA+Y8aKhKHJRL69EvmXiKI/jMg8XaWZvNhzZOzInVOgokUre7ajiyffY4/YCOKRm9uWMSCoZzD2QCso5IYhgESNpbbKv638ov7HxQ42vz1OthKUaIMqgmhv9cWiT6DdsWDcnBBOo2EM/8qOEKvIDv4X7AjKUZWnF6f8SHhqLZKAjJl9SGcxy1KCn+YPlGQw2oKyxzYGdhvMdlpWoSsTv8b+aL2FNaGz4g1qPZgDVFDFjQqp4zMW6+3oNAgWR69EG0BYLvuEd9XvSUW7Ro2Nhqg==;5:XzPlqbz76KwcajETKkxTwCS/pEteJu7rGPFJphNFuVds1vFfrFRMqifbz0g0IwLKUyu/OIRY8Qp2I6oqoDcDp7BaIpwGkvg6moVX+DhUX6tYavj6AIcRk0sev9ymyjqekCpH4giXsNsAKpOllYGluM2zzDQZ7u1zRryVl52PPB4=;7:QeQffeSYfMmddzpk5kbp4RKOQ1veMuGkvQsHYnqERD7CtYS292/9p3mIxzASc6Yb6akAjecV/TbS/a/ecBkXHTAooz6oyoRUA6eXJ031XxcDdp4bh2ArNkHZMbSBgjN1EtKrTalsreS/CDgz9lmUUt3C4J/eRW7bY8tULuGSQU+PdfFWlgNo8yFM0dS5PwosbvIY4MRs/yWSznqUHxNvyY3mnzcwBGall1RJ3caEEA9AiLuZ40hdGF0QM+LQSr+5 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 06:13:49.3796 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bcc6ab4c-7a67-4537-39c4-08d5f775f294 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: SN1PR07MB1470 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 Fix race condition between switch cmd completion and timeout timer. Timer has popped triggers command free. On IOCB completion, stale sp point was reused. Instead, an abort will be sent to FW to nudge the command out of FW, where the normal completion will take place. RIP: 0010:qla2x00_chk_ms_status+0xf3/0x1b0 [qla2xxx] Call Trace: qla24xx_els_ct_entry.isra.15+0x1d4/0x2b0 [qla2xxx] qla24xx_msix_rsp_q+0x39/0xf0 [qla2xxx] qla24xx_process_response_queue+0xbc/0x2b0 [qla2xxx] qla24xx_msix_rsp_q+0x8a/0xf0 [qla2xxx] __handle_irq_event_percpu+0xa0/0x1f0 Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 1 + drivers/scsi/qla2xxx/qla_gbl.h | 2 +- drivers/scsi/qla2xxx/qla_init.c | 75 ++++++++++++++++++++++++++++++----------- 3 files changed, 58 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 40bcf938cf4f..0fc563572fad 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -313,6 +313,7 @@ struct srb_cmd { #define SRB_CRC_CTX_DMA_VALID BIT_2 /* DIF: context DMA valid */ #define SRB_CRC_PROT_DMA_VALID BIT_4 /* DIF: prot DMA valid */ #define SRB_CRC_CTX_DSD_VALID BIT_5 /* DIF: dsd_list valid */ +#define SRB_WAKEUP_ON_COMP BIT_6 /* To identify if a srb is of T10-CRC type. @sp => srb_t pointer */ #define IS_PROT_IO(sp) (sp->flags & SRB_CRC_CTX_DSD_VALID) diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 00fbd49a9a7a..6f2a37220a55 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -213,7 +213,7 @@ extern int qla24xx_post_upd_fcport_work(struct scsi_qla_host *, fc_port_t *); void qla2x00_handle_login_done_event(struct scsi_qla_host *, fc_port_t *, uint16_t *); int qla24xx_post_gnl_work(struct scsi_qla_host *, fc_port_t *); -int qla24xx_async_abort_cmd(srb_t *); +int qla24xx_async_abort_cmd(srb_t *, bool); int qla24xx_post_relogin_work(struct scsi_qla_host *vha); /* diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index e92f60a73bc3..b5c1a1dea087 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -50,16 +50,15 @@ qla2x00_sp_timeout(struct timer_list *t) { srb_t *sp = from_timer(sp, t, u.iocb_cmd.timer); struct srb_iocb *iocb; - scsi_qla_host_t *vha = sp->vha; struct req_que *req; unsigned long flags; - spin_lock_irqsave(&vha->hw->hardware_lock, flags); - req = vha->hw->req_q_map[0]; + spin_lock_irqsave(sp->qpair->qp_lock_ptr, flags); + req = sp->qpair->req; req->outstanding_cmds[sp->handle] = NULL; iocb = &sp->u.iocb_cmd; + spin_unlock_irqrestore(sp->qpair->qp_lock_ptr, flags); iocb->timeout(sp); - spin_unlock_irqrestore(&vha->hw->hardware_lock, flags); } void @@ -100,6 +99,8 @@ qla2x00_async_iocb_timeout(void *data) srb_t *sp = data; fc_port_t *fcport = sp->fcport; struct srb_iocb *lio = &sp->u.iocb_cmd; + int rc, h; + unsigned long flags; if (fcport) { ql_dbg(ql_dbg_disc, fcport->vha, 0x2071, @@ -114,11 +115,26 @@ qla2x00_async_iocb_timeout(void *data) switch (sp->type) { case SRB_LOGIN_CMD: - /* Retry as needed. */ - lio->u.logio.data[0] = MBS_COMMAND_ERROR; - lio->u.logio.data[1] = lio->u.logio.flags & SRB_LOGIN_RETRIED ? - QLA_LOGIO_LOGIN_RETRIED : 0; - sp->done(sp, QLA_FUNCTION_TIMEOUT); + rc = qla24xx_async_abort_cmd(sp, false); + if (rc) { + /* Retry as needed. */ + lio->u.logio.data[0] = MBS_COMMAND_ERROR; + lio->u.logio.data[1] = + lio->u.logio.flags & SRB_LOGIN_RETRIED ? + QLA_LOGIO_LOGIN_RETRIED : 0; + spin_lock_irqsave(sp->qpair->qp_lock_ptr, flags); + for (h = 1; h < sp->qpair->req->num_outstanding_cmds; + h++) { + if (sp->qpair->req->outstanding_cmds[h] == + sp) { + sp->qpair->req->outstanding_cmds[h] = + NULL; + break; + } + } + spin_unlock_irqrestore(sp->qpair->qp_lock_ptr, flags); + sp->done(sp, QLA_FUNCTION_TIMEOUT); + } break; case SRB_LOGOUT_CMD: case SRB_CT_PTHRU_CMD: @@ -127,7 +143,21 @@ qla2x00_async_iocb_timeout(void *data) case SRB_NACK_PRLI: case SRB_NACK_LOGO: case SRB_CTRL_VP: - sp->done(sp, QLA_FUNCTION_TIMEOUT); + rc = qla24xx_async_abort_cmd(sp, false); + if (rc) { + spin_lock_irqsave(sp->qpair->qp_lock_ptr, flags); + for (h = 1; h < sp->qpair->req->num_outstanding_cmds; + h++) { + if (sp->qpair->req->outstanding_cmds[h] == + sp) { + sp->qpair->req->outstanding_cmds[h] = + NULL; + break; + } + } + spin_unlock_irqrestore(sp->qpair->qp_lock_ptr, flags); + sp->done(sp, QLA_FUNCTION_TIMEOUT); + } break; } } @@ -1593,7 +1623,7 @@ qla24xx_abort_iocb_timeout(void *data) struct srb_iocb *abt = &sp->u.iocb_cmd; abt->u.abt.comp_status = CS_TIMEOUT; - complete(&abt->u.abt.comp); + sp->done(sp, QLA_FUNCTION_TIMEOUT); } static void @@ -1602,12 +1632,16 @@ qla24xx_abort_sp_done(void *ptr, int res) srb_t *sp = ptr; struct srb_iocb *abt = &sp->u.iocb_cmd; - if (del_timer(&sp->u.iocb_cmd.timer)) - complete(&abt->u.abt.comp); + if (del_timer(&sp->u.iocb_cmd.timer)) { + if (sp->flags & SRB_WAKEUP_ON_COMP) + complete(&abt->u.abt.comp); + else + sp->free(sp); + } } int -qla24xx_async_abort_cmd(srb_t *cmd_sp) +qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait) { scsi_qla_host_t *vha = cmd_sp->vha; fc_port_t *fcport = cmd_sp->fcport; @@ -1622,6 +1656,8 @@ qla24xx_async_abort_cmd(srb_t *cmd_sp) abt_iocb = &sp->u.iocb_cmd; sp->type = SRB_ABT_CMD; sp->name = "abort"; + if (wait) + sp->flags = SRB_WAKEUP_ON_COMP; abt_iocb->timeout = qla24xx_abort_iocb_timeout; init_completion(&abt_iocb->u.abt.comp); @@ -1645,10 +1681,11 @@ qla24xx_async_abort_cmd(srb_t *cmd_sp) "Abort command issued - hdl=%x, target_id=%x\n", cmd_sp->handle, fcport->tgt_id); - wait_for_completion(&abt_iocb->u.abt.comp); - - rval = abt_iocb->u.abt.comp_status == CS_COMPLETE ? - QLA_SUCCESS : QLA_FUNCTION_FAILED; + if (wait) { + wait_for_completion(&abt_iocb->u.abt.comp); + rval = abt_iocb->u.abt.comp_status == CS_COMPLETE ? + QLA_SUCCESS : QLA_FUNCTION_FAILED; + } done_free_sp: sp->free(sp); @@ -1684,7 +1721,7 @@ qla24xx_async_abort_command(srb_t *sp) return qlafx00_fx_disc(vha, &vha->hw->mr.fcport, FXDISC_ABORT_IOCTL); - return qla24xx_async_abort_cmd(sp); + return qla24xx_async_abort_cmd(sp, true); } static void From patchwork Wed Aug 1 06:13:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10551755 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 9AEA996FA for ; Wed, 1 Aug 2018 06:13:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AED02A5FC for ; Wed, 1 Aug 2018 06:13:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F5742A64D; Wed, 1 Aug 2018 06:13:54 +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 15F9A2A5FC for ; Wed, 1 Aug 2018 06:13:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733232AbeHAH5u (ORCPT ); Wed, 1 Aug 2018 03:57:50 -0400 Received: from mail-by2nam01on0067.outbound.protection.outlook.com ([104.47.34.67]:40224 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733143AbeHAH5u (ORCPT ); Wed, 1 Aug 2018 03:57:50 -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=V0yM8RIFoyUQCxO8FpXez7DZJlWzTfROf7wip0sNASw=; b=LLQFxeTWa6cARidxEDMzDxkPn0qhgTLjKlBYgnkHdqFwl6XjPBzws24Ehuhr3qCMZdfvZEEvSHJ8psoOiUnBIiyT6NYfa4GbxRaPVqr11HMde7stAI+Y2dJ2HlCHANxZXOzqL+whlCz+JEaWXf9ce9WTWBij6iCftYTuuvN6/0A= Received: from SN4PR0701CA0001.namprd07.prod.outlook.com (2603:10b6:803:28::11) by BN3PR0701MB1378.namprd07.prod.outlook.com (2a01:111:e400:4018::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.19; Wed, 1 Aug 2018 06:13:51 +0000 Received: from BY2NAM05FT053.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::203) by SN4PR0701CA0001.outlook.office365.com (2603:10b6:803:28::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.14 via Frontend Transport; Wed, 1 Aug 2018 06:13:50 +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 BY2NAM05FT053.mail.protection.outlook.com (10.152.100.190) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Wed, 1 Aug 2018 06:13:50 +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, 31 Jul 2018 23:13:37 -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 w716Dc9X028797; Tue, 31 Jul 2018 23:13:38 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w716DcBs028796; Tue, 31 Jul 2018 23:13:38 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 13/16] qla2xxx: Fix stalled relogin Date: Tue, 31 Jul 2018 23:13:32 -0700 Message-ID: <20180801061335.28709-14-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180801061335.28709-1-himanshu.madhani@cavium.com> References: <20180801061335.28709-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)(396003)(376002)(136003)(39860400002)(346002)(2980300002)(438002)(189003)(199004)(446003)(4326008)(47776003)(48376002)(110136005)(50466002)(16586007)(42186006)(476003)(6666003)(80596001)(36756003)(44832011)(54906003)(2616005)(486006)(69596002)(11346002)(50226002)(26005)(106002)(5660300001)(126002)(316002)(52396003)(478600001)(106466001)(76176011)(81166006)(575784001)(72206003)(81156014)(87636003)(86362001)(2906002)(8936002)(305945005)(1076002)(8676002)(51416003)(356003)(14444005)(186003)(336012);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR0701MB1378;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;BY2NAM05FT053;1:hG7NLHoJXfKiUISime7jZqYIq25iSyt9K2yxTINJR+Cae4H29MiLMdKDpW+TLaM0gYUe58waqDlRyQ0rPbeQ5jAfgvhzzT3vqRS5xIlu8vPZn6w2QDYCmnEm8rIVpIQK X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b8b9f452-eec3-49ce-fa81-08d5f775f314 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BN3PR0701MB1378; X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;3:DdRaKY5pB0XGq7/BimhcB3cypd2DpjbSkLEFG8r+Szwrzq5hRGEnY9HBq2ub2fGJyGDQjsK+khraQTnaoTScaPjpWPT+wKyKnx0D11y+RxCqt7FW9YvNAUCoX5tzehcgI2rDzxEUvkD+fGNLCOaFt32yd6IZYcv5ppKKqlvzdy25tcm/gWJKL2AO0PCuPIasdrv9xir5F3S49elVtcm7g8s35Qmkde7J1Lgv7fRXltNaknSyDWaCk9ecQwIAhL10mHBe3rLLZ1xfRvaFAxp3ksYpsVJc5Mmo9leY2e0WKL/1r9fTbpM6itSq+WIqoKZzq/qrc7LvuzBx/LJtwa9ZF4YABSj/Fo4Ggbqe2g+it28=;25:tpTF9BrGcrwOqSaVo8S0P1JxvWpOOFRnfNetJgkImBU/csIuoh6o4BjPZgSuGpZM6dtyYgscXqat7lgwpVHJUEaL4Ia/1awvV0LbKgGWH9BHORxjdCgd7m35OgmELC0BRElBcLQsSFlnwUMnV+iakT1lGMsOkrJKU8ae9qEnpP38kbWAbI6erGkQg21enX90eguMHBNFBEWAZXA3P5bBTBhq+yccZKexCBZxqtfW/EXIlBkkrBkK/DgWxv/rqRb9qMOLu/8jLMudHZ+do59X4TUl04Cy3K6xgkejD/1rs13+E9VeriCNOeDF5KXAouXSdS41avBfAt52NNqE5iWLEA== X-MS-TrafficTypeDiagnostic: BN3PR0701MB1378: X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;31:d/rd82eLGwHiNGWINhWkCEiSUGEb9Tj3LsKl2ZycfhlszkVf7EK9wXMzWBy8Tklfn6dp9F7ZUmRiiTETRRUHzf44T/bp88PtuTqXBZ7pobvZehV/fSLp8uEdn3po0XrxNsvs+l1U+XPUG+R+FokN+ULIu9XyGFvi8Rl4hubYnIF5qYDC7HlfWC60Z+jG9TTJGAaOnNG7+yd5kyCCfjdATirqKrKkqZ+n4RZYVGKuZuM=;20:TPfXs9V280YZ5s4fZCpZIghzS2u6wT0eqDOwk0PDK0b+gorMeX6RNuM8bhZFcqQaeyvFzn+f4LDcxN9JFlgET6ibygzYUHhf85LXcya0XyvKMC9o00B8+w+6gQHQkEQI6D8K+TbZxGzo629LAwxbsCmeup8T39Vkg/Kfg/O8k66Zhg1YfsGJtbQToXrgcdk/VzX5EBARcJrxTnTRfikPQrbKCLCOrGzmSfrY7U4gzQhzAomjTKaw5mUNRi5Yz0UucMJBNF+f+qVhcWoN8yaxhfKq4Qdm9PGWFgy65Hhw9CGXqld5Lj2m9i13DKxrBMpzcldkL70hRN0Czk5F1fP75JSgADVubHiUiq3KEyclqXWSMeanbva4WiN/arIhfhc4n+fQeOhRdDClnASqdJRkW9aZrirhdhVO1qwJ8LIXWR6KZhtxpcGvrScCU/IwT/Iehyqs2bCdmqccO3PNYR/yuAVgau8il3/W8eTQwKhOb8niNzXC6juQWLJ1D6u9QXNA X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93004095)(10201501046)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:BN3PR0701MB1378;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1378; X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;4:5gdcNrsso0p2VwXyaem+fWmNogCQklNnLvu5KFcwiUJmjj00wfLC8UbBXODkdKUICo0rRx2tjbluZUSFcS0fG3H/RpFcl+S18ixvYhPs1pwhxQ1HMigG9T++yqpQnrq4sSIN7GjuzJgM/52EkAA4zCetycIyv7Wr0FdyOvHzN7vYvo53+SD6MBwEtbJCKagYQKfX5kAzpnebkbVTc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SEIpWSe2ashdRGbszzbS8lMsftn0GV3NmwnTepT7Uugg6MtKuNDG0gYzyt5QBPpZga7vpuJ5MV7Aassw7w==;5:W7q1YTS2gcXLKVdlJmWj4N4aWRwAKbhuPQOaLDxxRf9I+Qt2Ixp6Z8cgsXuqwfOy5ic5owXJSt0BX01IMn1rPFgxIf4S8ClZXKFxNKIgqgFMnqkZqJSuBdiSMLm4/oNbVn0iTcSAZKdRzuwF868KIRYYowJe2rc9I9QNHwrfM5g=;7:LNTM/lR3bAcHQ/GHYYL4nDywCYUJDnuF4QlWTWDRDpl5BraQMy8XLUyRIJBMnJ0lybhqEue8DfanYmdWUzsi4ibdH/5yctN/v42kxYZO1h/l0iQnmnXcsgGELYz22Ipz/wHQGSYQAX3Z0SWzUdjVSiysObXLOTwv9niwiAyg4LE89gwvMQNUEBCJG03EczlgS+paU0yGrXt5VG0B9pk1ogB8ysGv/WlWG9vx7MuA7rml2wSsZKCfanzAtKj4PTho SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 06:13:50.2234 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b8b9f452-eec3-49ce-fa81-08d5f775f314 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: BN3PR0701MB1378 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 This patch sets and clears FCF_ASYNC_{SENT|ACTIVE} flags to prevent stalling of relogin attempt. Once flag are correctly set/cleared, relogin timer can retry relogin attempt for driver to continue login. Fixes: fa83e65885b9 ("scsi: qla2xxx: ensure async flags are reset correctly") Cc: stable@vger.kernel.org #4.17 Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c | 2 +- drivers/scsi/qla2xxx/qla_iocb.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index b5c1a1dea087..a0c730bed312 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -431,7 +431,7 @@ qla2x00_async_adisc_sp_done(void *ptr, int res) "Async done-%s res %x %8phC\n", sp->name, res, sp->fcport->port_name); - sp->fcport->flags &= ~FCF_ASYNC_SENT; + sp->fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); memset(&ea, 0, sizeof(ea)); ea.event = FCME_ADISC_DONE; diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index e1ff2e27e59f..ba14db8d0b8d 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -2634,6 +2634,7 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, ql_dbg(ql_dbg_io, vha, 0x3073, "Enter: PLOGI portid=%06x\n", fcport->d_id.b24); + fcport->flags |= FCF_ASYNC_SENT; sp->type = SRB_ELS_DCMD; sp->name = "ELS_DCMD"; sp->fcport = fcport; From patchwork Wed Aug 1 06:13:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10551761 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 2895D1822 for ; Wed, 1 Aug 2018 06:14:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 176F22A5FC for ; Wed, 1 Aug 2018 06:14:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0BCDE2A64D; Wed, 1 Aug 2018 06:14:00 +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 8E6A12A5FC for ; Wed, 1 Aug 2018 06:13:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733248AbeHAH54 (ORCPT ); Wed, 1 Aug 2018 03:57:56 -0400 Received: from mail-cys01nam02on0084.outbound.protection.outlook.com ([104.47.37.84]:2226 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733157AbeHAH54 (ORCPT ); Wed, 1 Aug 2018 03:57:56 -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=kRikcNMEnTZKAlHLeiAmDLWVPAP7Hi/0So3Ea8nTKSQ=; b=iWW75IagzGSBK60c3m4fWSCODra2wbORlPJOha/PB2IyVJQxpuXktSd379hz9rglcOHkwrb56kxZ38LJ66AP9CTw8T7ogg8L3BnY2I6FNs+wmuYRVjSYzkjuiHQcnC4od3uZ4mp4T6PwoUgai/RxYEAgxhRemeZ3Qbkk9E1sL3k= Received: from SN4PR0701CA0001.namprd07.prod.outlook.com (10.161.192.139) by BL0PR07MB4068.namprd07.prod.outlook.com (52.132.10.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.17; Wed, 1 Aug 2018 06:13:52 +0000 Received: from BY2NAM05FT053.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::203) by SN4PR0701CA0001.outlook.office365.com (2603:10b6:803:28::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.14 via Frontend Transport; Wed, 1 Aug 2018 06:13:51 +0000 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 BY2NAM05FT053.mail.protection.outlook.com (10.152.100.190) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Wed, 1 Aug 2018 06:13:51 +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, 31 Jul 2018 23:13:37 -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 w716DcAZ028801; Tue, 31 Jul 2018 23:13:38 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w716DcwW028800; Tue, 31 Jul 2018 23:13:38 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 14/16] qla2xxx: Save frame payload size from ICB Date: Tue, 31 Jul 2018 23:13:33 -0700 Message-ID: <20180801061335.28709-15-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180801061335.28709-1-himanshu.madhani@cavium.com> References: <20180801061335.28709-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)(396003)(136003)(346002)(376002)(39860400002)(2980300002)(438002)(189003)(199004)(80596001)(336012)(486006)(26005)(126002)(87636003)(72206003)(6666003)(478600001)(476003)(305945005)(2906002)(186003)(81166006)(44832011)(11346002)(8936002)(81156014)(1076002)(8676002)(69596002)(2616005)(356003)(575784001)(86362001)(48376002)(106466001)(47776003)(446003)(76176011)(316002)(106002)(51416003)(54906003)(16586007)(110136005)(36756003)(42186006)(50226002)(52396003)(6346003)(50466002)(4326008)(5660300001);DIR:OUT;SFP:1101;SCL:1;SRVR:BL0PR07MB4068;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;BY2NAM05FT053;1:3N+dIEggMaMW+eOavjaOcoVXUK7iOXB8ij4GJgeE3heLNdRa81EXq9LQbe9fQlt+7w7fZ3SnUl3C2uF5MWStK26Ob2IdQ5s31t65SV2DyzjsQ/Jpw31REGNfYRZRSHmH X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cfdfe10a-8473-480e-b9db-08d5f775f3b4 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BL0PR07MB4068; X-Microsoft-Exchange-Diagnostics: 1;BL0PR07MB4068;3:m6NGXlj521lNI8YtrgXVppf5rJbzeHRQ4r0Tshmeif4q24vOxQ2B61VVeBn33Ea77QdT3F3TT+bxSaaCvxE5aXLXP9fF+hCE0h1P8uVmnSqFDbtQBH7Gl70bCSSqMA/xdDoI8XD8YYV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TzRq02hNWLvPn+aA4hRcJPa4e02duDyiUnaAe81SrId3xtnqXyKMtu5GJ5pzGn7mKMGUh+2391F8TNMrWrfQPQSS6EHvOAisBrJgQp0Hc2+8nvGcWh/HQJoeQ6sMRC6AgF4NpLLVnq1st6/AJa4Dp/dA2xV7DzIfO1SvJ+F8hblA8hlRe0wAqGMQLTe/SE3G89mZjZsJwiYksXo0kJwvozWo/VT/q3pOJ0jUV8O3NphxlLQl8EZ9QS77Rd04NrAunbT2C4zJXrpyhAEQkMmXu/QrJi2s5YWeD/STxuLTb6H46C 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)(8121501046)(5005006)(3002001)(93006095)(93004095)(3231311)(944501410)(52105095)(10201501046)(149027)(150027)(6041310)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:BL0PR07MB4068;BCL:0;PCL:0;RULEID:;SRVR:BL0PR07MB4068; X-Microsoft-Exchange-Diagnostics: 1;BL0PR07MB4068;4:RQqbo25WjhyMUv2R1Jh1c6qnnjwjNzYAGutx5joI1igL7zVryRSRCNXPfPT0Y2ITDHpmeE534YGyodaLNlXqweontB/jCFIt7/BFQ7dTMwG9jWVDAsPHyEvauZCcAetYiTuDm+vOPfbX0B7f4UDoySAM3+HFCfP0fxZpjNtQDA6XxBizHc6Hl/tQ4jWi5p5MVxJPHGlzbjgWMznom5gTyNYFz1KdSZHJ2T3s/I5jo5o4GyySoKLQd9eu74i1zVvHI0xLBQS+i7wkWVe5HEnYIg== X-Forefront-PRVS: 0751474A44 X-Microsoft-Exchange-Diagnostics: 1;BL0PR07MB4068;23:wbc3TIz9xJ4aWnZb4GWh2Ohjl7b+097KcHSNOkdGeZoe5AHUgkbj2wCfl6D7nRWKQDcE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QXmI0hk43cgtqrAFJprq0OwzGZk9EkOLFXgCVOcy2Ln/6Hox6Das=;7:vXrLQ52kUbsJLxVvp7UaX7m/bnvMCYI3aZl2Dqr3Y+6RQNcUbdsEX3XhFUYYYt+TYweWvTXDirVZEEHZ0kjjn+wFfHuiqidKlop1f9nTkBalwiD78C7+WU2nzs4o9eVemMRYlYcH+3kuHZ6Belkv5Q2l7iM90T1UQbLW5uvxwgWXGJq2X/zQ0hSorNHJkgtUP+BylpWVB6zDlMDetFkQTVhZoCGEq/xJb3xJE6f1aJxen4zwNhcgI51iA+m2MzyJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 06:13:51.2703 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cfdfe10a-8473-480e-b9db-08d5f775f3b4 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: BL0PR07MB4068 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 Save frame payload size from init control block. This field/data is used to register with switch data base. This allow the init control block temp buf to be reuse Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 1 + drivers/scsi/qla2xxx/qla_gs.c | 4 +--- drivers/scsi/qla2xxx/qla_init.c | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 0fc563572fad..d1ff1b8f1ae5 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -3848,6 +3848,7 @@ struct qla_hw_data { atomic_t num_pend_mbx_stage1; atomic_t num_pend_mbx_stage2; atomic_t num_pend_mbx_stage3; + uint16_t frame_payload_size; uint32_t login_retry_count; /* SNS command interfaces. */ diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 5139a3577bb3..af9a75df6700 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -2134,9 +2134,7 @@ qla2x00_fdmiv2_rhba(scsi_qla_host_t *vha) /* MAX CT Payload Length */ eiter = entries + size; eiter->type = cpu_to_be16(FDMI_HBA_MAXIMUM_CT_PAYLOAD_LENGTH); - eiter->a.max_ct_len = IS_FWI2_CAPABLE(ha) ? - le16_to_cpu(icb24->frame_payload_size) : - le16_to_cpu(ha->init_cb->frame_payload_size); + eiter->a.max_ct_len = cpu_to_be32(ha->frame_payload_size); eiter->a.max_ct_len = cpu_to_be32(eiter->a.max_ct_len); eiter->len = cpu_to_be16(4 + 4); size += 4 + 4; diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index a0c730bed312..924fe4265590 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -4417,7 +4417,7 @@ qla2x00_nvram_config(scsi_qla_host_t *vha) cnt = (uint8_t *)icb->reserved_3 - (uint8_t *)icb->add_firmware_options; while (cnt--) *dptr1++ = *dptr2++; - + ha->frame_payload_size = le16_to_cpu(icb->frame_payload_size); /* Use alternate WWN? */ if (nv->host_p[1] & BIT_7) { memcpy(icb->node_name, nv->alternate_node_name, WWN_SIZE); @@ -6892,7 +6892,7 @@ qla24xx_nvram_config(scsi_qla_host_t *vha) (uint8_t *)&icb->interrupt_delay_timer; while (cnt--) *dptr1++ = *dptr2++; - + ha->frame_payload_size = le16_to_cpu(icb->frame_payload_size); /* * Setup driver NVRAM options. */ @@ -7948,7 +7948,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha) /* Use extended-initialization control block. */ memcpy(ha->ex_init_cb, &nv->ex_version, sizeof(*ha->ex_init_cb)); - + ha->frame_payload_size = le16_to_cpu(icb->frame_payload_size); /* * Setup driver NVRAM options. */ From patchwork Wed Aug 1 06:13:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10551763 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 E95941822 for ; Wed, 1 Aug 2018 06:14:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5DE92A5FC for ; Wed, 1 Aug 2018 06:14:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA02D2A64D; Wed, 1 Aug 2018 06:14:06 +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 E6FD92A5FC for ; Wed, 1 Aug 2018 06:14:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733251AbeHAH6B (ORCPT ); Wed, 1 Aug 2018 03:58:01 -0400 Received: from mail-cys01nam02on0086.outbound.protection.outlook.com ([104.47.37.86]:4160 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733143AbeHAH6B (ORCPT ); Wed, 1 Aug 2018 03:58:01 -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=HVSm+OKnDpk+YsXzt9By3eFOvhNlf/miIoXO+lvpMHk=; b=arpOG7MZIlEo5ARiVeubjZaXPaSJbyqn+GLkJr/wQ0VuV+Pa6yds49OtsEna21MskPF6Ef8lsAUGvHtsnHqVmfzb3QRmYU27smMrqqXBcnTFRW4oOmVb6/tR1j6EuuXgb/CGefC6X+feRHY2PV/a7S3PcsvYdRohPRNcm7UZT4s= Received: from BYAPR07CA0035.namprd07.prod.outlook.com (2603:10b6:a02:bc::48) by MW2PR07MB4075.namprd07.prod.outlook.com (2603:10b6:907:7::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Wed, 1 Aug 2018 06:13:52 +0000 Received: from BY2NAM05FT043.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::201) by BYAPR07CA0035.outlook.office365.com (2603:10b6:a02:bc::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.15 via Frontend Transport; Wed, 1 Aug 2018 06:13:51 +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 BY2NAM05FT043.mail.protection.outlook.com (10.152.100.180) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Wed, 1 Aug 2018 06:13:51 +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, 31 Jul 2018 23:13:38 -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 w716Dd5v028805; Tue, 31 Jul 2018 23:13:39 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w716Dd3B028804; Tue, 31 Jul 2018 23:13:39 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 15/16] qla2xxx: Migrate NVME N2N handling into state machine Date: Tue, 31 Jul 2018 23:13:34 -0700 Message-ID: <20180801061335.28709-16-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180801061335.28709-1-himanshu.madhani@cavium.com> References: <20180801061335.28709-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)(396003)(39860400002)(376002)(136003)(346002)(2980300002)(438002)(199004)(189003)(36756003)(478600001)(87636003)(72206003)(14444005)(53946003)(4326008)(50226002)(86362001)(575784001)(106466001)(6666003)(47776003)(54906003)(1076002)(81156014)(2906002)(80596001)(305945005)(8936002)(81166006)(8676002)(5660300001)(16586007)(336012)(69596002)(50466002)(48376002)(106002)(110136005)(446003)(316002)(11346002)(42186006)(51416003)(76176011)(476003)(186003)(26005)(52396003)(486006)(44832011)(126002)(356003)(2616005);DIR:OUT;SFP:1101;SCL:1;SRVR:MW2PR07MB4075;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;BY2NAM05FT043;1:qDtfv+HJ0WCjUBWiG7qeHn6y+6X2pybCpty+v7xIW5YFNpuN0q+J5KeGc0S991PQ7MBEnVFDTi6kENIAudhBLClo1TayfOyc9hCwYjgrCmKfpXkepdJBXQhlgLAcmvh8 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4fbaef74-acde-4347-bc13-08d5f775f3df X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:MW2PR07MB4075; X-Microsoft-Exchange-Diagnostics: 1;MW2PR07MB4075;3:HmaUx3rHzddtB/OUCfaBxTdF12DHcilgjzyft/psM3pd4q5HifWSldzJTyNpqZ+x5viTymjtOYzxkmI71KrpqwPgarFQTirmcnb7lJhI6uCTTm5wis3M8/4b5JxN7PkZhXHjyV/THRSvt2X7zXFOismMQgz+18h6PLoTzi4rPvo7znH+qbQ8u37FfHe0e5gJHHhJN0xyh/GpSu8dGL0cu2OTqdevwn3+jdn7P5PhplLhI79dZYHfQCjtDpBxpFNVNhY2YhoCQcZ1rsOQV+iH6xh3RBeEwdj6Y541fPeT3X64Fr+sehQN0/npSMiZhwoZHbHN8K9zNGtixl7WUsy09wHtg1uHAJjvdIi/nWhcSLI=;25:rcEAsI80Y1NynLcbzmDIZI47J1b58Dp5SD3MSII87c+IuABPl1MblvuSiPfPLu2EAoWC4OvUuNuoEP39n4MdiaqgvAMIHVgUWR//TL2lBfOkhZDPL3K2NthX9m3QpC8VCX2brs6Q6feLTw05BPcC6+GTJoUo0aqSOLedDi7iNfz+4D2cZDrUdzHqOeUrkyFGmj1FH+1ax8apsorovVSZXE2z2UKNlltuOF1z+aVPx8HsJTPiqCIaeDQPqpcWXEwVRYnzQfvI9UnLhc2smjHJMUxDJFwQrwu9X89fMUPIlCpPEx+Se3rxcpOuQwvbvXha0v1SKck/XO8xgSfGgIXQwA== X-MS-TrafficTypeDiagnostic: MW2PR07MB4075: X-Microsoft-Exchange-Diagnostics: 1;MW2PR07MB4075;31:ToRO/vnQqXJdVN9og5SKMxM9WmHxpjbhpaQuW1xiEkFV/LZ6+nOmZiLSDbb1HW2pF5nIYAZWOhgb3vpB5+9p01vSEJMUxyvnrW7DTQp0ceP1hDlFPKqIR4+04n81ON0lYun9wacMwLMVXcmAn1ClIn2+dnbvIau6+mOZcEUtZVqHohpXXaTDAS/3hyp8yS2bfVYsyBUlgzKdiWKR3Na7DI44MEKIokBxfdD/SZfiVZA=;20:DSZsVJX52sADLtnz11VXzmAJXfiBWLkYcV38AcNFthj3JoCHmFvPJHC9FJM4BcLq3ehJJBOCKQB2poTMN7uL9s7D9PQxrsiOEQQkycCIkEjk+rDsVjXQHADU9K07AiUOCTw2YIERVCB3nwIVwIApwct3PMYwDBwMWojv84h7NJvhthRV4svgNIpnbudlzcryjImB742AcBDLBGfdTe/VhHsU9HY45KD6sjNLKrRB4CMMVZOKaU5KlR7da/SnplrgFKuCsdIQfh8Df6/8k0kFkqR0lF0op9grQNfbAt4qaSIfpJaXT3mWD3PJ2aaWuFtwAxOtU3tW/V/9S9qKe6DMkXZaNi4qhNIyObo30g42JDrNCXBoQs0U8Xvp04pEMBswPpHVKtuj5t06VM4gJ2OcJxgro1TR7HT3I9zZuRmcgy6LDajr1jxx+ULi0QA/9S6K0kJmr2j1Wd/GVca5ZAs/+Mdr2B3ep3Yyat+wVeg4aPG5uGaM9PcTGStnj+QwWo8G X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(21532816269658); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93004095)(3002001)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:MW2PR07MB4075;BCL:0;PCL:0;RULEID:;SRVR:MW2PR07MB4075; X-Microsoft-Exchange-Diagnostics: 1;MW2PR07MB4075;4:E3i2UQeQIxGGcUwDiqbg1NFsL6cMYKoTRTSLOsMhzWEGx3a1z2IpxEe77yqfQ4pJr4ufIK3xRNqn4r+ZVcSD/flSHmq/uv8pt4yITXTKhDPO1qK2NpZquVmixYNUYkrZGcSsKJM1MEqD7K8F+lqNXKEdl983uq5rBuEUqtUb0ukNPp9FIIrLB8SM25nBnL4ukessGxAFjtDJq+fXU9c/JEf73jKZkUbEkilQElx42+vJdC6wEoc4lt1gOVxClXVrnqKEVnIqoBy2IUqAbzkJfzWYYUdPpfscjrxYsvGjZz/nEs3ZmSDqaSZPSwZAPr71 X-Forefront-PRVS: 0751474A44 X-Microsoft-Exchange-Diagnostics: 1;MW2PR07MB4075;23:/ero4wzn1ras5O1c71b9LynFykYEiKzWGeHWmj0dHV4vLTHUWe8TkGbQXDk0EyG9PyRwCiJLDWS59WGoIn8UlmCUVjfjnR6JZ+8TD/5E/sU5fw5ldLnDB7cc4sUZisJ66gNgevAwPOTGgWufLexIxcZCJUfMmGhiOvhdxiNQA61/oT44LrEJeZz1WH0oQoDAVvk3LZxMukmRa0serDOWJOIbLcyrj8KKVdZ4MqaRNluhZ3jHIJudRmxaWQaTfjp8Ql8vgbRB5epIbjyl5wJtGhQZywjv4nYlRhYOSVj5qY4RHWAlQPlLNuGbGZwvyTdWxsO3xNh8s4P/Bs1R5EjyP3ptlDoH8HZNTl4rVr3p8ODaW1FLiTtU1MKH17dJ2VNHV4hPtSMjcSOfuVYMplkt3ace35Hsa8GbQz1+XtiUPGYGCvWYi0iwNH4mn4Hzbl9FxQ8cPPEzSawi8TuOqvsQhy0KFgwzojB2J8Ino4F7MTkyrW2SZzYDOl5sIad6GXPh4wd4L7V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Microsoft-Exchange-Diagnostics: 1;MW2PR07MB4075;6:StteLkYKjqOeAinUneSjkCINEg4eVAv/eQvSm2U94YNuiwkd8GutuoiquX4T5sf7KfR5OA9FW25NzustEHmP+pw9WBUhcC0dvppeT9BHXs8lJj80GoiCjbFzLXDFag6M6s+U9H61HqaS3ZIDhYF0AmUtE6cOANYdwvJhdSSTse/rHqsma4eO63lFP0fl8W2wILpO4gnAmZaUS33nPPMqurYk6OTMnVgnmqP0N1zmhvd0X+BdCoarMFuuEedHf7Mt4UP9No3DSJ6KnE/OGJbN9RlgTTfZXSWm0mtAjIfM8jKweWcGSGohcr8FjNk+92T4cXTnQ3I+P78HGmQlj2+ox+AKQI/aWiVf1EzJNrGNzai6AM1wUWWTl3YSyp9efuUd7zBvko4w81mGaAtmdUH9vnPwx/o53aeDRZ2TidWXPa1lZXg6txnRDM/MB32WmpXYyLkUCHTsz6LLvmvNCmxmYQ==;5:pZjf3e/2WNtMjgYn7hZ+8wHDljjCG/QGqT2RKZ+CAB/f64+pcGRkMBs9rWFP1FcMYb3glNZwMd8gKreQD2qvuH7M5b4gRpeDUgbgJ+oFsjykY/Z6A1rv8lUrMUk3PTuxm/HLI33ZEqskPqMXnLPKtNLUk6boojEtMJKaUwPUudQ=;7:RqReOfRVxoAedgzxqzYO3mM9FGCkLgoQ3ZdnloyoidpY1GYi1hEXNz7dM3IdvhdL0qo0D446ilgHrzl23zEI3JqMPcFMHa3dAr/5aPeHWdCUl/up5c0ppvlYZ0co4IYWqIU77npKpGRGiS76vReVmhp59uoXH48ypaw+yXTQxc3LuWkA7Y/iV4XbjYBw/AQLYe/5TMAGshufXgDlblwU3iG9chNRS3sRnts/Mw1x6jlcpzont7VQfD6lT7KoMyqF SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 06:13:51.5522 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4fbaef74-acde-4347-bc13-08d5f775f3df 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: MW2PR07MB4075 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 This patch fixes regression introduced for the N2N support for FC-NVMe. For FC-NVMe with N2N connection, instead of FW initiating the Login, Driver starts Login process. This patch migrate that new process from a standalone path into existing session management state machine. With this state change now driver will not wait for pull NPort ID from FW. Fixes: edd05de197592 ("scsi: qla2xxx: Changes to support N2N logins") Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 12 +- drivers/scsi/qla2xxx/qla_fw.h | 5 + drivers/scsi/qla2xxx/qla_gbl.h | 3 +- drivers/scsi/qla2xxx/qla_gs.c | 47 +++++--- drivers/scsi/qla2xxx/qla_init.c | 229 ++++++++++++++++++++++++++++++------- drivers/scsi/qla2xxx/qla_inline.h | 2 - drivers/scsi/qla2xxx/qla_iocb.c | 112 +++++++++++++----- drivers/scsi/qla2xxx/qla_mbx.c | 77 ++++++++++--- drivers/scsi/qla2xxx/qla_nvme.c | 15 ++- drivers/scsi/qla2xxx/qla_nvme.h | 2 +- drivers/scsi/qla2xxx/qla_os.c | 32 ++++-- drivers/scsi/qla2xxx/tcm_qla2xxx.c | 3 - 12 files changed, 413 insertions(+), 126 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index d1ff1b8f1ae5..a03e12797f30 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -398,6 +398,8 @@ struct srb_iocb { struct completion comp; struct els_plogi_payload *els_plogi_pyld; struct els_plogi_payload *els_resp_pyld; + u32 tx_size; + u32 rx_size; dma_addr_t els_plogi_pyld_dma; dma_addr_t els_resp_pyld_dma; uint32_t fw_status[3]; @@ -2312,6 +2314,7 @@ enum fcport_mgt_event { FCME_ADISC_DONE, FCME_GNNID_DONE, FCME_GFPNID_DONE, + FCME_ELS_PLOGI_DONE, }; enum rscn_addr_format { @@ -2408,6 +2411,7 @@ typedef struct fc_port { struct ct_sns_desc ct_desc; enum discovery_state disc_state; enum login_state fw_login_state; + unsigned long dm_login_expire; unsigned long plogi_nack_done_deadline; u32 login_gen, last_login_gen; @@ -2418,7 +2422,8 @@ typedef struct fc_port { u8 iocb[IOCB_SIZE]; u8 current_login_state; u8 last_login_state; - struct completion n2n_done; + u16 n2n_link_reset_cnt; + u16 n2n_chip_reset; } fc_port_t; #define QLA_FCPORT_SCAN 1 @@ -3228,6 +3233,7 @@ enum qla_work_type { QLA_EVT_GFPNID, QLA_EVT_SP_RETRY, QLA_EVT_IIDMA, + QLA_EVT_ELS_PLOGI, }; @@ -3600,6 +3606,7 @@ struct qla_hw_data { uint32_t using_lr_setting:1; uint32_t rida_fmt2:1; uint32_t purge_mbox:1; + uint32_t n2n_bigger:1; } flags; uint16_t max_exchg; @@ -3908,6 +3915,9 @@ struct qla_hw_data { int exchoffld_size; int exchoffld_count; + /* n2n */ + struct els_plogi_payload plogi_els_payld; + void *swl; /* These are used by mailbox operations. */ diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h index 5d8688e5bc7c..50c1e6c62e31 100644 --- a/drivers/scsi/qla2xxx/qla_fw.h +++ b/drivers/scsi/qla2xxx/qla_fw.h @@ -1366,6 +1366,11 @@ struct vp_rpt_id_entry_24xx { /* format 1 fabric */ uint8_t vpstat1_subcode; /* vp_status=1 subcode */ uint8_t flags; +#define TOPO_MASK 0xE +#define TOPO_FL 0x2 +#define TOPO_N2N 0x4 +#define TOPO_F 0x6 + uint16_t fip_flags; uint8_t rsv2[12]; diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 6f2a37220a55..035ab18bd534 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -45,8 +45,7 @@ extern int qla2x00_fabric_login(scsi_qla_host_t *, fc_port_t *, uint16_t *); extern int qla2x00_local_device_login(scsi_qla_host_t *, fc_port_t *); extern int qla24xx_els_dcmd_iocb(scsi_qla_host_t *, int, port_id_t); -extern int qla24xx_els_dcmd2_iocb(scsi_qla_host_t *, int, fc_port_t *, - port_id_t); +extern int qla24xx_els_dcmd2_iocb(scsi_qla_host_t *, int, fc_port_t *, bool); extern void qla2x00_update_fcports(scsi_qla_host_t *); diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index af9a75df6700..3a93a9389a49 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -3384,19 +3384,40 @@ int qla24xx_post_gpnid_work(struct scsi_qla_host *vha, port_id_t *id) void qla24xx_sp_unmap(scsi_qla_host_t *vha, srb_t *sp) { - if (sp->u.iocb_cmd.u.ctarg.req) { - dma_free_coherent(&vha->hw->pdev->dev, - sizeof(struct ct_sns_pkt), - sp->u.iocb_cmd.u.ctarg.req, - sp->u.iocb_cmd.u.ctarg.req_dma); - sp->u.iocb_cmd.u.ctarg.req = NULL; - } - if (sp->u.iocb_cmd.u.ctarg.rsp) { - dma_free_coherent(&vha->hw->pdev->dev, - sizeof(struct ct_sns_pkt), - sp->u.iocb_cmd.u.ctarg.rsp, - sp->u.iocb_cmd.u.ctarg.rsp_dma); - sp->u.iocb_cmd.u.ctarg.rsp = NULL; + struct srb_iocb *c = &sp->u.iocb_cmd; + + switch (sp->type) { + case SRB_ELS_DCMD: + if (c->u.els_plogi.els_plogi_pyld) + dma_free_coherent(&vha->hw->pdev->dev, + c->u.els_plogi.tx_size, + c->u.els_plogi.els_plogi_pyld, + c->u.els_plogi.els_plogi_pyld_dma); + + if (c->u.els_plogi.els_resp_pyld) + dma_free_coherent(&vha->hw->pdev->dev, + c->u.els_plogi.rx_size, + c->u.els_plogi.els_resp_pyld, + c->u.els_plogi.els_resp_pyld_dma); + break; + case SRB_CT_PTHRU_CMD: + default: + if (sp->u.iocb_cmd.u.ctarg.req) { + dma_free_coherent(&vha->hw->pdev->dev, + sizeof(struct ct_sns_pkt), + sp->u.iocb_cmd.u.ctarg.req, + sp->u.iocb_cmd.u.ctarg.req_dma); + sp->u.iocb_cmd.u.ctarg.req = NULL; + } + + if (sp->u.iocb_cmd.u.ctarg.rsp) { + dma_free_coherent(&vha->hw->pdev->dev, + sizeof(struct ct_sns_pkt), + sp->u.iocb_cmd.u.ctarg.rsp, + sp->u.iocb_cmd.u.ctarg.rsp_dma); + sp->u.iocb_cmd.u.ctarg.rsp = NULL; + } + break; } sp->free(sp); diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 924fe4265590..4acc61bc438f 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -419,6 +419,19 @@ void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea) __qla24xx_handle_gpdb_event(vha, ea); } +int qla_post_els_plogi_work(struct scsi_qla_host *vha, fc_port_t *fcport) +{ + struct qla_work_evt *e; + + e = qla2x00_alloc_work(vha, QLA_EVT_ELS_PLOGI); + if (!e) + return QLA_FUNCTION_FAILED; + + e->u.fcport.fcport = fcport; + fcport->flags |= FCF_ASYNC_ACTIVE; + return qla2x00_post_work(vha, e); +} + static void qla2x00_async_adisc_sp_done(void *ptr, int res) { @@ -467,6 +480,8 @@ qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport, lio = &sp->u.iocb_cmd; lio->timeout = qla2x00_async_iocb_timeout; + sp->gen1 = fcport->rscn_gen; + sp->gen2 = fcport->login_gen; qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); sp->done = qla2x00_async_adisc_sp_done; @@ -560,12 +575,17 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, loop_id = le16_to_cpu(e->nport_handle); loop_id = (loop_id & 0x7fff); + if (fcport->fc4f_nvme) + current_login_state = e->current_login_state >> 4; + else + current_login_state = e->current_login_state & 0xf; + ql_dbg(ql_dbg_disc, vha, 0x20e2, - "%s found %8phC CLS [%d|%d] ID[%02x%02x%02x|%02x%02x%02x] lid[%d|%d]\n", + "%s found %8phC CLS [%x|%x] nvme %d ID[%02x%02x%02x|%02x%02x%02x] lid[%d|%d]\n", __func__, fcport->port_name, e->current_login_state, fcport->fw_login_state, - id.b.domain, id.b.area, id.b.al_pa, + fcport->fc4f_nvme, id.b.domain, id.b.area, id.b.al_pa, fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa, loop_id, fcport->loop_id); @@ -574,9 +594,13 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, case DSC_DELETED: break; default: - if ((id.b24 != fcport->d_id.b24) || - ((fcport->loop_id != FC_NO_LOOP_ID) && - (fcport->loop_id != loop_id))) { + if ((id.b24 != fcport->d_id.b24 && + fcport->d_id.b24) || + (fcport->loop_id != FC_NO_LOOP_ID && + fcport->loop_id != loop_id)) { + ql_dbg(ql_dbg_disc, vha, 0x20e3, + "%s %d %8phC post del sess\n", + __func__, __LINE__, fcport->port_name); qlt_schedule_sess_for_deletion(fcport); return; } @@ -599,11 +623,6 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, fcport->login_pause = 1; } - if (fcport->fc4f_nvme) - current_login_state = e->current_login_state >> 4; - else - current_login_state = e->current_login_state & 0xf; - switch (vha->hw->current_topology) { default: switch (current_login_state) { @@ -632,6 +651,8 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, } break; case ISP_CFG_N: + fcport->fw_login_state = current_login_state; + fcport->d_id = id; switch (current_login_state) { case DSC_LS_PRLI_COMP: if ((e->prli_svc_param_word_3[0] & BIT_4) == 0) @@ -704,12 +725,39 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, qla24xx_fcport_handle_login(vha, fcport); break; case ISP_CFG_N: - /* - * FW handles the initial login for n2n. - * Do link reinit to trigger this auto login. - */ - set_bit(N2N_LINK_RESET, &vha->dpc_flags); - qla2xxx_wake_dpc(vha); + fcport->disc_state = DSC_DELETED; + if (time_after_eq(jiffies, fcport->dm_login_expire)) { + if (fcport->n2n_link_reset_cnt < 2) { + fcport->n2n_link_reset_cnt++; + /* + * remote port is not sending PLOGI. + * Reset link to kick start his state + * machine + */ + set_bit(N2N_LINK_RESET, + &vha->dpc_flags); + } else { + if (fcport->n2n_chip_reset < 1) { + ql_log(ql_log_info, vha, 0x705d, + "Chip reset to bring laser down"); + set_bit(ISP_ABORT_NEEDED, + &vha->dpc_flags); + fcport->n2n_chip_reset++; + } else { + ql_log(ql_log_info, vha, 0x705d, + "Remote port %8ph is not coming back\n", + fcport->port_name); + fcport->scan_state = 0; + } + } + qla2xxx_wake_dpc(vha); + } else { + /* + * report port suppose to do PLOGI. Give him + * more time. FW will catch it. + */ + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + } break; default: break; @@ -1019,9 +1067,9 @@ qla24xx_async_prli(struct scsi_qla_host *vha, fc_port_t *fcport) } ql_dbg(ql_dbg_disc, vha, 0x211b, - "Async-prli - %8phC hdl=%x, loopid=%x portid=%06x retries=%d.\n", - fcport->port_name, sp->handle, fcport->loop_id, - fcport->d_id.b24, fcport->login_retry); + "Async-prli - %8phC hdl=%x, loopid=%x portid=%06x retries=%d %s.\n", + fcport->port_name, sp->handle, fcport->loop_id, fcport->d_id.b24, + fcport->login_retry, fcport->fc4f_nvme ? "nvme" : "fc"); return rval; @@ -1163,8 +1211,9 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) fcport->flags &= ~FCF_ASYNC_SENT; ql_dbg(ql_dbg_disc, vha, 0x20d2, - "%s %8phC DS %d LS %d rc %d\n", __func__, fcport->port_name, - fcport->disc_state, pd->current_login_state, ea->rc); + "%s %8phC DS %d LS %d nvme %x rc %d\n", __func__, fcport->port_name, + fcport->disc_state, pd->current_login_state, fcport->fc4f_nvme, + ea->rc); if (fcport->disc_state == DSC_DELETE_PEND) return; @@ -1285,36 +1334,76 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) return 0; } - switch (fcport->disc_state) { case DSC_DELETED: - fcport->login_retry--; wwn = wwn_to_u64(fcport->node_name); - if (wwn == 0) { - ql_dbg(ql_dbg_disc, vha, 0xffff, - "%s %d %8phC post GNNID\n", - __func__, __LINE__, fcport->port_name); - qla24xx_post_gnnid_work(vha, fcport); - } else if (fcport->loop_id == FC_NO_LOOP_ID) { - ql_dbg(ql_dbg_disc, vha, 0x20bd, - "%s %d %8phC post gnl\n", - __func__, __LINE__, fcport->port_name); - qla24xx_post_gnl_work(vha, fcport); - } else { - fcport->login_retry--; - qla_chk_n2n_b4_login(vha, fcport); + switch (vha->hw->current_topology) { + case ISP_CFG_N: + if (fcport_is_smaller(fcport)) { + /* this adapter is bigger */ + if (fcport->login_retry) { + if (fcport->loop_id == FC_NO_LOOP_ID) { + qla2x00_find_new_loop_id(vha, + fcport); + fcport->fw_login_state = + DSC_LS_PORT_UNAVAIL; + } + fcport->login_retry--; + qla_post_els_plogi_work(vha, fcport); + } else { + ql_log(ql_log_info, vha, 0x705d, + "Unable to reach remote port %8phC", + fcport->port_name); + } + } else { + qla24xx_post_gnl_work(vha, fcport); + } + break; + default: + if (wwn == 0) { + ql_dbg(ql_dbg_disc, vha, 0xffff, + "%s %d %8phC post GNNID\n", + __func__, __LINE__, fcport->port_name); + qla24xx_post_gnnid_work(vha, fcport); + } else if (fcport->loop_id == FC_NO_LOOP_ID) { + ql_dbg(ql_dbg_disc, vha, 0x20bd, + "%s %d %8phC post gnl\n", + __func__, __LINE__, fcport->port_name); + qla24xx_post_gnl_work(vha, fcport); + } else { + qla_chk_n2n_b4_login(vha, fcport); + } + break; } break; case DSC_GNL: - if (fcport->login_pause) { - fcport->last_rscn_gen = fcport->rscn_gen; - fcport->last_login_gen = fcport->login_gen; - set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + switch (vha->hw->current_topology) { + case ISP_CFG_N: + if ((fcport->current_login_state & 0xf) == 0x6) { + ql_dbg(ql_dbg_disc, vha, 0x2118, + "%s %d %8phC post GPDB work\n", + __func__, __LINE__, fcport->port_name); + fcport->chip_reset = + vha->hw->base_qpair->chip_reset; + qla24xx_post_gpdb_work(vha, fcport, 0); + } else { + ql_dbg(ql_dbg_disc, vha, 0x2118, + "%s %d %8phC post NVMe PRLI\n", + __func__, __LINE__, fcport->port_name); + qla24xx_post_prli_work(vha, fcport); + } + break; + default: + if (fcport->login_pause) { + fcport->last_rscn_gen = fcport->rscn_gen; + fcport->last_login_gen = fcport->login_gen; + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + break; + } + qla_chk_n2n_b4_login(vha, fcport); break; } - - qla_chk_n2n_b4_login(vha, fcport); break; case DSC_LOGIN_FAILED: @@ -1428,6 +1517,15 @@ void qla24xx_handle_relogin_event(scsi_qla_host_t *vha, qla24xx_fcport_handle_login(vha, fcport); } + +void qla_handle_els_plogi_done(scsi_qla_host_t *vha, struct event_arg *ea) +{ + ql_dbg(ql_dbg_disc, vha, 0x2118, + "%s %d %8phC post PRLI\n", + __func__, __LINE__, ea->fcport->port_name); + qla24xx_post_prli_work(vha, ea->fcport); +} + void qla2x00_fcport_event_handler(scsi_qla_host_t *vha, struct event_arg *ea) { fc_port_t *f, *tf; @@ -1529,6 +1627,9 @@ void qla2x00_fcport_event_handler(scsi_qla_host_t *vha, struct event_arg *ea) case FCME_GFPNID_DONE: qla24xx_handle_gfpnid_event(vha, ea); break; + case FCME_ELS_PLOGI_DONE: + qla_handle_els_plogi_done(vha, ea); + break; default: BUG_ON(1); break; @@ -4159,7 +4260,8 @@ qla2x00_configure_hba(scsi_qla_host_t *vha) id.b.al_pa = al_pa; id.b.rsvd_1 = 0; spin_lock_irqsave(&ha->hardware_lock, flags); - qlt_update_host_map(vha, id); + if (!(topo == 2 && ha->flags.n2n_bigger)) + qlt_update_host_map(vha, id); spin_unlock_irqrestore(&ha->hardware_lock, flags); if (!vha->flags.init_done) @@ -4812,6 +4914,31 @@ qla2x00_configure_local_loop(scsi_qla_host_t *vha) struct qla_hw_data *ha = vha->hw; unsigned long flags; + /* Inititae N2N login. */ + if (test_and_clear_bit(N2N_LOGIN_NEEDED, &vha->dpc_flags)) { + /* borrowing */ + u32 *bp, i, sz; + + memset(ha->init_cb, 0, ha->init_cb_size); + sz = min_t(int, sizeof(struct els_plogi_payload), + ha->init_cb_size); + rval = qla24xx_get_port_login_templ(vha, ha->init_cb_dma, + (void *)ha->init_cb, sz); + if (rval == QLA_SUCCESS) { + bp = (uint32_t *)ha->init_cb; + for (i = 0; i < sz/4 ; i++, bp++) + *bp = cpu_to_be32(*bp); + + memcpy(&ha->plogi_els_payld.data, (void *)ha->init_cb, + sizeof(ha->plogi_els_payld.data)); + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + } else { + ql_dbg(ql_dbg_init, vha, 0x00d1, + "PLOGI ELS param read fail.\n"); + } + return QLA_SUCCESS; + } + found_devs = 0; new_fcport = NULL; entries = MAX_FIBRE_DEVICES_LOOP; @@ -5104,9 +5231,19 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) fcport->deleted = 0; fcport->logout_on_delete = 1; fcport->login_retry = vha->hw->login_retry_count; + fcport->n2n_chip_reset = fcport->n2n_link_reset_cnt = 0; qla2x00_iidma_fcport(vha, fcport); + switch (vha->hw->current_topology) { + case ISP_CFG_N: + case ISP_CFG_NL: + fcport->keep_nport_handle = 1; + break; + default: + break; + } + if (fcport->fc4f_nvme) { qla_nvme_register_remote(vha, fcport); fcport->disc_state = DSC_LOGIN_COMPLETE; @@ -6991,6 +7128,9 @@ qla24xx_nvram_config(scsi_qla_host_t *vha) if (ql2xloginretrycount) ha->login_retry_count = ql2xloginretrycount; + /* N2N: driver will initiate Login instead of FW */ + icb->firmware_options_3 |= BIT_8; + /* Enable ZIO. */ if (!vha->flags.init_done) { ha->zio_mode = le32_to_cpu(icb->firmware_options_2) & @@ -8075,6 +8215,9 @@ qla81xx_nvram_config(scsi_qla_host_t *vha) /* enable RIDA Format2 */ icb->firmware_options_3 |= BIT_0; + /* N2N: driver will initiate Login instead of FW */ + icb->firmware_options_3 |= BIT_8; + if (IS_QLA27XX(ha)) { icb->firmware_options_3 |= BIT_8; ql_dbg(ql_log_info, vha, 0x0075, diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h index acf6511e8ef7..a29f8898c687 100644 --- a/drivers/scsi/qla2xxx/qla_inline.h +++ b/drivers/scsi/qla2xxx/qla_inline.h @@ -280,8 +280,6 @@ qla2x00_init_timer(srb_t *sp, unsigned long tmo) init_completion(&sp->comp); if (IS_QLAFX00(sp->vha->hw) && (sp->type == SRB_FXIOCB_DCMD)) init_completion(&sp->u.iocb_cmd.u.fxiocb.fxiocb_comp); - if (sp->type == SRB_ELS_DCMD) - init_completion(&sp->u.iocb_cmd.u.els_logo.comp); add_timer(&sp->u.iocb_cmd.timer); } diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index ba14db8d0b8d..059f2c9dc192 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -2465,6 +2465,7 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *vha, int els_opcode, sp->fcport = fcport; elsio->timeout = qla2x00_els_dcmd_iocb_timeout; qla2x00_init_timer(sp, ELS_DCMD_TIMEOUT); + init_completion(&sp->u.iocb_cmd.u.els_logo.comp); sp->done = qla2x00_els_dcmd_sp_done; sp->free = qla2x00_els_dcmd_sp_free; @@ -2512,7 +2513,6 @@ qla24xx_els_logo_iocb(srb_t *sp, struct els_entry_24xx *els_iocb) { scsi_qla_host_t *vha = sp->vha; struct srb_iocb *elsio = &sp->u.iocb_cmd; - uint32_t dsd_len = 24; els_iocb->entry_type = ELS_IOCB_TYPE; els_iocb->entry_count = 1; @@ -2535,20 +2535,21 @@ qla24xx_els_logo_iocb(srb_t *sp, struct els_entry_24xx *els_iocb) els_iocb->control_flags = 0; if (elsio->u.els_logo.els_cmd == ELS_DCMD_PLOGI) { - els_iocb->tx_byte_count = sizeof(struct els_plogi_payload); + els_iocb->tx_byte_count = els_iocb->tx_len = + sizeof(struct els_plogi_payload); els_iocb->tx_address[0] = cpu_to_le32(LSD(elsio->u.els_plogi.els_plogi_pyld_dma)); els_iocb->tx_address[1] = cpu_to_le32(MSD(elsio->u.els_plogi.els_plogi_pyld_dma)); - els_iocb->tx_len = dsd_len; els_iocb->rx_dsd_count = 1; - els_iocb->rx_byte_count = sizeof(struct els_plogi_payload); + els_iocb->rx_byte_count = els_iocb->rx_len = + sizeof(struct els_plogi_payload); els_iocb->rx_address[0] = cpu_to_le32(LSD(elsio->u.els_plogi.els_resp_pyld_dma)); els_iocb->rx_address[1] = cpu_to_le32(MSD(elsio->u.els_plogi.els_resp_pyld_dma)); - els_iocb->rx_len = dsd_len; + ql_dbg(ql_dbg_io + ql_dbg_buffer, vha, 0x3073, "PLOGI ELS IOCB:\n"); ql_dump_buffer(ql_log_info, vha, 0x0109, @@ -2577,7 +2578,6 @@ qla2x00_els_dcmd2_iocb_timeout(void *data) fc_port_t *fcport = sp->fcport; struct scsi_qla_host *vha = sp->vha; struct qla_hw_data *ha = vha->hw; - struct srb_iocb *lio = &sp->u.iocb_cmd; unsigned long flags = 0; int res; @@ -2593,7 +2593,7 @@ qla2x00_els_dcmd2_iocb_timeout(void *data) (res == QLA_SUCCESS) ? "successful" : "failed"); spin_unlock_irqrestore(&ha->hardware_lock, flags); - complete(&lio->u.els_plogi.comp); + sp->done(sp, QLA_FUNCTION_TIMEOUT); } static void @@ -2603,17 +2603,54 @@ qla2x00_els_dcmd2_sp_done(void *ptr, int res) fc_port_t *fcport = sp->fcport; struct srb_iocb *lio = &sp->u.iocb_cmd; struct scsi_qla_host *vha = sp->vha; + struct event_arg ea; + struct qla_work_evt *e; + + ql_dbg(ql_dbg_disc, vha, 0x3072, + "%s ELS done rc %d hdl=%x, portid=%06x %8phC\n", + sp->name, res, sp->handle, fcport->d_id.b24, fcport->port_name); - ql_dbg(ql_dbg_io + ql_dbg_disc, vha, 0x3072, - "%s ELS hdl=%x, portid=%06x done %8phC\n", - sp->name, sp->handle, fcport->d_id.b24, fcport->port_name); + fcport->flags &= ~(FCF_ASYNC_SENT|FCF_ASYNC_ACTIVE); + del_timer(&sp->u.iocb_cmd.timer); - complete(&lio->u.els_plogi.comp); + if (sp->flags & SRB_WAKEUP_ON_COMP) + complete(&lio->u.els_plogi.comp); + else { + if (res) { + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + } else { + memset(&ea, 0, sizeof(ea)); + ea.fcport = fcport; + ea.rc = res; + ea.event = FCME_ELS_PLOGI_DONE; + qla2x00_fcport_event_handler(vha, &ea); + } + + e = qla2x00_alloc_work(vha, QLA_EVT_UNMAP); + if (!e) { + struct srb_iocb *elsio = &sp->u.iocb_cmd; + + if (elsio->u.els_plogi.els_plogi_pyld) + dma_free_coherent(&sp->vha->hw->pdev->dev, + elsio->u.els_plogi.tx_size, + elsio->u.els_plogi.els_plogi_pyld, + elsio->u.els_plogi.els_plogi_pyld_dma); + + if (elsio->u.els_plogi.els_resp_pyld) + dma_free_coherent(&sp->vha->hw->pdev->dev, + elsio->u.els_plogi.rx_size, + elsio->u.els_plogi.els_resp_pyld, + elsio->u.els_plogi.els_resp_pyld_dma); + sp->free(sp); + } + e->u.iosb.sp = sp; + qla2x00_post_work(vha, e); + } } int qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, - fc_port_t *fcport, port_id_t remote_did) + fc_port_t *fcport, bool wait) { srb_t *sp; struct srb_iocb *elsio = NULL; @@ -2641,9 +2678,13 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, elsio->timeout = qla2x00_els_dcmd2_iocb_timeout; init_completion(&elsio->u.els_plogi.comp); - qla2x00_init_timer(sp, ELS_DCMD_TIMEOUT); + if (wait) + sp->flags = SRB_WAKEUP_ON_COMP; + + qla2x00_init_timer(sp, ELS_DCMD_TIMEOUT + 2); sp->done = qla2x00_els_dcmd2_sp_done; + elsio->u.els_plogi.tx_size = elsio->u.els_plogi.rx_size = DMA_POOL_SIZE; ptr = elsio->u.els_plogi.els_plogi_pyld = dma_alloc_coherent(&ha->pdev->dev, DMA_POOL_SIZE, @@ -2668,33 +2709,52 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, memset(ptr, 0, sizeof(struct els_plogi_payload)); memset(resp_ptr, 0, sizeof(struct els_plogi_payload)); + memcpy(elsio->u.els_plogi.els_plogi_pyld->data, + &ha->plogi_els_payld.data, + sizeof(elsio->u.els_plogi.els_plogi_pyld->data)); + elsio->u.els_plogi.els_cmd = els_opcode; elsio->u.els_plogi.els_plogi_pyld->opcode = els_opcode; - qla24xx_get_port_login_templ(vha, ptr_dma + 4, - &elsio->u.els_plogi.els_plogi_pyld->data[0], - sizeof(struct els_plogi_payload)); - ql_dbg(ql_dbg_io + ql_dbg_buffer, vha, 0x3073, "PLOGI buffer:\n"); - ql_dump_buffer(ql_dbg_io + ql_dbg_buffer, vha, 0x0109, + ql_dbg(ql_dbg_disc + ql_dbg_buffer, vha, 0x3073, "PLOGI buffer:\n"); + ql_dump_buffer(ql_dbg_disc + ql_dbg_buffer, vha, 0x0109, (uint8_t *)elsio->u.els_plogi.els_plogi_pyld, 0x70); rval = qla2x00_start_sp(sp); if (rval != QLA_SUCCESS) { rval = QLA_FUNCTION_FAILED; - goto out; + } else { + ql_dbg(ql_dbg_disc, vha, 0x3074, + "%s PLOGI sent, hdl=%x, loopid=%x, to port_id %06x from port_id %06x\n", + sp->name, sp->handle, fcport->loop_id, + fcport->d_id.b24, vha->d_id.b24); } - ql_dbg(ql_dbg_io, vha, 0x3074, - "%s PLOGI sent, hdl=%x, loopid=%x, portid=%06x\n", - sp->name, sp->handle, fcport->loop_id, fcport->d_id.b24); - - wait_for_completion(&elsio->u.els_plogi.comp); + if (wait) { + wait_for_completion(&elsio->u.els_plogi.comp); - if (elsio->u.els_plogi.comp_status != CS_COMPLETE) - rval = QLA_FUNCTION_FAILED; + if (elsio->u.els_plogi.comp_status != CS_COMPLETE) + rval = QLA_FUNCTION_FAILED; + } else { + goto done; + } out: + fcport->flags &= ~(FCF_ASYNC_SENT); + if (elsio->u.els_plogi.els_plogi_pyld) + dma_free_coherent(&sp->vha->hw->pdev->dev, + elsio->u.els_plogi.tx_size, + elsio->u.els_plogi.els_plogi_pyld, + elsio->u.els_plogi.els_plogi_pyld_dma); + + if (elsio->u.els_plogi.els_resp_pyld) + dma_free_coherent(&sp->vha->hw->pdev->dev, + elsio->u.els_plogi.rx_size, + elsio->u.els_plogi.els_resp_pyld, + elsio->u.els_plogi.els_resp_pyld_dma); + sp->free(sp); +done: return rval; } diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 10847cdca093..7c07a939cf15 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -59,6 +59,7 @@ static struct rom_cmd { { MBC_IOCB_COMMAND_A64 }, { MBC_GET_ADAPTER_LOOP_ID }, { MBC_READ_SFP }, + { MBC_GET_RNID_PARAMS }, }; static int is_rom_cmd(uint16_t cmd) @@ -3842,30 +3843,68 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, "Format 1: WWPN %8phC.\n", vha->port_name); - /* N2N. direct connect */ - if (IS_QLA27XX(ha) && - ((rptid_entry->u.f1.flags>>1) & 0x7) == 2) { - /* if our portname is higher then initiate N2N login */ - if (wwn_to_u64(vha->port_name) > - wwn_to_u64(rptid_entry->u.f1.port_name)) { - // ??? qlt_update_host_map(vha, id); - vha->n2n_id = 0x1; - ql_dbg(ql_dbg_async, vha, 0x5075, - "Format 1: Setting n2n_update_needed for id %d\n", - vha->n2n_id); + switch (rptid_entry->u.f1.flags & TOPO_MASK) { + case TOPO_N2N: + ha->current_topology = ISP_CFG_N; + spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); + fcport = qla2x00_find_fcport_by_wwpn(vha, + rptid_entry->u.f1.port_name, 1); + spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); + + if (fcport) { + fcport->plogi_nack_done_deadline = jiffies + HZ; + fcport->dm_login_expire = jiffies + 3*HZ; + fcport->scan_state = QLA_FCPORT_FOUND; + switch (fcport->disc_state) { + case DSC_DELETED: + set_bit(RELOGIN_NEEDED, + &vha->dpc_flags); + break; + case DSC_DELETE_PEND: + break; + default: + qlt_schedule_sess_for_deletion(fcport); + break; + } } else { - ql_dbg(ql_dbg_async, vha, 0x5075, - "Format 1: Remote login - Waiting for WWPN %8phC.\n", - rptid_entry->u.f1.port_name); + id.b24 = 0; + if (wwn_to_u64(vha->port_name) > + wwn_to_u64(rptid_entry->u.f1.port_name)) { + vha->d_id.b24 = 0; + vha->d_id.b.al_pa = 1; + ha->flags.n2n_bigger = 1; + + id.b.al_pa = 2; + ql_dbg(ql_dbg_async, vha, 0x5075, + "Format 1: assign local id %x remote id %x\n", + vha->d_id.b24, id.b24); + } else { + ql_dbg(ql_dbg_async, vha, 0x5075, + "Format 1: Remote login - Waiting for WWPN %8phC.\n", + rptid_entry->u.f1.port_name); + ha->flags.n2n_bigger = 0; + } + qla24xx_post_newsess_work(vha, &id, + rptid_entry->u.f1.port_name, + rptid_entry->u.f1.node_name, + NULL, + FC4_TYPE_UNKNOWN); } - memcpy(vha->n2n_port_name, rptid_entry->u.f1.port_name, - WWN_SIZE); + /* if our portname is higher then initiate N2N login */ + set_bit(N2N_LOGIN_NEEDED, &vha->dpc_flags); - set_bit(REGISTER_FC4_NEEDED, &vha->dpc_flags); - set_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags); ha->flags.n2n_ae = 1; return; + break; + case TOPO_FL: + ha->current_topology = ISP_CFG_FL; + break; + case TOPO_F: + ha->current_topology = ISP_CFG_F; + break; + default: + break; } ha->flags.gpsc_supported = 1; @@ -4681,7 +4720,7 @@ qla24xx_get_port_login_templ(scsi_qla_host_t *vha, dma_addr_t buf_dma, "Done %s.\n", __func__); bp = (uint32_t *) buf; for (i = 0; i < (bufsiz-4)/4; i++, bp++) - *bp = cpu_to_be32(*bp); + *bp = le32_to_cpu(*bp); } return rval; diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index c5a963c2c86e..20d9dc39f0fb 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -30,6 +30,9 @@ int qla_nvme_register_remote(struct scsi_qla_host *vha, struct fc_port *fcport) return 0; } + if (!vha->nvme_local_port && qla_nvme_register_hba(vha)) + return 0; + if (!(fcport->nvme_prli_service_param & (NVME_PRLI_SP_TARGET | NVME_PRLI_SP_DISCOVERY)) || (fcport->nvme_flag & NVME_FLAG_REGISTERED)) @@ -676,15 +679,15 @@ void qla_nvme_delete(struct scsi_qla_host *vha) } } -void qla_nvme_register_hba(struct scsi_qla_host *vha) +int qla_nvme_register_hba(struct scsi_qla_host *vha) { struct nvme_fc_port_template *tmpl; struct qla_hw_data *ha; struct nvme_fc_port_info pinfo; - int ret; + int ret = EINVAL; if (!IS_ENABLED(CONFIG_NVME_FC)) - return; + return ret; ha = vha->hw; tmpl = &qla_nvme_fc_transport; @@ -711,7 +714,9 @@ void qla_nvme_register_hba(struct scsi_qla_host *vha) if (ret) { ql_log(ql_log_warn, vha, 0xffff, "register_localport failed: ret=%x\n", ret); - return; + } else { + vha->nvme_local_port->private = vha; } - vha->nvme_local_port->private = vha; + + return ret; } diff --git a/drivers/scsi/qla2xxx/qla_nvme.h b/drivers/scsi/qla2xxx/qla_nvme.h index 816854ada654..4941d107fb1c 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.h +++ b/drivers/scsi/qla2xxx/qla_nvme.h @@ -142,7 +142,7 @@ struct pt_ls4_rx_unsol { /* * Global functions prototype in qla_nvme.c source file. */ -void qla_nvme_register_hba(struct scsi_qla_host *); +int qla_nvme_register_hba(struct scsi_qla_host *); int qla_nvme_register_remote(struct scsi_qla_host *, struct fc_port *); void qla_nvme_delete(struct scsi_qla_host *); void qla_nvme_abort(struct qla_hw_data *, struct srb *sp, int res); diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 48d1003c8178..15b63136961c 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -4789,7 +4789,6 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) struct qlt_plogi_ack_t *pla = (struct qlt_plogi_ack_t *)e->u.new_sess.pla; uint8_t free_fcport = 0; - u64 wwn; ql_dbg(ql_dbg_disc, vha, 0xffff, "%s %d %8phC enter\n", @@ -4817,10 +4816,10 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) fcport->d_id = e->u.new_sess.id; fcport->flags |= FCF_FABRIC_DEVICE; fcport->fw_login_state = DSC_LS_PLOGI_PEND; - if (e->u.new_sess.fc4_type & FS_FC4TYPE_FCP) + if (e->u.new_sess.fc4_type == FS_FC4TYPE_FCP) fcport->fc4_type = FC4_TYPE_FCP_SCSI; - if (e->u.new_sess.fc4_type & FS_FC4TYPE_NVME) { + if (e->u.new_sess.fc4_type == FS_FC4TYPE_NVME) { fcport->fc4_type = FC4_TYPE_OTHER; fcport->fc4f_nvme = FC4_TYPE_NVME; } @@ -4862,9 +4861,6 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); if (fcport) { - if (N2N_TOPO(vha->hw)) - fcport->flags &= ~FCF_FABRIC_DEVICE; - fcport->id_changed = 1; fcport->scan_state = QLA_FCPORT_FOUND; memcpy(fcport->node_name, e->u.new_sess.node_name, WWN_SIZE); @@ -4925,12 +4921,22 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) if (dfcp) qlt_schedule_sess_for_deletion(tfcp); - wwn = wwn_to_u64(fcport->node_name); - if (!wwn) - qla24xx_async_gnnid(vha, fcport); - else - qla24xx_async_gnl(vha, fcport); + if (N2N_TOPO(vha->hw)) + fcport->flags &= ~FCF_FABRIC_DEVICE; + + if (N2N_TOPO(vha->hw)) { + if (vha->flags.nvme_enabled) { + fcport->fc4f_nvme = 1; + fcport->n2n_flag = 1; + } + fcport->fw_login_state = 0; + /* + * wait link init done before sending login + */ + } else { + qla24xx_fcport_handle_login(vha, fcport); + } } } @@ -5065,6 +5071,10 @@ qla2x00_do_work(struct scsi_qla_host *vha) case QLA_EVT_IIDMA: qla_do_iidma_work(vha, e->u.fcport.fcport); break; + case QLA_EVT_ELS_PLOGI: + qla24xx_els_dcmd2_iocb(vha, ELS_DCMD_PLOGI, + e->u.fcport.fcport, false); + break; } if (e->flags & QLA_EVT_FLAG_FREE) kfree(e); diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index cfb5d6067f9f..5daa8832e389 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c @@ -1620,9 +1620,6 @@ static void tcm_qla2xxx_update_sess(struct fc_port *sess, port_id_t s_id, sess->conf_compl_supported = conf_compl_supported; - /* Reset logout parameters to default */ - sess->logout_on_delete = 1; - sess->keep_nport_handle = 0; } /* From patchwork Wed Aug 1 06:13:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10551759 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 1AF0B96FA for ; Wed, 1 Aug 2018 06:13:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A85A2A5FC for ; Wed, 1 Aug 2018 06:13:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2D452A645; Wed, 1 Aug 2018 06:13:58 +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 9A70D2A677 for ; Wed, 1 Aug 2018 06:13:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733244AbeHAH5z (ORCPT ); Wed, 1 Aug 2018 03:57:55 -0400 Received: from mail-sn1nam01on0046.outbound.protection.outlook.com ([104.47.32.46]:9984 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733233AbeHAH5z (ORCPT ); Wed, 1 Aug 2018 03:57:55 -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=UBZ/XzhE85PT5vXiJ68SSPjTSlXrnopp4jPhQ1U0XQU=; b=fsQP+X+ODxX9mSHmbErmsTdu8xXKDo8H0UsOuIXxxtWjt1cPFi+RWMMMrB+T6hkqVxxHsnrEbA9qLAnUqgULrxH+p5irY5KiBDpvjltbFzHYpyGVD+UTBf5CxzUHdm6UU+Rz8L5PQQB/8VcSB+I1LIWzyPiX+n+4cOLEBSV//ME= Received: from SN4PR0701CA0001.namprd07.prod.outlook.com (2603:10b6:803:28::11) by SN1PR07MB1470.namprd07.prod.outlook.com (2a01:111:e400:5838::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.14; Wed, 1 Aug 2018 06:13:53 +0000 Received: from BY2NAM05FT053.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::203) by SN4PR0701CA0001.outlook.office365.com (2603:10b6:803:28::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.14 via Frontend Transport; Wed, 1 Aug 2018 06:13:52 +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 BY2NAM05FT053.mail.protection.outlook.com (10.152.100.190) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Wed, 1 Aug 2018 06:13:52 +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, 31 Jul 2018 23:13:38 -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 w716Ddwh028809; Tue, 31 Jul 2018 23:13:39 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w716DdMx028808; Tue, 31 Jul 2018 23:13:39 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 16/16] qla2xxx: Update driver version to 10.00.00.08-k Date: Tue, 31 Jul 2018 23:13:35 -0700 Message-ID: <20180801061335.28709-17-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180801061335.28709-1-himanshu.madhani@cavium.com> References: <20180801061335.28709-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)(396003)(376002)(136003)(39850400004)(346002)(2980300002)(438002)(199004)(189003)(8676002)(50466002)(316002)(87636003)(8936002)(305945005)(6666003)(52396003)(44832011)(51416003)(356003)(2616005)(86362001)(14444005)(76176011)(47776003)(72206003)(48376002)(42186006)(11346002)(478600001)(69596002)(16586007)(80596001)(126002)(110136005)(1076002)(81156014)(81166006)(476003)(486006)(4326008)(446003)(106002)(336012)(2906002)(36756003)(106466001)(5660300001)(26005)(186003)(50226002)(54906003);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR07MB1470;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;BY2NAM05FT053;1:zChpCBNlR9yrRJJwkuLM5qKsXbXP5FGwocVn1hmTl+AqVJsC2OeBuamZ0IP4lwA5nSRvrLkze1eatab8NzP8MHap96EFr0f/pslnThaUA90NxGrUMbWy1iPPDoQeR0pW X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 574f6359-13fd-4fb3-ef4f-08d5f775f469 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:SN1PR07MB1470; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1470;3:aRht4zws4cxyh7bopRZGCOhKm+JnRDYF+KG3U/oxuqe1rIEDnT/fHsCTLmysh015P+DNyn8+C6so5ad4COskKXmMTCKiaZvfO8LKKj4+8U4TCy7D/gN0mo25d9SWHMdMfrfhedHr4bi6PbkRXliN2P3bLRD/Lf5+R9+LMYDSPPr+Xh7vGJ7zHmJLTZtBJPXHlY0yb6iHTkzTQf5zlb/oDZcnGJfiDaIaYGhRG4mk10d6la3J+68o2iqrgtz5ZhEu7Lqu/Dj/7DvmkdVSwo7QL5DBiU7o1ANUnbKeJi1BbKAnjdLqIFf4sQA4Qzs8zyYpZZQAB3+U94dQlOnYvbQSaAVvceKLjsJgUSIzRWuIg8c=;25:tsN68VRgfSZv3vslRBEDZyEk/wrV6vBDPDie955JzEsyEj/oGYJ+iB/S1qdvaIf16Ldt0gmypZz6C8I6zPZOM9nyLec6XO7+36Vtt3EdksEwHuGTVpGtJhLnHL5WG/8fat8RKIGe2t2WJszDyUVKeoSNoL9vidPj38cL2GyH9h7MJQq0BFblDDm7jp9JNPtn/AEF6n1iBhhOUJV+ZIf9rcSScwjb/vs9R3yUvSYAdZ+sHYjFODz2A5lw5Sm3p1ED2Gob//KcEmqsVvH8x5uA0Vj+1kYXth/t6yRUcnZUmlar4mpCvYYzZMnBLRlZiyVlaOrrYWRU9ptQTfzgyhNxoA== X-MS-TrafficTypeDiagnostic: SN1PR07MB1470: X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1470;31:2MTCjbWrm6VfRpChGfuljEeeEVyQ2f1/vdhXE6BC1ap7vbuMNARCmRt6ehpsn8zByIQO484o9zBxgNt4zW67Gscm6wYwxh9tc3l0nCfqenCUZC0c3xT5fkc5bL/pwMs/PDjDOZQlEhdpPjUNasTClxdsE1p2NrKmuWtDEoUkfVU4IumhKTyfzI7GWhS8Ie9Rb+VBG8Es1o7LmaZOM/pWVaEgw788cyw3AoiEz8ep56o=;20:qY2UJ6LTqDJc4u4fGYdUjEqEau6KJrdbkweh/4/A14nMjKjLZ6CQ1UPI4yEs6Nymd7E8dv66RblnclqQ9ER6Z/PAHiyeiP86gDhPEQWKZBtw+F9eYdCbbihBew0SSeiY4C4V+P/5SPV+Xe0M1fV7H1hj451ZKJiXtoEuhQKWGmzmscJO2xiuWdYkK+OFuBUE9biUgQODKvyHOKgzZDW8V8QTnTjpS1mIhjHUbiuXKkr036eogtghPmBXct+tjs8LmZy5E8ZAE5f5HgmQFxmmN7tuvxVG3sjcA6RYor7tg6wkYP2+N/iqbg54A3Pk4fMYx7Lx+j0IFObUQQ0yhBloZ4XchZCWJezLsySwm7zAIQuFOljZe0oZl/gvV2hD8l7cQDm9j/nQxbotFuP3XY5Kkr0Hk2Kdp6sCZC3wjNYMXA9NbWXzhi8XDc9QsHcB6+jQEY1J5afFz1k1j1HQm0PuSOerYsyHjuxl/KhrorBgSxWKyK9t9Q39XH8xC3LWxaFO 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)(8121501046)(5005006)(3002001)(93006095)(93004095)(10201501046)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:SN1PR07MB1470;BCL:0;PCL:0;RULEID:;SRVR:SN1PR07MB1470; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1470;4:t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Vm7+PtUv881qCyoXIA9pFWahrb7wdWJlxpLvRxUcwDRYbWJ/5ztd4i0orYNMplgyGvXHySys22SUKR1vITBWeQOCk+V3HAQuQ6fkBo42kKCQ9cpVyRQPMEXuULx/kyrKQ3z6ymwQAGwgCruomwnz1EjbTCw7ny8FLZ4kz19eWomGOik945BHO5hNRhuRJ4mgNHC8z33/xnnx046kut7AOAudVmEaO1GCwHo40B9nPAiCA==;5:/0jJkNQBw8fD3ZBuuT/h36UWehmgZdmVZ8dIsZ4GryxAPzgc00BMVHAZwLjXoDxsXe18TpEAaoP3oHsdozanvjPLtCtLD0aEe4w1kke+UX6zS8gccoDsM/BJm27Tlyyp6mfCCEURJAgCL2l/9pDRHbAIKg4OVvRvlAiK9KU7GZE=;7:4LhBHJKzrs3uxO+KY0so8uU8cF6yYQjgDyn/gDPsoFHITIbZr/HQCI1H6iiDrQBzUHHZExDHmGUKP/WXXodce84uI6e82HAVbAETjBumeXUcp43uU48E9BpHDcKf2Ort4jmWR+kJ7bLInPYLQT1ctVySdfcQPtcS7UCbXTh4YAeO4aY0K8sQQG/ThhR17cfQQuiJklIMgrunML3tq/QtRdIHUXSKkqA2Ia2dqshQ4mgFOiLy4ZSUMr2IMAXyhqws SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 06:13:52.4579 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 574f6359-13fd-4fb3-ef4f-08d5f775f469 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: SN1PR07MB1470 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 Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index 1ad7582220c3..3850b28518e5 100644 --- a/drivers/scsi/qla2xxx/qla_version.h +++ b/drivers/scsi/qla2xxx/qla_version.h @@ -7,7 +7,7 @@ /* * Driver version */ -#define QLA2XXX_VERSION "10.00.00.07-k" +#define QLA2XXX_VERSION "10.00.00.08-k" #define QLA_DRIVER_MAJOR_VER 10 #define QLA_DRIVER_MINOR_VER 0