From patchwork Wed Jul 25 17:01:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10544447 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 B1CA2112E for ; Wed, 25 Jul 2018 17:01:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EFBD2A83D for ; Wed, 25 Jul 2018 17:01:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 939AD2A872; Wed, 25 Jul 2018 17:01:30 +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 D69F12A83D for ; Wed, 25 Jul 2018 17:01:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729428AbeGYSOB (ORCPT ); Wed, 25 Jul 2018 14:14:01 -0400 Received: from mail-sn1nam02on0088.outbound.protection.outlook.com ([104.47.36.88]:2067 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728557AbeGYSOB (ORCPT ); Wed, 25 Jul 2018 14:14: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=vpR+ZPVIY3jhsWai2nLPw4/KldpJg082zKHpqbYEO/Q=; b=Sfg7rkrWwsSHACjt+sU7AnK5QDjYrH57PoEEtSwdMb48MVAx+SVufSYu05zCHJIwiLaNEcQtF26E7caUSZhpG//AKd6KQq/SRbOwfTligcvHAr88U8N8ounhEbE7WbVTdAMR786mj/MejdRmxjLf5m6ZG2DxP5zwvF6tcR7ELqU= Received: from DM5PR07CA0030.namprd07.prod.outlook.com (2603:10b6:3:16::16) by DM2PR07MB1465.namprd07.prod.outlook.com (2a01:111:e400:50c3::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Wed, 25 Jul 2018 17:01:25 +0000 Received: from DM3NAM05FT022.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::205) by DM5PR07CA0030.outlook.office365.com (2603:10b6:3:16::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.973.16 via Frontend Transport; Wed, 25 Jul 2018 17:01:25 +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 DM3NAM05FT022.mail.protection.outlook.com (10.152.98.132) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256) id 15.20.1017.0 via Frontend Transport; Wed, 25 Jul 2018 17:01:24 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Wed, 25 Jul 2018 10:01:20 -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 w6PH1KX8010308; Wed, 25 Jul 2018 10:01:20 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w6PH1Kp0010307; Wed, 25 Jul 2018 10:01:20 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 01/16] qla2xxx: Cleanup for N2N code Date: Wed, 25 Jul 2018 10:01:05 -0700 Message-ID: <20180725170120.10269-2-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180725170120.10269-1-himanshu.madhani@cavium.com> References: <20180725170120.10269-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(396003)(346002)(376002)(136003)(2980300002)(438002)(199004)(189003)(186003)(72206003)(54906003)(86362001)(2906002)(110136005)(50466002)(16586007)(8936002)(48376002)(81156014)(1076002)(106466001)(106002)(51416003)(8676002)(76176011)(81166006)(87636003)(26005)(36756003)(50226002)(42186006)(6666003)(316002)(336012)(5660300001)(44832011)(69596002)(476003)(47776003)(2616005)(126002)(486006)(4326008)(478600001)(305945005)(356003)(80596001)(11346002)(446003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR07MB1465;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;DM3NAM05FT022;1:IxrXwmJu30T+bRBLqzDjewji0Tob2votZfAJ5bbhRIuK3ZWW0LWANqfvfOK0SbmU3sjHMY/ySBGWZE4OWYl/vwBSmDSjvnok8s+h+c6k9eqI0ndIMl7NmDIvjBCL+ayp X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 48326711-c1d4-4e8d-0ef6-08d5f250414d X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600073)(711020)(4608076)(2017052603328)(7153060);SRVR:DM2PR07MB1465; X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB1465;3:bWa1G2xQM3pCbsE1OFEsEe+FIiONOa3DHnksdNRAswgBTz9TgsgikSOME/eBHyG74In9FhPHi5OR456r9hvFpT1vWf1AkuqfiZdF3YoKQoWK7sotVPPJrvG04/9/4kQfOqV2Cj6LeBtRRzCNlVdA+OnyM0asqKLt3qaZGA6Wk9TTzb5Fjgd5phNyE4zmA8u8td1a0h6sJfOfBnBzyY1J94oqTD+vf35BnOguVO2GSfOJ9klwk7t4Lv7zGWzK+dZVdH79hHS73e8P/CJN9ceJs2ZutK/AOcdSjGJ8/NnmhR7lfvR33bjJimF3tlMNTyJfX6HGji6ymg6eQcZAJw1ezXoTSmtjpScLBVSTDmaX1M4=;25:uLejzF0L4AzDavOqTUc5kr7lHzpH44EUCQjXR6Gsq1znZu64XavA8b+3h8mJxmDNczl8WZ4lKIfWHTurbAFXaixUAWlfiaHG/lyH4MZ58AV43X9gmyEZnVV/LOEOaCBjt1smjoiGCV14ziw2EVK3OpTZIIwKMWwlYTc4uw+lyW8wY2g3mFW0czjEwfvqeyshrbre1Fl7rYGpNr0507hCma2mZFuRAB1N8bZL7gKh20FlH1b0RaRaGoBWLv3EwEt7rtRp6X3KTZpdZ8/y0XEI1AGnJuqVmAbIq0rMy4Vcs2mjDJNnJa6r2ZlmS4aFW0uHEDmGonugz2IDfiq7OC8r0w== X-MS-TrafficTypeDiagnostic: DM2PR07MB1465: X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB1465;31:0PTui1hQ+pKMIpmu+uG92GWQaCd84bKdZYQuu1GQtezRAXvG6gc/KKmcAvy7ntnFKrimaPiXMMBjQf6UtxR3z4/kN3kvuXQRCp6cRwG2snGmlwnx3nre+W4fgqyD0YWWKXfhG9Qt1kOg3BJ0ED1V0sVHS/t5ehbmHG9TC5TecEUDXGM3f44kiw2KsAkVJ3EPxw47cIrDUn9+2UDYR4/B8yI4gHMVmRpu1hvBhtEV+gg=;20:CFzqOqWM1M7IzZtVV9sIxn4cy4rGgaVp916NWBEZWz+r0J43B4Y1Wp1kEQUZwvjlyyBcdVIqERfufQxSdqnQX4XYEMjTrUbscr9eDWKWjugY2EXkC9o/VakRwV8X6c96tKeLiuBLwiUQx1byHUA3KCVweBlasJtiIvlGCM85o9ZmuKMSQYUwcEKeFbblPsoAUl2jxnvPa5Iydtfyd8kdevYj+Y8ygC9qkVso6UyF8vg7f4xlbDhuCrLGX4a/wRtfUM8gU4kze3l+CtX36VNKe3T2WHF8tO4bOHFWYIAAgipZIQ4tyNQ6PDk2UFi+/h8NRe+PcPJQd6OHOJ4lKbU4hL+fupuk77inkV5qNnmkmz/hpFr/hfxScQ5EQWwQoZOVv5v+cyydFOQQA8VZuVprC6nrWELBOZL1UR3e8BeeFiA7SqY/0t7A0/2fYDJ10mm/ObJvmxcWDEbmfBSmy4mDJ374ff1HX6aexsYOiKsWyLRVHmn1zjl50ns8EeZktgO9 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)(10201501046)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:DM2PR07MB1465;BCL:0;PCL:0;RULEID:;SRVR:DM2PR07MB1465; X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB1465;4:4g17vl+XWc1RlnzV4bsaCX8LTlksd4phuE5Ts+t+VwHHYArAsA1xvSRUouHO2oflWv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9b6o/5BOOxYu3LRjz95lVlfQ9WGhIe9P18STgRyU/rC9HFmO8Vs+2sGB+mDkHxFYCDJIWEKudUE1VoFpbrrnZYBUHaei7jv4CZZEws8NsgoQlTTCEhRu9pNGtDdtzQYFGgyoUUQ==;5:kni/7eGqasQ4GiYh6/s+b7gK5wZCjb8RIIwB4I30HdVxloYDa4DMmz2J5hCDWSRtL+cA9onKnzAmwduGtNkxIsmnfn3ADrjB0DyVSUPadxB8AFxc3ipTL6sZjYGOBkY+rEYZgSNEf9r7XVJnjXSDr2sAAm6hI6J4/FhcI/G2qRM=;7:07XdKUPoq5mjOGJKTZDY6QFhzh3avgGY1N2HJZsml2gFWWJ+9TlzG2WV6nBYEZT6cFfNxBTPbNfv/lIs6fRvzolLgFeRWFFeHKg3gN5x6LjrD24GCJWKuQa4lX0s4lu/T8l7vH9mxRzZFvC0yTCfjrzoY8ZfYIWUY93zoLTtZljacY/HPLOEvHA9qajAI/zbrULJk1bwUdGs7k+KSJORiRomgWGno32y64h1EeQyb0vBR9Qc/pimEsTTYaqmN1tq SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 17:01:24.6699 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 48326711-c1d4-4e8d-0ef6-08d5f250414d 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: DM2PR07MB1465 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 1b19b954bbae..f7d03cddb583 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -4688,110 +4688,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. * @@ -4848,14 +4744,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 Jul 25 17:01:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10544477 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 6F2AF112E for ; Wed, 25 Jul 2018 17:05:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 566FB2A72B for ; Wed, 25 Jul 2018 17:05:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A3032A816; Wed, 25 Jul 2018 17:05:35 +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 331B52A72B for ; Wed, 25 Jul 2018 17:05:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728634AbeGYSSG (ORCPT ); Wed, 25 Jul 2018 14:18:06 -0400 Received: from mail-by2nam01on0061.outbound.protection.outlook.com ([104.47.34.61]:19648 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728913AbeGYSSG (ORCPT ); Wed, 25 Jul 2018 14:18:06 -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=1/JvaO4xG0u2Uq959EQGujkhsQ4QF2gc2Ig9urVj9q4=; b=GTv4cxFGg9df6lV0gCel0DPCUIM37HmR3Ed4uIlrS2VWUDlD1yeG6yoHHiX50H1LKnT/AZhIuuaXF37kmAaQ/cT0TXR5qay79jvTgtL2YgdDc9hjxe79Dp+HtwINMqTV/VrURqqmoBcDdDzH/BiOjS8LvyvK2J7tcmoNQrz/8Ks= Received: from DM5PR07CA0039.namprd07.prod.outlook.com (2603:10b6:3:16::25) by DM5PR07MB4071.namprd07.prod.outlook.com (2603:10b6:4:b3::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Wed, 25 Jul 2018 17:01:26 +0000 Received: from DM3NAM05FT022.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::203) by DM5PR07CA0039.outlook.office365.com (2603:10b6:3:16::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.973.16 via Frontend Transport; Wed, 25 Jul 2018 17:01:26 +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 DM3NAM05FT022.mail.protection.outlook.com (10.152.98.132) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256) id 15.20.1017.0 via Frontend Transport; Wed, 25 Jul 2018 17:01:26 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Wed, 25 Jul 2018 10:01:21 -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 w6PH1Kme010312; Wed, 25 Jul 2018 10:01:20 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w6PH1Kc3010311; Wed, 25 Jul 2018 10:01:20 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 02/16] qla2xxx: Fix N2N link re-connect Date: Wed, 25 Jul 2018 10:01:06 -0700 Message-ID: <20180725170120.10269-3-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180725170120.10269-1-himanshu.madhani@cavium.com> References: <20180725170120.10269-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)(136003)(376002)(346002)(2980300002)(438002)(199004)(189003)(80596001)(110136005)(47776003)(186003)(486006)(106002)(44832011)(5660300001)(476003)(356003)(6666003)(11346002)(446003)(305945005)(126002)(69596002)(50226002)(2616005)(54906003)(16586007)(42186006)(2906002)(50466002)(48376002)(316002)(14444005)(86362001)(36756003)(76176011)(336012)(8936002)(4326008)(106466001)(26005)(478600001)(51416003)(87636003)(1076002)(575784001)(8676002)(81166006)(81156014)(72206003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR07MB4071;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;DM3NAM05FT022;1:5wNg3/IkoqDbQ/PtwizzJ+JtTzscQcj23c1GsW601kDmRiziMtuZLwWuUu0bk88oIfjHXks7LR/8OV57IAeWq56/NoSce4mHMiyW/+zIM77VfbYS2RjAse22xvd6FSCQ X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 207f0fa5-0c80-4444-7a73-08d5f250425a X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600073)(711020)(4608076)(2017052603328)(7153060);SRVR:DM5PR07MB4071; X-Microsoft-Exchange-Diagnostics: 1;DM5PR07MB4071;3:uRwyR+FV6ML4uJ0/YynOr6gaqKw5Ldp0dFQtHUYYyRmqFKMT62U3FoCWRes+5OjyRmeVHQdhdBY1glUVEQ7tkXg22Iu48lPf7lfgCpbVa7I/w9nNE/1Nw6zpEWSi80xkDAMylsr0xVn0Umi7F/Au/W/0DbjcyNf3xgobs6LpJ2kamb855+31M8CczI4qWE+Rr6l/5UC0BOa3GE4MbWY57RXRUujhBUYlzuwpBj3Usyqeuiv7xigw/ktsG8kWCyHc/3hDkfEWC+FAhaSXnKu0EtfgdFuMVKQ8IkFLN0JbRlhEhvCJRvkx8xbF/Rx4/bE0FREEoalJ5NXS3hSPC9Pf5ydKwJlN56JOyE6bufPzG0g=;25:viXmvhyXK6iCdeYOjL++uPxe8skk4qukyyR6Xu+hJwhSWlkKfp1hRolpPbP0trrWcSzG/VLuh5+7fXErRMQ6JCu600KlOOUg+ASTndFztcqmbjh7Y2vyt/e5HOQJTDJkjcDmUDbmtnMOicLqOgEfKalxtQe3kFaduFo74ipeR1JloWR6oJvAe2ruPJTHVNzjgRgsija6YaNm1oIxF0OtQc+wxTyJFPQsJ3DysxrkzswhescLXx687lXDXpKoEek9QWX9/hmKXlLM70/njRX4T7cM3jralRzDOPwlMDMF4a7o5Eyi/Y5cxd7Jfn7nea1W8Q1zlRWiS0sqsEKdNkwDlg== X-MS-TrafficTypeDiagnostic: DM5PR07MB4071: X-Microsoft-Exchange-Diagnostics: 1;DM5PR07MB4071;31:J3J3WO1/4YyI6LtLMWvbXULrtK4azPSWr9zb0XJhXamPNqBOsHyFtCJxY1C+EBWWmC7ARV3aY3dPuM/VOLAEwANmOlExC2z7bbMCKDc8gcLo245Ssgmn/seeF3sEJbr+1O3GFjL7yiAyjAD6HInZPqxxbleatWvByuIKDCig2tFoYhjrVUc78BAb8ejJv+VRElwnX86/NXoQAjYwd6KLdHVpMHOzhMxSUwxDe10xIhw=;20:iw872VbW3YxIe33LtyPxpYzn8rWdckUUhz/jGxskvHMu0J5/Q3mmF6if3vGPCowAE0v9YDxRfV05GVfYI+2uwn+cY4L5lNpO0L0riGGJrb6EYxG+HKdZ04EXekImmKLk4Ue6VoJ+aVQyb2hq/UopoNHZATM6+6GMz59ptI3eG34RbaPasEzN1TYaZOdcRK6BRYjuhCUkC2ycbaaFoEhiqZVWhIiE43GI3Wnd2eWsAC2LcuMYW1ZYl+hONrxR24RgqwjyhdRqu7Atxr42xYd5RKZRvYSr1HwTKqjBy4qAATsq/LBdqzi6gqGwy/jhQsKJGhWTX7rrIppGofsPHXHuF6QslvhZ+WVyBFR+jQZ6Bv+x4J2Qu7/JVXhD8tbQHVaOCheqNZoM9FnP7EKHl4Ea8bFnT7E7axlG17iVSyv2twBZiJlnL6FwYfRZi0dkTJUHHv0tGdiyahgVy8bkLHbPOtb18MWfdJCkG1whTLCxra9T167p1Ji3sQyWDExXbVnS 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)(8121501046)(5005006)(3231311)(944501410)(52105095)(93006095)(93004095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:DM5PR07MB4071;BCL:0;PCL:0;RULEID:;SRVR:DM5PR07MB4071; X-Microsoft-Exchange-Diagnostics: 1;DM5PR07MB4071;4:fQmk0OjpbH9H8EVmgOUaThpcIiA1mcLl8+VoXfJqf71pvb8yQL2H12prII8gG/S68AFCFWczAp47bW/WOLoJxyzIN8y93yn6B5iCkptxnuG92L7GlJQxmd0qi0FQK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7CrCghM7vrCOIotNgywOiRYBckA0SCKM2q0fOooVGpybbV8u5FnCPrvz8rTK1FDoZM71vyi5EYy4+DeopVNq7hXw3lfZqIPlNbnlpWd4b4uq8EYES4ZLlj4jWvbeSUONNe4OA7tSNelUEQuypskvW/GhdSt5cYeYFzYcAa6OKLR8BUiCKmEd8yYDyXMDayjxrhiRg==;5:zI+K6NB4beIn+vWDKZgeA9x714xAzqhuuyo3BJZi7DY2TOSomw/3y4hmX7V12xG94vlh8l2x7wzggr8+v2feUW/6/Ex9sX/+nvuLNql/jq+msWEZuy2PbiK1X3rN0XJ85uAKnF+WVf4joNfXtZqNift0ge4OFct77xylH+B4V6Q=;7:fSwl6vQ2HHh2I5ilRxLVgC/TVL2ZLrzmKSLFlSMJar71w99Juh3iEUXziOMgdoKAR7qgnCHwJdOcqzVvljrlUQj5eTzakPtUcVV4VcBozvwyr+RywiybbNDZx0YHFULE1q3gO7H81t6FH1AnIEp98LDcN7bibajE0kKQeH1EAPbfp9qrVjrgUQqaujcQHfx3ErKxRrfoXMwEaqkb/Db8O29mDue7P6iyLKv7sXndbRLr4jCC36qtN/T4mhax+dut SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 17:01:26.4355 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 207f0fa5-0c80-4444-7a73-08d5f250425a 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: DM5PR07MB4071 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 | 223 +++++++++++++++++++++++++------------- 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, 179 insertions(+), 106 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 0f94b1d62d3f..b595479d445b 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -379,6 +379,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; @@ -4238,7 +4239,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 f7d03cddb583..258f95c79c06 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,68 +572,124 @@ 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_find_new_loop_id(vha, 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_clear_loop_id(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); - if (conflict_fcport) { - qlt_schedule_sess_for_deletion - (conflict_fcport); - ql_dbg(ql_dbg_disc, vha, 0x20e6, + 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, + vha, 0x20e6, "%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 */ @@ -4591,20 +4675,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); @@ -7930,8 +8004,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 7756106d4555..36cbb29c84f6 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -911,7 +911,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 f0ec13d48bf3..59cc02c946d7 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 1fbd16c8c9a7..d42ad3a1f9ef 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -6179,6 +6179,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 9952e51f2e90..5fad046f8a93 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; @@ -4715,6 +4720,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 Jul 25 17:01:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10544449 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 C603C14E2 for ; Wed, 25 Jul 2018 17:01:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B18D02A1A0 for ; Wed, 25 Jul 2018 17:01:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5F312A843; Wed, 25 Jul 2018 17:01:33 +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 CD70C2A85B for ; Wed, 25 Jul 2018 17:01:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729447AbeGYSOE (ORCPT ); Wed, 25 Jul 2018 14:14:04 -0400 Received: from mail-bl2nam02on0048.outbound.protection.outlook.com ([104.47.38.48]:18333 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729106AbeGYSOE (ORCPT ); Wed, 25 Jul 2018 14:14:04 -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=7OEjVO0PBC6r92iNGPuqrsuIcxnz3OF9WTwpKPa9Vx8=; b=U9Nimbu9aBsVAKDVgR7/K/zN3pbfFBTgTyBOn2DrMI2diq9VIyCrWBMuXFfCZQgZ0mtG8g05736EqjFWMMlzwW7sJ10y/V4f56WrcPmZDJQTwvPSut+Udst4xAbWPJsBJdgydP5rdiZJWAp0mlOsCXqiHX4zuS/rcVMigMxyNTY= Received: from DM5PR07CA0047.namprd07.prod.outlook.com (2603:10b6:3:16::33) by BL0PR07MB4065.namprd07.prod.outlook.com (2603:10b6:207:4b::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.21; Wed, 25 Jul 2018 17:01:27 +0000 Received: from DM3NAM05FT022.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::209) by DM5PR07CA0047.outlook.office365.com (2603:10b6:3:16::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.16 via Frontend Transport; Wed, 25 Jul 2018 17:01:27 +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 DM3NAM05FT022.mail.protection.outlook.com (10.152.98.132) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256) id 15.20.1017.0 via Frontend Transport; Wed, 25 Jul 2018 17:01:27 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Wed, 25 Jul 2018 10:01:21 -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 w6PH1Lcm010316; Wed, 25 Jul 2018 10:01:21 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w6PH1KKD010315; Wed, 25 Jul 2018 10:01:20 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 03/16] qla2xxx: Fix login retry count Date: Wed, 25 Jul 2018 10:01:07 -0700 Message-ID: <20180725170120.10269-4-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180725170120.10269-1-himanshu.madhani@cavium.com> References: <20180725170120.10269-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)(346002)(136003)(39860400002)(2980300002)(438002)(189003)(199004)(47776003)(1076002)(80596001)(81166006)(8676002)(81156014)(106002)(8936002)(14444005)(76176011)(44832011)(69596002)(356003)(16586007)(54906003)(11346002)(51416003)(110136005)(305945005)(446003)(316002)(5660300001)(86362001)(26005)(2616005)(126002)(36756003)(478600001)(4326008)(87636003)(50226002)(72206003)(186003)(50466002)(42186006)(106466001)(6666003)(486006)(336012)(48376002)(476003)(2906002);DIR:OUT;SFP:1101;SCL:1;SRVR:BL0PR07MB4065;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;DM3NAM05FT022;1:1rYRHRAYwuSt+cLpfcqZKFrTIwAm6ZU3X4L3hWzoBZVFx6JPFX59ZkK5tDSZuTyUBgRrJnfcq6gt3eZxJ4DdF1KXlZtTz/eZTVClSlvDc/yQVBEUNjrnyUhdkYYN1aic X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f01f298b-a528-4501-132c-08d5f25042d4 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:BL0PR07MB4065; X-Microsoft-Exchange-Diagnostics: 1;BL0PR07MB4065;3:mXtGLc1q9QB4K3yAWXaugC+XbPlh1vc+2B6xIG/EbDpRkROhOg7ENK4IJHFsDTSAFvEU72xUWIJwENkjYFKUBO7ij8wNC44n8kVRDUEGVp356co23k/EVc7b7hlwdfD1MTOHr6pMDnuZ7y2SdhchqgKx/HRxMNbya4vi5IJDe0B3akRV8mCK0BlRHH1tZ7EkuuRyF9SznWxeB6yfJp3yuafY1lVOPmycJLoRKI6fRymzY1NIaVyHYD9AsOE4EaALo7Bt8M6nMSj5YrpIQsgfHUSVH3P+N84TU3UcdxmUEYKZlmiGOu0V1oHCS6nyMysD6HYb0diLX1wFeTBQxDtH402FqprULhSV+8ajswDHXxk=;25:ceZz/EpV4ibbsTvoObkZFh3WPkcpqfZn1QdP9RI1iW/4/3tr+3C4NIKYnrAn/nb+sCLGJeXb/B3R7qOI5ILN0pRvp7UXrFFohPd8rYXW4nj5u3KUCfkRQi4Tvj92y9ruab880Nki1Rz15pca2+C/VYsKeqzglnlDLKVFBlIt3gHkCpSnmown46v+5z9zbgAWxJvjYGrbVdQYi4IdZsykdSSGNKCbhKTt6VYKbYLF5Ge8IK/O+CWlIdb2dW9H8l5MqdKHb4sP1BaV26bQgwfCtUpSnUIYqft3x7wWjxySVjMccqXCHDeXDZcEhzV0v970s3hS4bfDnUebnK14tttiYA== X-MS-TrafficTypeDiagnostic: BL0PR07MB4065: X-Microsoft-Exchange-Diagnostics: 1;BL0PR07MB4065;31:uv4CtJh2oNwxBQwZn327ZQmzK8WKsZInP0HKrpgWyPMAsg2QVTCrodbG7NpVXLa3h/2fHCQOF/dTKY5Ggdl6ZTJZ3xL+/GkTfam3zOooGnkX6GMksrIrW98E3UPY2PeeXL01wj17OVsX2WpQ5tV1ViaLVaGwYGSenmhqDwAoPYqmkaoaOj6GhULIouMmVAVJ3Ofo8T+yj6L0iTIX8v4Uq447gweg34JMVYZpygpT0o0=;20:akk1xuKCmitP7ICLcbPOIQv65SwxS4jUCqR8QfYlf6UrSxI4U+L6b5Y+NTleIlv1sERrGsO2qP3z0MjUED3hJtNe1E2OiTtnhhRG10GarHaVHDj+idk2Mm4o5hQ16WexXbQed2KhF47HPpShZNnq9KT/3kBkvNJvlKNjk1WkqdVOmZR3MZZpXfdVTpGeLehYBYllvztlJZWzLHFfsagLqOISDKKJ5FImKL6Z0Oj64GcdHqUS/KmohJgUMgflTHPcvbtoV5LjQwxlbfMfPNSa3H6eGjp5jex7Bbrp/z3UN+7CS5TQLWe4aXk2L204a4ertwck6OTMkceIvgQcMWI6RM27IvyLQWz8KOtC+bF7IyoRgZ38IeVJaYqpJZzjaLzJbdfR/HJMa1KGGcbK6IUGaJyL3A01b1a13YwEOSyO5xqEXi6m1X/hbNvXHCfqwkJ5g4xS1H/RICW8PTcQ/tC+fdVEYY0Jb0ccNRLyxlO/B65H+Pg/ebGxSCj8KpuX595X 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)(3231311)(944501410)(52105095)(93006095)(93004095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:BL0PR07MB4065;BCL:0;PCL:0;RULEID:;SRVR:BL0PR07MB4065; X-Microsoft-Exchange-Diagnostics: 1;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Zj7XJz12mdB5UUlrnMxEAR+oEVvVmjfcZHH8dpkQon7vKPNhtsr9IgFX3x/BD55wOdI9XO/xQs/wqBbVGkIDD70KEeLYUG281KS+Vd5f8HBPB8HabKjB7QwPBwvKfjqk9P/PT5Ty6IpvtoXzylBumDGEbIFVsNwZX4Jarneucs7FxxR2rmUB0ZIRc8kFLK4bfZ+t89VetoxUIhW5uVTzpnVn/4sa2Tor8dM18Yt8iXWF6mdmRlJPWw==;5:Hcv2o7TJOND4kTnFhy97Jv4OJy7EYuGtZ87Spf31M1uyrVZHY7iPSjLDA5527LDUAdC/czWSa2a4CNl7X2aPHM28buZcMZnLdCqkmEJOTZ/HEup/KuDtKiKO3ZP8lGg1V/diz9HrNejNjPTVZ2eK4e6NlPnra2xqq9lAg8VrCcg=;24:hUOdzlRJalyypr7hmOiYhVOavI84bumthd5R6rtRdTF7a1h83SpB+Avb/7+d7lnpsR9MvjE3vILymxCGvlNKxGXMbbWu11BzngJCvmklT7s= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BL0PR07MB4065;7:A6+ckQ2GtzX7ztvzcipQeSvTBlkq/F012pH9BdvTWeOy0pH0r0jzAsPje0cf3cdup0wV/w89U3NE1hPa9odKDzn6HkekHEPuG3x8zwgGv2WQ13+gs+w4bJ94q6ergaJLjq5V2UdMv2VpqV/KVy79LLZ79dRGf6493UE7TXfEb4MrA0czdGYt+ELRX1XwY7OVMbg16CjquL/CYRsZXJhi/M9tm0Do75HHZuox5RHnUi8WSeYUY5BPsFRowVLdMIqA X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 17:01:27.2324 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f01f298b-a528-4501-132c-08d5f25042d4 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: BL0PR07MB4065 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 7a3744006419..74a7f372e3a7 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -3483,6 +3483,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. */ @@ -3981,6 +3989,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 258f95c79c06..067706c9e56f 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); @@ -1258,11 +1255,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, @@ -1275,6 +1271,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; @@ -1291,6 +1288,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); @@ -1305,6 +1303,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; @@ -1388,17 +1387,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); @@ -1883,7 +1871,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; @@ -5077,11 +5064,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 59cc02c946d7..4b576aabba30 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 d42ad3a1f9ef..79514d43cb32 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -3830,14 +3830,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); - } } /* @@ -5090,7 +5082,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) { @@ -5099,47 +5091,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 5fad046f8a93..70c98316b793 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 Jul 25 17:01:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10544453 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 C9969112E for ; Wed, 25 Jul 2018 17:01:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4A5D2A807 for ; Wed, 25 Jul 2018 17:01:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A880A2A816; Wed, 25 Jul 2018 17:01:38 +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 3AF442A86B for ; Wed, 25 Jul 2018 17:01:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729506AbeGYSOK (ORCPT ); Wed, 25 Jul 2018 14:14:10 -0400 Received: from mail-eopbgr730040.outbound.protection.outlook.com ([40.107.73.40]:9136 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728557AbeGYSOI (ORCPT ); Wed, 25 Jul 2018 14:14:08 -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=hZvpiDo7MJPtQJ1xhGlYsOUshJMfSpGimitUBRzXopAH3Nj3Md50p8nB5QOYA+yHEo3KR8QCCDrBs7iu79xQpfs4sSl92iR72q55vIAEnOmJmQrAh5AJuOXN7+DIJYi4JDZuv2DaSbvlmcqehNlIzou0BxbF9GBf/MbQiJFv/cA= Received: from SN1PR0701CA0025.namprd07.prod.outlook.com (2a01:111:e400:5173::35) by CY1PR0701MB1387.namprd07.prod.outlook.com (2a01:111:e400:4c1b::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Wed, 25 Jul 2018 17:01:29 +0000 Received: from DM3NAM05FT064.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::205) by SN1PR0701CA0025.outlook.office365.com (2a01:111:e400:5173::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.16 via Frontend Transport; Wed, 25 Jul 2018 17:01:28 +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 DM3NAM05FT064.mail.protection.outlook.com (10.152.98.188) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1017.0 via Frontend Transport; Wed, 25 Jul 2018 17:01:28 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Wed, 25 Jul 2018 10:01:21 -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 w6PH1LnA010320; Wed, 25 Jul 2018 10:01:21 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w6PH1LG7010319; Wed, 25 Jul 2018 10:01:21 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 04/16] qla2xxx: Add longer window for Chip reset Date: Wed, 25 Jul 2018 10:01:08 -0700 Message-ID: <20180725170120.10269-5-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180725170120.10269-1-himanshu.madhani@cavium.com> References: <20180725170120.10269-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(136003)(396003)(376002)(346002)(2980300002)(438002)(199004)(189003)(1076002)(16586007)(42186006)(316002)(336012)(47776003)(186003)(48376002)(72206003)(50466002)(446003)(11346002)(478600001)(26005)(87636003)(6666003)(5660300001)(106466001)(305945005)(76176011)(80596001)(69596002)(356003)(51416003)(4326008)(50226002)(2906002)(8936002)(575784001)(81156014)(110136005)(86362001)(476003)(126002)(14444005)(44832011)(8676002)(36756003)(106002)(54906003)(486006)(2616005)(81166006)(148743002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0701MB1387;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;DM3NAM05FT064;1:w8cnUxlaLvDW8IhAu84GR4Y/iKD1PSloAETsOxquM37icLIz0Afb+2FqXwFzUZ/tM8MS7jv2U9rGUsQVqOLbIfNRgsL3IrDkrpzXePaNjjGiqZvL+7CxTG4TIgP1FPrE X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c481bac1-bc86-4971-5307-08d5f2504380 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:CY1PR0701MB1387; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1387;3:D1oSf11OVWyBUxBqXB542AcAuGW5Ljy2DVy51VYJiBBVI7o+ofRryIPx3ByKwyXfhYoDJ/CW4QVPb+YzeEjM8D4O/mjQ1d57FmwBp+22u4cfnr5YEHmnt3LoiOelrJWBRrX8j8l0dOINOoCemVBiLQMGvlmPfcmQhpiAte5+y/Ngo1HnATVGQkxdOFcpHziI8+P00WTVN5hCB6hq9zacOoagn8NFOg73G2pAavaFyOm7FbqVkKEoF6t86t0AltATE3kk2G5hadyQFkC6u4aC/yLaa/OfXNkRxITxD//pV1xoFxeNs4lEyQ3kXOuXSCL+cF/sCEf9nNno+qwxaaedNUf2I/sd7mGu52XMV/tv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qS/L1LtF3X0/1n1f0zsdO1A481KEAciSPsN6prGIYgyOG+owJHYKIvqhFVUVAFx6Kd9VYzsxN+iDiB1W/EhR 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)(10201501046)(93006095)(93004095)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:CY1PR0701MB1387;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1387; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1387;4:Vspf3gtsdwdjK0O+hPEwHG4cPvj0y7rXAOqDN8upMK/h5Hh5zXgA+jzQJ5ohq8Rd28fsS2se5ZgEK8iQE/W2lePydsmNrqtx53QgBxdfduYSwP/Zg0vawXG+nX9uKt60PxC2+AE1VQAiIqQaGRIw9O+74kfvf1b9aB1PWkOU4BtkF5FgTwbr2sdy+9kF2f9sNQH9RLts05TOpDi8HO3kWPjtJHOlaTFPpihOhceCFtuL5GXF/b2fRD6DvIH/IUKInKsK3vUO36wK5FQiUXDSxA== X-Forefront-PRVS: 0744CFB5E8 X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1387;23:roW7tIKh0Uz+iH6HyLcnW3OlCMCaej+Z4GVEuJyvVtj63Ash/DNaFASSLajCzzGvSj3khJgv285nPXqa451tX52gwQ+KDzEvDU5SrAyC1aeNLgVByMlKZGIMVWIUNDjoi/2aIGoZXHPrHnsnH2Ed0jK11b17Z6kqKH/uKHb1MQyI34ojKO5L3GyW4knzz4snoDSk2l+bLHZNtt7aUChVUpOJrnEjejFdj2S6PAhyOOBYgmWF5k79W6uS/NyDvUZKZxwyNNH2eO0axntPMbs+xglOYQWX9vciC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zQj5OT3KBLwbPvrTgGIDA/pewX4wdO5aEW3jOeVRt5vvUZ6UIe1mEIhb59gxLEito6u6gs306A+WJxeG6if+nDsU5YnC0mT9xF SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 17:01:28.3613 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c481bac1-bc86-4971-5307-08d5f2504380 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: CY1PR0701MB1387 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 Jul 25 17:01:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10544451 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 6F76C14E2 for ; Wed, 25 Jul 2018 17:01:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A18D2A843 for ; Wed, 25 Jul 2018 17:01:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57CDD2A86C; Wed, 25 Jul 2018 17:01:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA6462A85B for ; Wed, 25 Jul 2018 17:01:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729490AbeGYSOH (ORCPT ); Wed, 25 Jul 2018 14:14:07 -0400 Received: from mail-eopbgr720071.outbound.protection.outlook.com ([40.107.72.71]:28000 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729450AbeGYSOH (ORCPT ); Wed, 25 Jul 2018 14:14:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pZB51cFgs/2d3DaoL5igdgUJ4QQoLJbjfd5HvE5VNjs=; b=NpgydMkw3L5HJTU4WGlj88SuvCqd2C5GPf3wKyOA9VP5bm5uZVpPLnP4vCEY6GSjGQRqQpEjLHYU9x9efOyXi6+Krueo8Iga3vbJJbQyJI8rT+JGeAOcwWIISP5pvWmpzh6lNbAtz4x4ERGl0WQnkMHetfZ8muqUYbhfr85RLSo= Received: from SN1PR0701CA0030.namprd07.prod.outlook.com (2a01:111:e400:5173::40) by BL0PR07MB4067.namprd07.prod.outlook.com (2603:10b6:207:4b::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.21; Wed, 25 Jul 2018 17:01:30 +0000 Received: from DM3NAM05FT064.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::209) by SN1PR0701CA0030.outlook.office365.com (2a01:111:e400:5173::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.16 via Frontend Transport; Wed, 25 Jul 2018 17:01:29 +0000 Authentication-Results: spf=pass (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by DM3NAM05FT064.mail.protection.outlook.com (10.152.98.188) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1017.0 via Frontend Transport; Wed, 25 Jul 2018 17:01:29 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Wed, 25 Jul 2018 10:01:21 -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 w6PH1LRI010324; Wed, 25 Jul 2018 10:01:21 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w6PH1LxC010323; Wed, 25 Jul 2018 10:01:21 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 05/16] qla2xxx: Prevent SysFS access when chip is down Date: Wed, 25 Jul 2018 10:01:09 -0700 Message-ID: <20180725170120.10269-6-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180725170120.10269-1-himanshu.madhani@cavium.com> References: <20180725170120.10269-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)(396003)(136003)(39860400002)(2980300002)(438002)(199004)(189003)(54906003)(14444005)(106002)(110136005)(336012)(4326008)(42186006)(16586007)(316002)(50226002)(36756003)(5660300001)(47776003)(1076002)(76176011)(69596002)(51416003)(80596001)(86362001)(2906002)(2616005)(26005)(446003)(50466002)(48376002)(106466001)(72206003)(186003)(478600001)(87636003)(305945005)(8936002)(8676002)(81166006)(81156014)(356003)(6666003)(476003)(486006)(44832011)(126002)(11346002);DIR:OUT;SFP:1101;SCL:1;SRVR:BL0PR07MB4067;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;DM3NAM05FT064;1:5WaBxdrqf88bULhzeLU5pc1Tokjf8slqE494mKhELyV4JsSJieGvKc36k9X2KnGImNT82NYqAfWxGpEk5dIOETy4aDSz5cvPBo0Dz4/YyU3Ah7SbxT2eg9lwzw2nfUif X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 626b5731-046c-4b9f-37c6-08d5f2504446 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:BL0PR07MB4067; X-Microsoft-Exchange-Diagnostics: 1;BL0PR07MB4067;3:dGt7tifxFU8/Lz4ca6FBlbBok+pLcT35vPd4UZFBuCwl7+z5gOCvPmWF+f7lOlOOrXN40FZq6WS2KIINM3twDqyWqLpHFflE4dht+H6Yd6iKrL/YM9KbltkP4RPyJ/SrIDSYn/pXNtBsmL3/riyyHJfajTJJdmnQzC7FdqVqzUu9dwYY+vQe4ngAPDjo67SGJo4qi6iEjcMdPfOJPpQ6esfwxSneZx7B428jWcZXmYlPWqipdWXlfL2QyZckN/HABG41L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1vMG57cDLELsBKwPz7euiRghv2YZbv6B09DshtlZFfZNNKwpmDraUOsoFdqgYOAArvCjpq8O91SR8xFm681UXbl4WTCv1LA3Bc82iXLT2ZtfUjlO8KP6OnCRWg1w74LSrVweP8x4yA6lq7VMsQA65vHkMqqb2d39O8Yqbrkeh4v8bTDkyCWH/ 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)(3231311)(944501410)(52105095)(93006095)(93004095)(3002001)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:BL0PR07MB4067;BCL:0;PCL:0;RULEID:;SRVR:BL0PR07MB4067; X-Microsoft-Exchange-Diagnostics: 1;BL0PR07MB4067;4:Q04CaBr8+QP2S0fjiB9cbathB1BUEplhdGdCEAf/qMRr+UtHmJcj5ivVg7yTBBbOVOzUF8o9QNRxFEpucmwH6LrWK1P/Caw434HqTA+g3xIGT3bbSOSXAk7xWWi8IlaeHIfw/XHJ6ohfnhqou2fV208ccKElrpX2YpHz4gyHsn56OOs6/IbqiUtgxV0fu41G8RSfc7j7Iz9dkPmdI5QzIBrFDt4/r7FAQr6ZUkL7eAdOBoRksHfo8KQg3gTd74V8yDRh8KeOF1tZaNC5+xKXpQ== X-Forefront-PRVS: 0744CFB5E8 X-Microsoft-Exchange-Diagnostics: 1;BL0PR07MB4067;23:bGrJU1VbmY/VJudVGwkmPV9GJ2Y1P02ImgFJYl8g/kOMbQkbsX7MWP2LDVY7B1Tol17AcJ4kzFpapB/GC1C3DKmXSkEoKu6rGAUf06rO+mpQ34dnbq2L6xkFxfm5khTuhB9WtaYzycb5Lk2NO+qehGtsQIiAtkd4XYMffnHh68MCH9ALTQkNC6YSPfe++W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iagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BL0PR07MB4067;7:2M7qbtNAweCj3tMg95cpkynBBk4px2LTCteKL7E+bs/JLUmllT7JL+ELXwyQbAAUfDSyXd/CFK+GKdesKK2jwvjIBsstcP7IrGp880fT6vUoEwhsNLmftSjxVh8ILzmwilGfnDdRTxH0buB5ccAFwtkpKSBMp9lkN5wE7ZpU3ZCbg2RG8uAjNmh34HXpPfuglqpEg8rdnBuO2ryGTc/Uw9KZ2x4i+QLyWttXadVk8Z35aXjIfziRrIgsRG8i2UeR X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 17:01:29.6582 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 626b5731-046c-4b9f-37c6-08d5f2504446 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: BL0PR07MB4067 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 c8731568f9c4..4888b999e82f 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 067706c9e56f..ba9dab81580d 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -7018,7 +7018,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 735f122607f3..1d5f73b4c196 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 Jul 25 17:01:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10544475 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 1738B14E2 for ; Wed, 25 Jul 2018 17:01:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 032F92A1A0 for ; Wed, 25 Jul 2018 17:01:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBEA22A807; Wed, 25 Jul 2018 17:01:50 +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 CE6F82A1A0 for ; Wed, 25 Jul 2018 17:01:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729150AbeGYSOV (ORCPT ); Wed, 25 Jul 2018 14:14:21 -0400 Received: from mail-sn1nam02on0049.outbound.protection.outlook.com ([104.47.36.49]:13952 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729106AbeGYSOV (ORCPT ); Wed, 25 Jul 2018 14:14:21 -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=XYb96WyOtJ2biupibHYsqI4diKj5IOcV4i4NwK1L6Ys3/a4oYcKwOg1M3DOQZXtPKZnDWYn5uHsG4iLldwJdDWTlH2l8uUUY98m5757aHDj/9y9PvCa956TB1hjgjhhFhvJDYT/u+D3b5XXAQj/VDeNpev3fhkcsEQg7o9X8rMs= Received: from DM5PR07CA0028.namprd07.prod.outlook.com (2603:10b6:3:16::14) by CY1PR07MB1462.namprd07.prod.outlook.com (2a01:111:e400:50eb::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Wed, 25 Jul 2018 17:01:31 +0000 Received: from DM3NAM05FT022.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::208) by DM5PR07CA0028.outlook.office365.com (2603:10b6:3:16::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.973.16 via Frontend Transport; Wed, 25 Jul 2018 17:01:30 +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 DM3NAM05FT022.mail.protection.outlook.com (10.152.98.132) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256) id 15.20.1017.0 via Frontend Transport; Wed, 25 Jul 2018 17:01:30 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Wed, 25 Jul 2018 10:01:21 -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 w6PH1LPH010328; Wed, 25 Jul 2018 10:01:21 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w6PH1LGE010327; Wed, 25 Jul 2018 10:01:21 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 06/16] qla2xxx: Silent erroneous message Date: Wed, 25 Jul 2018 10:01:10 -0700 Message-ID: <20180725170120.10269-7-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180725170120.10269-1-himanshu.madhani@cavium.com> References: <20180725170120.10269-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)(50226002)(72206003)(6666003)(106002)(106466001)(54906003)(81156014)(36756003)(42186006)(16586007)(316002)(110136005)(4326008)(486006)(1076002)(44832011)(87636003)(5660300001)(476003)(126002)(2616005)(14444005)(478600001)(446003)(11346002)(186003)(356003)(80596001)(69596002)(50466002)(51416003)(86362001)(8676002)(15650500001)(8936002)(26005)(81166006)(336012)(47776003)(2906002)(48376002)(305945005)(76176011);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB1462;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;DM3NAM05FT022;1:cXqgEE+siklVSSr3BpQOZForyVia6mtztVpx5Cu+qX3g+ECwtA1iroV1ZH4i0WIFY7cORyqTsM9yC4PPQtofHy9DTIZ3TeVliYNv13RquTs3LWHhOkjjdy24RBx74WXc X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5be8fab8-03ab-4c6a-d882-08d5f25044bc X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:CY1PR07MB1462; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB1462;3:YmtivUfnUpCsj7evA52AMgdILLeCyv2/S1EKAqxa3biGr8jzr6G8C2XifXJ8AHSDqDdP1K1nebpzCe8PMHzioKWgD32xGMwAf0gJH4FbKqsUrZWeVt9ism+aA+YMEyVHsXqv6b2edK5GSFRKqrCAIEJRm1ngcwWVXyDdNfQlbrwSnic/mBwFVw6nkvKjJ+8o4aO158L+R5yBtnMceFYDUh6aogNojU2ujT0j7ZjqQrzsUvW+k/BO6yw2+3FOcHlwX7ZfNicBQEYYVlxYiLWcBge5PTWl1pz2PANNtMminHmnOK25jkEtWa8e949a/lyc4ywGml1YN8ExxnRfo6BQyWhLorkUy9iqOpZTiVmDWvw=;25:V6u7xhe3wM1AsT0a8ZvIzXIigKQpDQGWU0a9lUjKX3UB+vHEOylChD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QpN0L15RrYso7wxLv4MwrbxTOkZy 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)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:CY1PR07MB1462;BCL:0;PCL:0;RULEID:;SRVR:CY1PR07MB1462; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB1462;4:KUvBwPZYYOcnG0xRMU8H8Ndv/vfcfkoF0sVw4VFjkiUTlFWcrYORMl0+aqyqQQj81upTDlzzHHEdCVB+G3f2qCZS0RgqHFR7VtxtIP1mCzuj2o6WT8kyrhc9m9cdrJE7anMavUoLth5CGbvRh+1njnk1wSDTgbp7b4CtpZp3nUeXk/CC+EM6McO98OjWnRxp5Tb9gblRo9q/lSCACktg+q1Sp165n/lFXrQweNL+c5hBg+qYTTWZ7/CZviA41zKKVzpohogdlR8wZHpaTJvZ3Q== X-Forefront-PRVS: 0744CFB5E8 X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB1462;23:HuhVQNMwAweAQ2CepYkjNOZCv5/Q3wLlcpNx5oHceU9HrDkkmvZr1n7qNG6MHLnR0XqvRZfxiFEsQBus/RtuyG4oAsePj4+v1/6zyQad+W4W+0VKLGPC9UmU+BAURu6e2b27oLJSHFCT+zkBxo5IqVJ4R28b+AbYqCXrzC3+kIqGgFxbcrv4DppvfyR08vcU+CuPCgqPH1HAHqJ7tYauYnY+FUjAD4Gz8JOuETOIJWRMHfW/PSZueyxt7TqkMYtrQBUiaMZe1PqIYV/f1BzTzGAQaAkCx4axfI0Syzho9DFbla6V8S4g8a3ex3AtnKs2rEeIQlzHyl2H+If/oIbcyggH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iagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 17:01:30.4513 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5be8fab8-03ab-4c6a-d882-08d5f25044bc 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: CY1PR07MB1462 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 Jul 25 17:01:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10544465 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 126FF14E2 for ; Wed, 25 Jul 2018 17:01:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0A8F2A1A0 for ; Wed, 25 Jul 2018 17:01:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E563C2A807; Wed, 25 Jul 2018 17:01:42 +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 712B22A847 for ; Wed, 25 Jul 2018 17:01:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729514AbeGYSON (ORCPT ); Wed, 25 Jul 2018 14:14:13 -0400 Received: from mail-eopbgr720071.outbound.protection.outlook.com ([40.107.72.71]:28000 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729470AbeGYSOM (ORCPT ); Wed, 25 Jul 2018 14:14:12 -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=7PrPr+a0Zdxjze6D2eg32BFcaT4WSxpWVLvNa+iYJgs=; b=NanibMNIBngOVZ2l0N/0XMJDvmsdT0GOvcwrv1VyrJlrMYUBBXN7hxa0MPTrSWuUJeYO/zLKSR2wm1vQTq49LFJX7eiQ+XTDm/5mowFcAdYkYbuglty0JvWF/3WGBgxSqZ6C5mS/l32Bm/PJ6LrrW4LjMQlFldESroIrxrjuwjQ= Received: from DM5PR07CA0029.namprd07.prod.outlook.com (2603:10b6:3:16::15) by BL0PR07MB4067.namprd07.prod.outlook.com (2603:10b6:207:4b::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.21; Wed, 25 Jul 2018 17:01:31 +0000 Received: from DM3NAM05FT022.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::201) by DM5PR07CA0029.outlook.office365.com (2603:10b6:3:16::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.16 via Frontend Transport; Wed, 25 Jul 2018 17:01:31 +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 DM3NAM05FT022.mail.protection.outlook.com (10.152.98.132) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256) id 15.20.1017.0 via Frontend Transport; Wed, 25 Jul 2018 17:01:31 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Wed, 25 Jul 2018 10:01:22 -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 w6PH1Lde010332; Wed, 25 Jul 2018 10:01:21 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w6PH1Lhh010331; Wed, 25 Jul 2018 10:01:21 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 07/16] qla2xxx: Fix redundant fc_rport registration Date: Wed, 25 Jul 2018 10:01:11 -0700 Message-ID: <20180725170120.10269-8-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180725170120.10269-1-himanshu.madhani@cavium.com> References: <20180725170120.10269-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)(396003)(136003)(39860400002)(2980300002)(438002)(199004)(189003)(54906003)(14444005)(106002)(110136005)(336012)(4326008)(42186006)(16586007)(316002)(50226002)(36756003)(5660300001)(47776003)(1076002)(76176011)(69596002)(51416003)(80596001)(86362001)(2906002)(2616005)(26005)(446003)(50466002)(48376002)(106466001)(72206003)(186003)(478600001)(87636003)(305945005)(8936002)(8676002)(81166006)(81156014)(356003)(6666003)(476003)(486006)(44832011)(126002)(11346002);DIR:OUT;SFP:1101;SCL:1;SRVR:BL0PR07MB4067;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;DM3NAM05FT022;1:F3RrVNt+RTeNaUdgrwPYXbZXTKsLI5TgVhTtDGmz2nBvKYDnt1OzMjhpMUXyoC25+U+ulfZUZRc4dV9ixuEy90iu3d0NG9Gx52Vb1wijWKf4iAzftBQ5JYY3Bqik1HZb X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 653adfe1-5cd7-4cf7-0da9-08d5f2504553 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:BL0PR07MB4067; X-Microsoft-Exchange-Diagnostics: 1;BL0PR07MB4067;3:TldpbWXIzfCIrQIzPI+4S7cspk02W4WRn9EFjPfnbp+BssrlYsiQEe59IOK8ZVU9srQ1rmkBwu2+R4TtBwDflg1A3SteMJn8hQYyGBu5yZzbAZ4MU7atPNq6Oqh2rKT21gFb94JiWtEQfBt6PrFUNXpXwj0Aef0JL/iFTde/BhcyQPCPVQxqmXGZvDwx7SBlfdBq4wh1VL9WVZlwsnKK1qX+wtt2TUQrI3TZQ/z78dxJdwbv8XLW5b2wB6886FUprpitATA2hmVZYQJj6QFr3wz//OTz6p6MNgG/M4mXkXC8TbH89lKO2HAy7xZEJrmclEWLFdm1oWFvXjxba7mPJLRZsoNHLFr+5zhVxrnng5o=;25:roFLZJ89/gmVULhU28v0pFlRltEEkGnRtfxukWRY7EHplVk4ZLfw06q1ww785oQZ5YTf97kPjQ5mSz6z3QgzClR84rLytw7FZFcC/6ftO20Fs+zXgtu8r/x+ci/mPHMkWAE121+/G3NYxFACg8sUYAbZyVkrxdENADhzKH3odVJ8VDrF6a/kq/x7OWxR3p7sw8bY33Xp7dcmfYfEwwPtrAEkRf0XgLJ1p5UBWKE8+tKHsuuSEr9xfGl+uSdCMe4Wo+x/8iXZWs3kPNvUVPeBtpP/R98IGZ4ZcvZjeVUDzAmOvMM14cBIKtN2zJrICMWW+JVK0ie/N2TrscB3W04sfQ== X-MS-TrafficTypeDiagnostic: BL0PR07MB4067: X-Microsoft-Exchange-Diagnostics: 1;BL0PR07MB4067;31:N4769TA8lhYAJDWSg8OEsUhjyDK52lHHPtO+tjbq3mXSsBZvTOcxmQw7o24DpNQfvuApsUza9oVK0PTVsguRc5WyilO/SAE0ku9t/XjWIVR1sY7wz6Fb+rXlSxMMZI2Wk92kq4VW3mqD3LPsCYuOle8j2kP5wgal77kfL7bamP3mJhdJ/vdJ5FvAd6+q+qMKNKoz3EcQg1OnfILUB9yfg5MaaJRNHzBQA/10AjPeYtw=;20:UHG1TQXV4buf/nB1auL4Jn1YGAdu+u9fNVhuc+QmGn9FQE906hfsuwQ22HEE+Cdq2KxT+qnRgbciPglgb5uU8UtteyGgCGBAsqnq1EKJPFm91Ya18gTFhlMsoyyrNIwn+0ZsvX0PhTUx1Ntpp9nLsE1KYeygsJGA5rA+02hyp3Fh2L/P95JbYqtSZtY1/vZjeX3ASMZV3wZwI9NkiX4ZQrK7VI93GoRbUnRsypFEZVhljyANrJRiC7saYd2ztVz1vDIEK6mXCf2n1hE8kR0za44J02uVMf1TOLDMKFmFi5T1qw0y2noFJuyEw4WDymIolUV76w5jU2hjfXngxKmAyKMXEFujS71rUx8ru5iMw6T+nUN7UakSTqwDKoLzX+xy7+xvnLEFivyOWQd+41O4PZsUYR71W3dYxOGhTPy1AmkSt6pZWbGECdvQ7k04Eqs1LYZ/Ke8615P9jTRgsMHGQiTB1dqiHOm/LxuUjo+Lz0pWTopKxybuZT1ab8Tkkx3n 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)(3231311)(944501410)(52105095)(93006095)(93004095)(3002001)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:BL0PR07MB4067;BCL:0;PCL:0;RULEID:;SRVR:BL0PR07MB4067; X-Microsoft-Exchange-Diagnostics: 1;BL0PR07MB4067;4:9xFtlu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edxH71u7u1BopwIylp6eJw20oZh5CjWjCxWDEj/QN1QZYF6tx3Mco4/zRgcqBiMulaS5JqNSlwOgx+G4aScEdxYYkLtaFgRVvki0mc4/pbvCz94zfghCNUwviNr35BN8j87CCF84OtgUipdjX/Piq6BfFNd9wvPDlZkwz6Lf9ftB2cmR16YuQpviLaY/qyKEqz3JMq/i8PJpq2ayTNF24d6qkifKMPRTqpTBHOdBEa7b0q/Omw==;5:ib5lW3AWk4MmNrPwwKhalhonvl+X5gxmevhxe9nxO5ml2uR/mqtdPWGHMBNkuFMcIPBi+R3KKMmnwEYx44uFMTLWQYAaHGGPaRFHia/7mvrw2kxEHhpxObG9SeswKb1s/MLyRTQayhd5Qys0cJQPHtMmKI5oscEQttgU43G4nGk=;24:dMJPmmLQhUPng/r7zIZmh3TN/bCtFGRs6BvxrfVVpqaz72062rX7X4YahAyJBCfd0ipqzf/xpvVgosvFj4/12csTVkku7dWI0hd/peIkQRA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BL0PR07MB4067;7:YioqWQHtUJab43LiVFNWtD/UnBdVHBiWIqmxGw7Q74TU5XyW0rmz3j58w9bRF043Vf/9f16n8w4ZrQYxvVsp6Aoga8vy4upQycFz2bb+dBMU81Sc8IsMiFRNAcegzbwjS6SU9G6Nmk7pA6aKt5naXS3iIm+ugZeU+LiSQm2zAXAe47jlcD5yDszNRIgeiH/Uf/LIOSHi8VhA41ZMzd8ypXF9aGzgF3iRTQy5nbhRmlDghJ6aI6nV646ShSub7BzS X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 17:01:31.4200 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 653adfe1-5cd7-4cf7-0da9-08d5f2504553 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: BL0PR07MB4067 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 | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index ba9dab81580d..4e4d491937bc 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -5058,19 +5058,11 @@ 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); @@ -5117,6 +5109,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 Jul 25 17:01:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10544457 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 B0A4014E2 for ; Wed, 25 Jul 2018 17:01:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D4D62A84F for ; Wed, 25 Jul 2018 17:01:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 988FD2A877; Wed, 25 Jul 2018 17:01:40 +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 7E5342A854 for ; Wed, 25 Jul 2018 17:01:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729507AbeGYSOK (ORCPT ); Wed, 25 Jul 2018 14:14:10 -0400 Received: from mail-co1nam03on0073.outbound.protection.outlook.com ([104.47.40.73]:56252 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729456AbeGYSOI (ORCPT ); Wed, 25 Jul 2018 14:14:08 -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=OSv7pfF5VzJa0zyRtGH6SJ84LqBK+JLiXS9F4EyMPcw=; b=be4cO+MPKbfWQcLhEVn/CZmj+8XoxmfGp3Hds0iMoZ4KnEqdFFTS9GIh6JXEQ7tBY2R+hc3ufklWfXab6vsfR6osIJKUX2Og0MSdD0yINajyojCDMPHL6bS+XOF564BYw/8CNg6JwuksirdemcFHtUnb0rlO2d2HFi2UhPVvQy0= Received: from DM5PR07CA0034.namprd07.prod.outlook.com (2603:10b6:3:16::20) by CY1PR07MB1461.namprd07.prod.outlook.com (2a01:111:e400:50eb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Wed, 25 Jul 2018 17:01:33 +0000 Received: from DM3NAM05FT022.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::205) by DM5PR07CA0034.outlook.office365.com (2603:10b6:3:16::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.16 via Frontend Transport; Wed, 25 Jul 2018 17:01:32 +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 DM3NAM05FT022.mail.protection.outlook.com (10.152.98.132) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256) id 15.20.1017.0 via Frontend Transport; Wed, 25 Jul 2018 17:01:32 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Wed, 25 Jul 2018 10:01:22 -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 w6PH1MwC010336; Wed, 25 Jul 2018 10:01:22 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w6PH1LDC010335; Wed, 25 Jul 2018 10:01:21 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 08/16] qla2xxx: Fix session state stuck in Get Port DB Date: Wed, 25 Jul 2018 10:01:12 -0700 Message-ID: <20180725170120.10269-9-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180725170120.10269-1-himanshu.madhani@cavium.com> References: <20180725170120.10269-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(346002)(396003)(136003)(376002)(2980300002)(438002)(189003)(199004)(16586007)(336012)(80596001)(2906002)(86362001)(14444005)(8936002)(110136005)(72206003)(54906003)(316002)(478600001)(44832011)(69596002)(486006)(356003)(42186006)(50466002)(87636003)(106466001)(126002)(4326008)(11346002)(1076002)(106002)(5660300001)(476003)(50226002)(8676002)(81156014)(51416003)(26005)(186003)(36756003)(6666003)(48376002)(76176011)(47776003)(305945005)(446003)(81166006)(2616005);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB1461;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;DM3NAM05FT022;1:o+uyfgDYE4M4ivoTwsBBU+ll+6T3ZFR/fk+wTGOzLwIsIEy57T5XMIOzHtBVsBAtFAX/QxaQDjHj115KICnr/KHEu+hw+qGoc4MzJivd4SLx1/YX6BycA9YVRS/KUXfe X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 07d25247-cd4e-4bc2-90f5-08d5f25045f7 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:CY1PR07MB1461; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB1461;3:XgX2J+Ngj7Ei9cTxczTEu555XoxoBwP0BL03YJvsFJS/d3QA3YjLilcpCyD1KDaLzPUS3rNYONJ93pR5fPbio5ZzcHyTDzZaZ/h9QBJP9pSkuKSYa/5aroJQ+HOJ/I2/cdeaJMjZquExWI06+4kbRz4RzHqDdpJf8AAsHirYSzlVWe3Xj0WkseJfnlEJ1UoYQzSnbDv151CExTn7dHm+3VyJDs2cUNd5feqXoH0NeSrTb2Cv7pihlsHNWv6W+bRzKNekso9DHtJ8m3oOnIOxyuPEXgYPzQIJ4r1CJFugwvjSx8sj5wm62Mi91ddLfDeAUdW2u0XDPVwIh4LIUxL/j4Y3SQ5SzdIbluLC85v47xU=;25:afF76sfaZt8DvNKfd6H/J/wjaOXT4W0P02svwddLIRIMqzy5sFGdsVTbi92rmcNaDUFWD8D+jTEDjaYO2leXmL39a2vtT/qzelObTIhZrhUdy4F/Q4mlvPMDdBd89xO7VSe1N7i8/ccm45sO9uIQKhoggHIXobg0VjxbimxSzbpqtLqnvBQI9qrSeugs+qPHd1fmuU0d9SEGZPzVUbiR6gjnzStTFQiFJeFaj1mqEZ7E5iiW01qzsYwtV9/1umXiOigM5MVF/zW22o6550M/0p+fYCeggMr/UsowTxRGF2mnXWZSt3Oe2S5MPVEWq1MYA3GdQXm18ask3ElN7DgD6w== X-MS-TrafficTypeDiagnostic: CY1PR07MB1461: X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB1461;31:o/QCp9HJjN6ijuH5B4AEjgoEHa/2sQWIsG7HskU143Y8o6tOEky57XtW3+VemRSQ/LWcMOLRWkV8sdOK5RYJLCSI0oLy1jNDMhXXH3faQJvTDll9X6O7a810dxv9L3GH0gHePwOGfa9PKrT1DdgcCWUZ0YeJsIJC12Mhy1XPNyNdXdKITWLZQKso5PV8zC8c0Emgv32w/5acEZtrwRhEvj4qcJ2xwyJ00qsRdVAeGpQ=;20:R1tdfB5WLqfRDijZlr5gCNrfJpplnVd+Fk5hx3gCcyiZ+LrZTqtqgIAS1H7pgow0LuQeh8zSFXAvRW4FMdR6BR6FiXTvA0n+8P/0KzRun9BVSbRBcQysd4DKBjbjNF7NtTaFBoAes1yO8sVm36Gvg3Kb14ccKHFU24QPXEM1pDXvisHXmHzgqBUrgHH9qcsqbBC/etD9+ggK0azGtWEcI+CmlNYnOksRAUOFhWYXrhOoxwFylM25Bfc4Fx5HQs6I6jaQpX8fZG2qnGiUGD8y1zpfU8fNEVz1PzI7rWUefDUrcnGiK2WzEVt5Kp1/QXsRgwfeMpXmSkLrIOCW7qR17D3ii2cYwBjpTVPKKx+lJVK2Zy1n6a1F79FdUsa/uRkiqV3TXegrD7SiOkDNO6flIDYQPQ/d5WHm/5utpO5B6wwkeggXpKSWM19Z8brhTfe/bE+o6OMduJt40ZL3o7PDmWxIEE8NL7YZMosXb+zqqdoSALjJu02GcVOvaC0pObrV 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)(3002001)(10201501046)(93006095)(93004095)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:CY1PR07MB1461;BCL:0;PCL:0;RULEID:;SRVR:CY1PR07MB1461; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB1461;4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xMjE9uiSGykiKbelPrAYVDJNiT5OhGqF13QAHT2ruGqcgjbY8mvSlXcvbjVur+J97R3CWOo9XiiyZVYc3E6yoYIZHwJLpxvX3axv1Kut2CV013+f2oSOYBEejUJZyssQgxQ0421zSI59JyWsalVOso1ruiFK+A/anfqhevnlTaktwrStaokhpL2Vf8NMqtfE2h4Xk/3D1BVkanTucOsSuMBIukcpaunmEe/A==;5:yXM4ZNAZTYgK/VYcNRpyTMyc4VHo0yAVhRRnxUTF2hZ8dLx5S9pGb9A/+js0h/2qfBFLb5NjQCuaT7ROv9vST4nkNmlmxNc+ykuEeWYcMBQMbTi3cSSpV1Vss2tZ9471KD9Jba8dbvcl+kOLQLjckTJpPu8lB1AIATRYD62tUcc=;7:m7L37sec1+wBw3k0VzQftLGIWpzkY2WVMZhsFv1dCG4lG+bSQPpEiZaCslXjygjGeozS/yeMWF6FEdL3F2Nm608BqZhEe9WeK5uRpq/4FwnAkPEUhlBRcWhgUVjiFhMLJZQl47TM4y5MzDcc4Q1ib9cteY07RPKPoPZxKUuKOm3IH8FAaCx3NmJ1qJnKMbeUIJj9HystFDh9ccUNvesCdNaAH4GbTsw9V0LlVc1VZOm5RXn48JTlpIo75Qithl2A SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 17:01:32.3732 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 07d25247-cd4e-4bc2-90f5-08d5f25045f7 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: CY1PR07MB1461 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 4e4d491937bc..dff4dc588947 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1155,9 +1155,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 Jul 25 17:01:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10544455 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 8AB1D14E2 for ; Wed, 25 Jul 2018 17:01:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 770FE2A1A8 for ; Wed, 25 Jul 2018 17:01:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BEDD2A841; Wed, 25 Jul 2018 17:01:39 +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 D0E642A1A8 for ; Wed, 25 Jul 2018 17:01:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729509AbeGYSOK (ORCPT ); Wed, 25 Jul 2018 14:14:10 -0400 Received: from mail-eopbgr690045.outbound.protection.outlook.com ([40.107.69.45]:18400 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729450AbeGYSOI (ORCPT ); Wed, 25 Jul 2018 14:14:08 -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=XZFoBFzrSmeoL5AALXHvVzlCji/Ni521s8wVLRJc0VE=; b=G9h+WTbdOIVxQyLp5KAnrKvX3uXyOFGuS7yw89hCA4C8WfnK0OGNwxDrzg2JiPSguCVp07+/bhwSUzdsYAP+AoiC3+NYQv6OZjr1gj7Sp6U1SXXgflqBudfcGrcEXCkeeuAktVwJGK9VHT/N/LmMlHZrqT45USmhiPa0pNgj9pk= Received: from DM5PR07CA0029.namprd07.prod.outlook.com (2603:10b6:3:16::15) by SN1PR07MB1472.namprd07.prod.outlook.com (2a01:111:e400:5838::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Wed, 25 Jul 2018 17:01:34 +0000 Received: from DM3NAM05FT022.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::201) by DM5PR07CA0029.outlook.office365.com (2603:10b6:3:16::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.16 via Frontend Transport; Wed, 25 Jul 2018 17:01:33 +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 DM3NAM05FT022.mail.protection.outlook.com (10.152.98.132) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256) id 15.20.1017.0 via Frontend Transport; Wed, 25 Jul 2018 17:01:33 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Wed, 25 Jul 2018 10:01:22 -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 w6PH1MEI010340; Wed, 25 Jul 2018 10:01:22 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w6PH1M7E010339; Wed, 25 Jul 2018 10:01:22 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 09/16] qla2xxx: Fix unintended Logout Date: Wed, 25 Jul 2018 10:01:13 -0700 Message-ID: <20180725170120.10269-10-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180725170120.10269-1-himanshu.madhani@cavium.com> References: <20180725170120.10269-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)(376002)(39860400002)(346002)(2980300002)(438002)(189003)(199004)(54906003)(356003)(336012)(476003)(8676002)(76176011)(186003)(11346002)(126002)(2616005)(1076002)(446003)(5660300001)(106466001)(8936002)(26005)(81156014)(486006)(51416003)(81166006)(44832011)(106002)(6666003)(50226002)(47776003)(2906002)(87636003)(14444005)(48376002)(478600001)(50466002)(80596001)(4326008)(110136005)(42186006)(86362001)(316002)(36756003)(16586007)(69596002)(72206003)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR07MB1472;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;DM3NAM05FT022;1:VQy76nWKjXOX5oWKTS8cTBeX8akL9KFosBx8SuJccAeHumhu8OLDsXxralwzm4OAApKQnfCctImw9lchMSu4aThGlzmfHoOuaJ3YKZ88eLEizfpV9qNW6kj8QLGsx2ER X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5ff7cddb-5e96-4bdc-7827-08d5f250467f X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600073)(711020)(4608076)(2017052603328)(7153060);SRVR:SN1PR07MB1472; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1472;3:M0x0wHo5eg1EvPT0lV1WjMNpHbgAqoDOP0BpLu2ecb+bxcYtr3xtlaktKLIIiePDdxvfZqXMGEjcg4mwO8nKYx0XoOA7xhcNIXuhyPOyUAauXPNGLoZsHo07gojz8zP+s0GfW8EVByk9Q70UO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TAeV9rkdEeHTxGi1Cg/p9igGeTN26o0codsGG3+HhIlOraddg1GYqMg5I/nq+EyBjegDQ9JZ3+wCnA2KvTylZLx1ZS0d+k9npFeEMagHvtfYqjzf81QslBtXKcMrMJLnlXUXF8XiJGgN17ptUW9wG0hto4tGJx19T1V/FiDYi7xIlaXPogSf1Klu/Cam9Akqf02rXG0OJzTyPMo0ogUeeeQU/yvHFrBcLlFJ7sKfUXjAx15d+7dvGGodJOl4PsY17Muqa2/G8gXT62BzT1b2aQCh677F4ghtDz7VyQ83rxahqaeBba1DPeZQ 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)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:SN1PR07MB1472;BCL:0;PCL:0;RULEID:;SRVR:SN1PR07MB1472; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1472;4:zwrmfDIPewOHUk7GjAGeNrEWkiz+Ytdm0lS8QCMmw7cagReCVm0t9cvZgT7uqJV/sal1kt/tusXrPsB6GNPOBmbB0QY/koh72G1F1t4rxBQ5oBwXOrz1SQepTJ/9nc6apmDZ/mcT6BNbDBg84ixOLFldJtHSEHduN5EHAPWL7vU6LEW5u2JWVoQ+hoaDId42Cz8nM/vw87JWbjsoDW52tS7LnhU85DOa4wK0XCsUw5kccX4FM/+ftLUdagGvvCtoCUzO6eFnIvDJnVyc/iZxaA== X-Forefront-PRVS: 0744CFB5E8 X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1472;23:s+mdjlWO3Sux6KCeTScQafGfZ+VX6ZuQjqL4HbXIn3dxMXcSrJV98cXVwhWFVWUk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;7:xTqXix8qhHthFkW8WoEdf4nUWE8O/bp4Z7PohsU1DM8rOiYlNwcR4NK3FkG9zQIOEupNcvkjTN+qezx0J1fr5VYLveNck5LfnkqekDuRnjC2Hps3ETaHFHVFcD1RHqb7L2dEwQdIINjeYV2rlml/NekXMd7XtwaHLYkCiSKdNyO23Vkqohq9VurrPv5s/AMgzVBwWOMEc+OgX0i4NuikdoxY153bgYxltUhbkPAhEe50ZvIi4Nb/iY09dLJ4mp8u SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 17:01:33.3888 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5ff7cddb-5e96-4bdc-7827-08d5f250467f 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: SN1PR07MB1472 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 70c98316b793..8c811b251d42 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 Jul 25 17:01:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10544461 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 83458112E for ; Wed, 25 Jul 2018 17:01:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F9422A1A0 for ; Wed, 25 Jul 2018 17:01:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DF262A869; Wed, 25 Jul 2018 17:01:42 +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 998BD2A803 for ; Wed, 25 Jul 2018 17:01:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729524AbeGYSON (ORCPT ); Wed, 25 Jul 2018 14:14:13 -0400 Received: from mail-sn1nam02on0088.outbound.protection.outlook.com ([104.47.36.88]:21075 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729494AbeGYSOM (ORCPT ); Wed, 25 Jul 2018 14:14:12 -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=6uYVugJimp1daRCXvkmARiyzhavNyZNFNC7tM/MRJts=; b=kDhyKqSa9qspSocgEMsFiW+tEJukk6UBxJFme0bR/RvZ7yx2VvSGnUOUsSa5bMQ/h3S1Ft8+mjK5Fde8BrNCfermzCme1Dec/YIf5iCYVWT2EefA1mDBplIsr2W2W+ZlJRrjiO84iOWvMsCjpyMk6m9wJIwOtMGyQV7FLk0JCgE= Received: from DM5PR07CA0030.namprd07.prod.outlook.com (2603:10b6:3:16::16) by BY2PR07MB1459.namprd07.prod.outlook.com (2a01:111:e400:515f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.20; Wed, 25 Jul 2018 17:01:35 +0000 Received: from DM3NAM05FT022.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::205) by DM5PR07CA0030.outlook.office365.com (2603:10b6:3:16::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.973.16 via Frontend Transport; Wed, 25 Jul 2018 17:01:34 +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 DM3NAM05FT022.mail.protection.outlook.com (10.152.98.132) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256) id 15.20.1017.0 via Frontend Transport; Wed, 25 Jul 2018 17:01:34 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Wed, 25 Jul 2018 10:01:22 -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 w6PH1MEu010344; Wed, 25 Jul 2018 10:01:22 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w6PH1MlB010343; Wed, 25 Jul 2018 10:01:22 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 10/16] qla2xxx: Flush mailbox commands on chip reset Date: Wed, 25 Jul 2018 10:01:14 -0700 Message-ID: <20180725170120.10269-11-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180725170120.10269-1-himanshu.madhani@cavium.com> References: <20180725170120.10269-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(396003)(346002)(136003)(376002)(2980300002)(438002)(189003)(199004)(446003)(2906002)(87636003)(80596001)(69596002)(1076002)(5660300001)(2616005)(106466001)(11346002)(186003)(51416003)(126002)(15650500001)(26005)(8676002)(81166006)(336012)(76176011)(44832011)(478600001)(36756003)(486006)(8936002)(356003)(305945005)(72206003)(81156014)(476003)(50226002)(106002)(54906003)(110136005)(47776003)(6666003)(86362001)(16586007)(4326008)(14444005)(48376002)(50466002)(316002)(42186006);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR07MB1459;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;DM3NAM05FT022;1:8Wjbr+uATyHos63MO42coUyICZPNgkn3pJzzYuZKd2LoFYyLRurC09luQSJVGEmRghk5Ca+5pAkj47I+5D4DMQ4FRDPPdgAKfBI9fGuYSw1aSvTTwRqXrG2I2pfb9xr5 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 10d450e2-1c25-4788-e871-08d5f2504710 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:BY2PR07MB1459; X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB1459;3:4XP+E/3y9GtOH7BRxPKAF/3kSnMfyTkOcpK51SV1xlfsjhu0vfjjE4GqnKwie3ooOuwirkPZUkW6zbfYrBil9CY2DoTF0uXv6BLVDD6B98Ch+yMfsco7HLDODcUHf6o6uIBy+Sciy1S0w6gPyE+8p0NrWwGYqxlvWsBRXslAFa33TJXZKIZjjS/BHYAkuqj6y436ze2gtfEyXEs9PUegUma+D0NmCUDk1obeTfr2bvSHUX9QRySJSEQqvdpPF+Yi3oUjK88UtngVzRS3oaK0dZt8/AEzXknoXyJ0BfBEFEAjCa1NdpY8gS4PrWDOelcLhmUMzyU22/hb4gzjWuu8sYwEs5R1ZnLhBSYxSTUKMbo=;25:/3Xf9z/YIJ/kchT6dltAt+DVEfi1yiTj8osidfif4NfFVZg5C4HUvUUO6ptjGuyZEAAJEI1zojH48pX6fEi+l3JA0N5IoYJg43Smw4P7juA7XzuNjFIUz4ZQgBP5xRWk98nlZA+naP+h2Id4kGZPOHeETywxe9188oXABbiyK5KK9ZDQjTdsSQZ34VnHiHiLyXBN9YOkjH960gga05lJCbQV8savOn1ypdiaTxbjjVxhN3HWHJZEK+kNDyVMoIUJ3ZWLPzRcbg0++cvQA+3vulQW3qNEzAhWAopzqhZsSoCvycA1OAsrjPpAMsvZHtePMMz0E28ew5evLbv6X1pqyQ== X-MS-TrafficTypeDiagnostic: BY2PR07MB1459: X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB1459;31:P/6VXXl/MKMydezfab5eEVwoo2UIPMaFSoOV9/1pFrrXkT3z3IMdMPgTohPO+0Kl86zAtvNhOgmz/e6jO8LbQQ42xYXQzPT2r5CUxlf4NQSIDWV67jGNo6vdUZZrQenBJVUqxMWXkTbQZxZz9/OiK1tfh/JZX8Jb3dsveCmMruowPWdYTshdWQ90JztIv0LN6Uy0824DMy8FOWx1D4ZaBNRzyiiVB17X/dlyt+9Qx0Q=;20:GBxhOuLjUTIILsrQFw7xNZwWmPpcVn9pIhMMRUXgqI/Wsms1Ktq3LPQY700kK6g3koV+SGyWraioxInCxibMcKlDBJ1Fkhe3BhR75mAxhsz0PQFedhTEOj+0wXCs6D4Mq5hd9c8Jzxzx/zfE91HlXHup2q1ywoVMpLiWgxRQE/zfuKW+PS1rDo40HCy9o9RB95i2COgIL7mb003YzJFZl3CFDq7XkyIjCLy1XewVs8Y5K8Wh4r4gMpvcvCLNQI0NSkrxe3CbKURou994Sv4DIh5ecYKgd19KvNUnRW2f6CnU6njBgm6Jke8L4qC7aSnQ9vSpQQ5l1D4d/SllikBTlZrTX2QILRzuq38CwRMCVBJsb8x4cnwahdBs6PLJt8k1krHOhgXQamE17BXdgW8ypxXXdnrADrEQEog67i5jGaqRP6wYQZsDQuBInqc6LfflOz3LVqZxKIN0CvrRfWBbSuMet60ie8kg7FavzGYjyRFmaPlAcG7ahGiQaxw3Jqg5 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)(10201501046)(93006095)(93004095)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:BY2PR07MB1459;BCL:0;PCL:0;RULEID:;SRVR:BY2PR07MB1459; X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB1459;4:lDRQVi9+BAXaHqBRF7rKoVjff7YHKeTusdR/HV6IhrewO691pIpZzMvM7emVh498W5hz44qqB+0CYjnBpbW/+jfcggg2Cb0bXQJWtOTQgPUZOtOLQrz1fSksEO/hnWrTKRTj5dhaNjwGtnPDRHqVCwG1/pZ1VOjwUXI+CVoJWHRt86bHMjMG9d+FqvFHgVqXEG2MlSNhK0NHKNc+y4AEzt0K676n9lmle4YcOISa5931Qc4hH/vGQoFnkPzZluf6NV5z8w0gM37p7ljnKbEmew== X-Forefront-PRVS: 0744CFB5E8 X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB1459;23:wWb59kH4596hb5bqZEcXZOR0zLiUTQnn7oKE/nNAEVd7Zpf1ChuB8/h5LTHJtb7Nyod2bi076vr0i018yDY3lZ+A493sMH8j1AZXKY56DadLWyhGRJiWUUby5Xkxlwwwr1sFoNbLZr51noF1O7sSVnJn/G/zJXGuku8CNqmyrgmzsq2dHZ4calsCYmCrGXz1UZnH4ZqqVinIgZhVfI4DErea8XTY4Mv7Z/88UvN6oCcOo0TDI7H0sUtobMVoVmgZdUhB1uS0/6e7ICKzjdHXzRXzG8YTHg1OGNzGRBNf3RnOx63r5dZtWkY56IRrVF550j/7gtSt+ZiLtpwiu3lGWWYTJFn73FwcebuRS+j5JGCHSEvxhp718Jhm64I2AFod/uZaPcSL1j76S7B8y1gA5L7FjI4aY93dOI4PRg4XIOvlAKyjVL+ghIAfpanLBmn3GdnhRCOHQGu4jgCbNAXwZlu9yD/OmLHPFtaN81YLGx3b2ist5iUAoBNSdEXZEPvODpw/CrZ/m0lI69slL07IXAxhSoZTrgHDijoULd755oOFMbkJ5rLgfz29xnUt9SI3duGTg/vZ1wtSARPVtVB5/A2JNuZzQVFIuKkKOWSWt+TTcOymkAn39mf/3tyVA6eG2eU4Gl4nbyjkfyy35lsIZ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ZhRUVi1sYD74WU0kB9K605NZC2eyaUgFzU0OkfoqRUN5q12MfzqFdTPkArRRF/TQquS1CAT+vIsN1Xz4WCeiYHhbd9/ijrFPDDlPN3KsoxPFGGE5zFZv/Won0puilQE4zmn5TyrmZ97HOO/5ynqNcSI2dcIkxMNWcrUgqK0radzyAeTGPFT77vn05jBA2uoQIiDyjavTQHClQY8FasJQ7e94ezEYmmEp+1v8ofSFvf/T+gADbTx8hEmDHO48dVjX4moU5Hsb16Og/G8hcF/LR2ej6tI3jlZJA3rJlOV8BmdORgQi61b+nKbGRbw==;5:7UKMvIfbiI0E1/MwGCFJAfMqTjdI2oRg+jaClaq+RCPqwSOfiz+Ceq3e/xlbtD+bqXN39lrYNoFzEpmRRbS6+Ip1m0to3PlaKJ8ZDKw1a8e13l1uv8TEXsv7nj6nxUQOk+G0SObaw7/Hv78pj3febdXiiPfokHvbJDxB4VQKcY8=;7:PVHnZr0iKJkRfrR1nEtZ/A1iNfCvzovvq6anLysIMBri6hqAnKWguJEn/zzFpQWQoCpBIshpGAGiEr87/isx3LAa5F7u0qAgOUQhR4bnGD2zwg2gJQAYgpnMGmKxNlGMX2CwZxni8NoridsRqVAxZZWfBG2QwtDPjnW+XUKtKolRU2q/haps00yYD/NyytZtlWNvBMxYnQd+UY0NsmOSJOF8QXUmhj+1e30ToYWp6Ud1/rZaxLhk3XBS04j9vq6+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 17:01:34.3264 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 10d450e2-1c25-4788-e871-08d5f2504710 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: BY2PR07MB1459 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 b595479d445b..ddcaa0786f37 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -3600,6 +3600,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; @@ -3845,6 +3846,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. */ @@ -4158,6 +4162,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 dff4dc588947..ff79bed54e07 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -6280,6 +6280,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. @@ -6294,13 +6295,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 4b576aabba30..70517cd09e32 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 79514d43cb32..106150f1a86e 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -2816,6 +2816,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 Jul 25 17:01:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10544463 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 BC7F79093 for ; Wed, 25 Jul 2018 17:01:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8DD72A1A0 for ; Wed, 25 Jul 2018 17:01:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D8F42A843; Wed, 25 Jul 2018 17:01:42 +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 11A362A871 for ; Wed, 25 Jul 2018 17:01:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729521AbeGYSON (ORCPT ); Wed, 25 Jul 2018 14:14:13 -0400 Received: from mail-sn1nam02on0082.outbound.protection.outlook.com ([104.47.36.82]:33233 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729496AbeGYSOM (ORCPT ); Wed, 25 Jul 2018 14:14:12 -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=1FecYZONyiH2w9zyTuuV3RUrS7CshNtwpFIZXZnrcU4=; b=eYtlxWZNpqdk54yi9c1HDUIUGv1PSvN8MVCQP4HH/93eVohpu3Ijj3/kPQ9M67FzNjKxbZtzlq80ZpUCFT5wYwNvDwH1fuwz3MIoiKcBt/xRRE+emPYh/0kN3Wpj58s3XuzFEN8puu6Nf+EtM+qZFhPCNKjtwPAfkPIxgGWq9QY= Received: from DM5PR07CA0034.namprd07.prod.outlook.com (2603:10b6:3:16::20) by SN1PR07MB4078.namprd07.prod.outlook.com (2603:10b6:802:2e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.21; Wed, 25 Jul 2018 17:01:36 +0000 Received: from DM3NAM05FT022.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::205) by DM5PR07CA0034.outlook.office365.com (2603:10b6:3:16::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.16 via Frontend Transport; Wed, 25 Jul 2018 17:01:36 +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 DM3NAM05FT022.mail.protection.outlook.com (10.152.98.132) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256) id 15.20.1017.0 via Frontend Transport; Wed, 25 Jul 2018 17:01:35 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Wed, 25 Jul 2018 10:01:22 -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 w6PH1MDK010348; Wed, 25 Jul 2018 10:01:22 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w6PH1MWE010347; Wed, 25 Jul 2018 10:01:22 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 11/16] qla2xxx: Fix Management Server NPort handle reservation logic Date: Wed, 25 Jul 2018 10:01:15 -0700 Message-ID: <20180725170120.10269-12-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180725170120.10269-1-himanshu.madhani@cavium.com> References: <20180725170120.10269-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)(39860400002)(346002)(136003)(396003)(2980300002)(438002)(189003)(199004)(36756003)(14444005)(44832011)(126002)(2616005)(476003)(486006)(11346002)(446003)(186003)(5660300001)(81156014)(305945005)(2906002)(47776003)(69596002)(81166006)(50466002)(48376002)(50226002)(336012)(106466001)(26005)(356003)(8936002)(8676002)(80596001)(51416003)(86362001)(575784001)(76176011)(106002)(4326008)(6666003)(54906003)(478600001)(87636003)(16586007)(110136005)(72206003)(1076002)(42186006)(316002);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR07MB4078;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;DM3NAM05FT022;1:N7t4mYKRTi60PX844UxTEH5Hah1sil8htxO7Wff9HDnkq+sP7vUpA++m3WVuEup/MX917R9w/FWna7mqImJ1cuNQM5lZ3mUsmBwHX3d+lNp8qcOCUQVqX55aeqDueAp6 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d38fa373-2a21-4dcd-a495-08d5f25047ee X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:SN1PR07MB4078; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB4078;3:5yS7xRWj+k9Ksjuk+zgcEcnCUlue0q4SV6Kx/4T00zDg+SQb3xllkVNfI2MXKf+zhh5JxUYSKjH6ePx1sPIiy//dEpEXYRwvntDtOfaDrbOdTUsKW0/6unR2TEHO2DgFhjYh4kRihfnJMHutGaIvg6r8cd1hmoW+AS62sspmGiOB9AF94f4gHMoAvoEJFTzoZSVvmg8v4oZBSPGPIHX24wy5qDACheyKdxfyyxdW61+FvZkztgtt0uMna+EX9YSSXd86epg/6s5sQ61oyUvK7TEFs6NhWCTPtCI1Xr4q5UGxYrHbaxYeG9awv5uOfoFyru7iuULrAruaYpCoGeJqRfJexmoOpmPUoad3jsnHYpo=;25:vQgfe1tphaXEQUQ/FyjmKZqs1lWQYVRiZBcc1bLzrr/P9mO/49UhVtbmznSimrlSjS8F+XcqZQ2OExhgp+JEPyoLldoGgd3B/GATNPacQXsqcKGIcEUWcWWspQvQtiI1YipoZfOPMs2q4iveYu63n5f8nmuMjyXl6J3f4fxbJBooKchCi0/5lZbJRh+YQj6xdSPJTuM6rzqDnq8ka7igUO5VQWuxCahlMz/qKb57cke30RGjBhgvCT23rvaZ9uCy1UJyYkJKiTED7ZjpZ9HKAGAjZWmc/1aQV8ZI8OhTxSRoj+yUloxx1tXw+pxlPXOYja/qbR/jOfKb5hsQLzN8MQ== X-MS-TrafficTypeDiagnostic: SN1PR07MB4078: X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB4078;31:LDk0Mgm5gJ+BzPE/Z74r3kUrTu1HJtI5NwCLZAZE1V9IxJ+b1bn7TuSJ498ReP60WOP4wwBJJsrV5uVO3oATClsjyasgt8lpT8A+HxYtvTFkEhMCZj1SERy6MFjEj4mP1zqEFabKGW/miQqIxQS0HEGH4izMbIp8qXVqQtCGdVbaLjvAn//C8fR97l4t/VEMlRtQ2Az1P24XC6Frr1dnirdT8s2BeJ70zS8gIN97svU=;20:r+zwYR7q5/o1oHefIatU0HvQpYLFaXcV0wmm2pi37MsQdwA5j/OXFUA3DRSf9/hPYZG9ZsoQvrE4X+AAy7AEJw7D3I6cJrc1NqrOvaQn+vqYNdzZgjkxsIQRFT1yZafDwLwZY7Mg6JIi2PmQkAfoxE6KqPte+awhykzxHsaLNT4vxxP5QSTivk0xD2W4ibZwx+BojJ2E8Mr7Ch8kCW6L9eKvptNH3fIWbo8HRM4gOJ5i+v6tESEtpqoKifXz3u0YoNvGNDzd46D4tuufLXQpJywxLnWaCgjPV0DAj61JVnoOHNH7OTwzjACIufSqNWaxPYaoTOoQ8rgT+VdbBbhDrCr5vLBqFxOthILsON8lZG9pcm6gEzNWXk/An9fM7144Z1u3ElTbzdDrxFgxp753jHpP5X3vbtGPJ+z6jJYbjc+IMCOTLMo6l5eUiuJhttqAoRupljlIwtR9CdLEAfeqhuQJ/Zr0nY5xLaO4D//HDB63wKmRNZOhlxzQm9son/5l 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)(10201501046)(3002001)(93006095)(93004095)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:SN1PR07MB4078;BCL:0;PCL:0;RULEID:;SRVR:SN1PR07MB4078; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB4078;4:yXfgttbTXPS8kcUs50psJ0PThkB6cHbYREz2rf7HI9bPxGS1cI3yNlWHX/tQHbYzZqYCh1SUk4sKnGq/TWZV64fekx4Z8xo7nqaNrDtyADpeiRgxODg7NNdTXddwuKRhdlzKKE+UNUb9DoLAsTbYzA07hMB6Q9jQ16fA9ryn4nRlM0llzcjn0/Z6NrnCv2FqS7eeU/mEQhKzs89W8NC6wvgs3MR2V2xItVvsydFVDv4tWIrEEZcC/9knQsRBigaT1A7ZgLMFWbzoryEad4UUGw8W0SEseieGOIerv+NO4hOR6ARQV0T37WzpGNeO89vo X-Forefront-PRVS: 0744CFB5E8 X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB4078;23:taFHIKAnlgodX8wtKqhZdhrCfCBICl7doDa4khmG1Q+FOWBY2A7u9RlQSNryJyzLm/WcijsZDUtH3YfhDRgIEJOzI7SayPzPwjEcWvo5OPKw2OJI1QfPQ8ikvdvKahtHADFuj6qCT9ozleHctSsyQUU+S2QSm4WZH3Ia8c83OW3nLE+CFLjtmxuOhfdrnk7As9nQwpAu4kGYyEyB0VCog21ht4YfAT8Jpob7inxqnbMjBQTFGdIyM6AA/ryYp6IYVtylEc0pAX6Og9H0ps8HPEmEb8SHddlpl+EugMce1gQ2L0fhbrAXLXHv+LCImQBDfVQnHtLTevXWZHzbfmc3AoyJHZU4AOBrB05+pqXJX4I5RTgGJyxVU8WqFWjRVuTf240rg12kEhjBANzYYEE9GwiJFzOkIJ/nDaNE2vanlWzNk6wsXUsYeUj/liyJXcTsqwyApcYEYa7uoAjUwdsNbo3fIXUtdUfaxmnWwMivnfNio58+tkBrcxlQYnJzQ1SnIp1D3FdJiVv+1xlFo1DdmbwwqfIYOLsGiqGOzqROVke9bBIu3K1qyfAivrDOt48JHBob9FdZAcoRAGQLFBNlcozG5up/1+ZQGYBZvqTtfDAzk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tfvVQnRu3fkvOXZnat1BFxP7beB5NosfdRgJi7c1CzH9ponyqmhfKTsjOEZEaqqtnsI8a8n8mMbvO2unIFC9nvfE/ZT5JrUM26EBLjInpKFc+5qke/khNjL+31Qz91VvIwz8nsT7rqB3QplsXqOHdcjYGqgvOMa58dW51y4v+HtGK7Pe6DVJYJPAqE5BBClztxLxZJlEAtR5Tm6XMMTjyo0eZ26cj6gTXk5zc0910gTIwMAFsmwLfB6D98tiKejdg5DzohNRUSGic0bCv4h2NCu22+TlqynJ5r7TJvanmT8iDbkXCHpoKERxr/7wKbwy8RvNIDjI4NMDB3gSolhmwStxhmDAE2i3hTcsIkiLbZ5i/yg==;5:mzo+AcMjtJLfHFf1dGyzl/STd1QKiq1tVRJDNCP5m/9rIOXKK7bLXkjMsS4oDGiB5RmsYEE2EHEsSK/MDnepetPD0OoOqi0131rMqKoHiA8uo0OjwczcU5ynpzqgY8haojGzglqQDJ5anNadOu7W4+wg+rmpxKSGJxq06EvsLxE=;24:GWAdNXwE1oW9RusLOOclxuLm+5f60s788e3VTfIcwLFLMTPlWmGspX0UjPHYMiPytf9s1Yx+eES3UGhrhVZJDm6myOd0/Nz6msjhHHlkpF4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB4078;7:msWPCaMe5Te9suJNlrsgjTLkJwFKLkTkDXB7SFa21+BEWvTlC0FIE58Pw66UsPRlotH9nMw6zph0q1J5GMElKYh45Uvg/CLRle+pZZlNMQYyRvDzWEVXoaKsC2uqMOGOod5B9bVGxBoHrUOTrRdidf1uO2zLZB02MZ+1343haDjP8zgnTOPr02VyCTAgvki2e7a/EkKv664LOWKpk5a8yfBcIvVVeb9NptV/SH73W8T8kNd+fVzY+u5/aAnpv8tx X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 17:01:35.7951 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d38fa373-2a21-4dcd-a495-08d5f25047ee 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: SN1PR07MB4078 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 2660a48d918a..ad0662a71a17 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 ff79bed54e07..eea378592bc5 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -5613,6 +5613,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 aa727d07b702..d620f4bebcd0 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c @@ -492,7 +492,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 106150f1a86e..c781de0bdb66 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -3049,7 +3049,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 Jul 25 17:01:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10544459 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 912D2112E for ; Wed, 25 Jul 2018 17:01:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79CDC2A86B for ; Wed, 25 Jul 2018 17:01:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E3EA2A844; Wed, 25 Jul 2018 17:01:41 +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 B4F142A869 for ; Wed, 25 Jul 2018 17:01:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729511AbeGYSOM (ORCPT ); Wed, 25 Jul 2018 14:14:12 -0400 Received: from mail-eopbgr690077.outbound.protection.outlook.com ([40.107.69.77]:21536 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729450AbeGYSOM (ORCPT ); Wed, 25 Jul 2018 14:14:12 -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=dulVkzt+lMp9QcbEPZHph6SSLgyEbL/tU/q7O+ygp2E=; b=NS9+oeJwZLsH3HnOCAhYAGUtbUmFLzbcKzbyZfZgpnjxg0ARxQNkzrARra0lM66KCIWvwpWRGaSn8zpAht3qGox1ynlf65ki/joyr6royfXlHM6Zw5BM0MtXe/qpzUylezUb8myTu9R9nJzdl8XIybGoedizMksVmEOdyC5Gbiw= Received: from DM5PR07CA0028.namprd07.prod.outlook.com (2603:10b6:3:16::14) by SN1PR07MB1472.namprd07.prod.outlook.com (2a01:111:e400:5838::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Wed, 25 Jul 2018 17:01:37 +0000 Received: from DM3NAM05FT022.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::208) by DM5PR07CA0028.outlook.office365.com (2603:10b6:3:16::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.973.16 via Frontend Transport; Wed, 25 Jul 2018 17:01:37 +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 DM3NAM05FT022.mail.protection.outlook.com (10.152.98.132) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256) id 15.20.1017.0 via Frontend Transport; Wed, 25 Jul 2018 17:01:36 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Wed, 25 Jul 2018 10:01:23 -0700 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id w6PH1Mck010352; Wed, 25 Jul 2018 10:01:22 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w6PH1McB010351; Wed, 25 Jul 2018 10:01:22 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 12/16] qla2xxx: Fix race between switch cmd completion and timeout Date: Wed, 25 Jul 2018 10:01:16 -0700 Message-ID: <20180725170120.10269-13-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180725170120.10269-1-himanshu.madhani@cavium.com> References: <20180725170120.10269-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)(376002)(39860400002)(346002)(2980300002)(438002)(189003)(199004)(54906003)(356003)(336012)(476003)(8676002)(76176011)(186003)(11346002)(126002)(2616005)(1076002)(446003)(5660300001)(106466001)(8936002)(26005)(81156014)(486006)(51416003)(81166006)(44832011)(106002)(6666003)(50226002)(47776003)(2906002)(87636003)(14444005)(48376002)(478600001)(50466002)(80596001)(4326008)(110136005)(42186006)(86362001)(316002)(36756003)(16586007)(69596002)(72206003)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR07MB1472;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;DM3NAM05FT022;1:jiqPE979jxf6VnlLKe2YmOoWbSC+AGyqJkhEH/1DlMhaTVa01VzXMVrZawPwBZcflyjdHeiaWEFCq2TDKMzc7s8pC82JuyHiM/6K1oOy6BIAFA/HHChGALKjcubKeIK4 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ec6b95b0-59b8-4930-78be-08d5f2504863 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600073)(711020)(4608076)(2017052603328)(7153060);SRVR:SN1PR07MB1472; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1472;3:D8Au+xDti2tiIg+aBlvGfAoqRrIBNI/TssiDDMDr+yYNtza2RQkbB7NofP0Nsiyhcw0sIQUTlT9+YlDJObJFHFbxiqnQL6JJvZGFKUItgRWs4+k3nWAv4rsZKW2UBtLuuLBNi1wDFEsKSNaPNtIQrC1OhgZsLPWUImJ78KBgM/AM7HKriKTZH3Z1tmHsERuuPYffo2NNYXZEX47+vN3fr0T4Yva7suj6F09raU9jV0X4J41Q0fwWPTFmh8dXpV15xqB6fY5VBCHU/0upWEm3aR6fdJDxU6pdlMdaKfy8B6NTyMPFI9ZQlQKW0/KGBBveD+KCD9+i3/GrQPOVE9TmNqhvrLjqo44tV01jDydZVJU=;25:04f89mzvYU9fFH1/hGbn8z3PgpAbJomtTQVubjKcEATmKEUzAgsTxbX1+WPbSVwNnBKU7+R71Tn3mvSvR10WmgU1cSdrayrIu4AiTAdtk7t0QOnGJk7dm1UjjAzm7qb1WfE6WfLxEMsJkyRSPWgNeiXFg6BQmLo2iRsxi0mGyUGKPp6wG+N4eHLKvln7ZpIp1HjoJ6LLRAf/ywj6hhUSvJ6a1eSCcy0WzIRUAC8UYSX0vjkjyXk2RMX70hQZuiO1cgcn3/9ipXBH52emDi1v0z6cWgly0y5JPPZdCHAiTBGqXJEkSRoz1aRwjebwATnEZWkX6IwO7KRYsQLAhLUu1w== X-MS-TrafficTypeDiagnostic: SN1PR07MB1472: X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1472;31:DVBzQKYdULZDX1mBBNq2QBjh5RSG86BAgoXrZwLLSJenoEsxcgOmgAeDkDtTN1k263EP+SHg3mZ2rE7gf3aZLc8PN0klhyxPHHsqZ1pKHSzC8wGxjO2jCrjooBOmsQyqM8kED+2HMUrjok5liNLaCMK4tIjrvZ2PJP7uKYqlB0osob0ol033Bhq8SHyRAC4qWuPGEH8EGZ/cubNqTxsqwOwfDejdiNKc/BPjC7k+8/A=;20:HfhA+70Wiv72L16d8+sEj2u0o8Kp03y92kWaPkITU85mBNTxcNF7UTEI/TkgN0jeToV4hgcPqGfclM2bQbpSXE7cs+ylRYOim1O+npmiJIMIn/PIBlcQQvAiHjAn1EQiW/R4wtTifqV4z4URuiUHZ+nKnQ6sKoitNAsH5cizlQAQozyEnG7REvBmx+TKPv6VG2vZt1zOh1FDQRrw53OLk8i6Vfd2GPq1nJ1ktf9AoCwlLHcSQLTGzTvOPDMfpYqVFhur4gbpVjwwRzErr5rY7ZGqby2itALo5MY85owOjcxSncqHFXtZObMk2bu8mnTeoUsWNvc/72oZDyJhQWqxa6YJESKTQpnlSOPNjQdOTmgHv1o8qZedMH0YAv6YO0eqholsxEOxTFjKXDC0U6bhHHy7fLO7MyEZfhFEoGrKPO4fF5UzKTIUFNrSF4WXZ3xZCOooFWKL1hxlhJrStDzbt4ZxUEl1s0o75qGcJqeurRoDbrSMJUEANJz1Mf0hfhKV 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)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:SN1PR07MB1472;BCL:0;PCL:0;RULEID:;SRVR:SN1PR07MB1472; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1472;4:uT+DN5e03fcp/NPl971irCQb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x2OMgskWjBIc3PnfkYaE/23KL22j2zbBNgBfpRKg5YF1zyVrEGErT6iag7HgzPvwDmuNFlKx4rxhMoihCjfKntGMDj49Iv5HsdMkAmvHWYJXZMLShRwj4jQlTIZnQ+89QmSqCmQySBfGg2OeREx1fk+8Su51lQjq5CCgPgkq5FyZJ0+JMMYswHsAmTUi6tllZ2GKJZvRXxHt+g==;5:rYjlPh56HqQZwSV0pvv55qr4+g0Jlb/cnxxLyT8Dl18xe92JGN41WvKbk1WuhUbjZYT9rBlTQTAp/PJqDMvZr/yAF3QnXOt5DnKhzVlB+TfnbIVHAUsalA9UjZaPBVotSwjp0oxCkq5ESULmQupc83+QiiEHFJHwK2GEYCaX3ek=;7:ECIfhOEgd8uyeuqzUdvg4vcSm7pdT0ZN1qDt+HwiimFfe813m8wdf9m0tUBKOOoqOwcK3MWdEfP/SwfV3BwlxQXNrrkoZmILxd/IbmX/mS8hVmhgY+vqEDWfryaxJs4LX2OcDbxJ1vWWZ9/rRPhZYOIX6ROCO+tulbOUJ9V4HJUH30wlZNGSvD+MYjAv2xyZEzgWw4xtC76uOZPpuPjT2rn6aWpG2C02hkrFsuhj1qnTn2QRtDO5u5bg0+G/L/zX SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 17:01:36.5608 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ec6b95b0-59b8-4930-78be-08d5f2504863 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: SN1PR07MB1472 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 ddcaa0786f37..c93e318e8d86 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 ad0662a71a17..b164b80de232 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); void qla2x00_wait_for_sess_deletion(scsi_qla_host_t *); diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index eea378592bc5..6d12da271a39 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; } } @@ -1595,7 +1625,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 @@ -1604,12 +1634,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; @@ -1624,6 +1658,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); @@ -1647,10 +1683,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); @@ -1686,7 +1723,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 Jul 25 17:01:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10544467 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 C63FE14E2 for ; Wed, 25 Jul 2018 17:01:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2F8B2A1A0 for ; Wed, 25 Jul 2018 17:01:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6E202A803; Wed, 25 Jul 2018 17:01:43 +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 3F8B22A1A0 for ; Wed, 25 Jul 2018 17:01:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729072AbeGYSOO (ORCPT ); Wed, 25 Jul 2018 14:14:14 -0400 Received: from mail-sn1nam02on0088.outbound.protection.outlook.com ([104.47.36.88]:21075 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729450AbeGYSON (ORCPT ); Wed, 25 Jul 2018 14:14:13 -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=ZflfTUWaZfZ+0OwU1p0iOP7eAlKGnYwVZ1cC9f630q8=; b=A//xcBC8sYb2vp5v8CUbVegXwKzLo831AxRdPJt2Lkat1HIPS5egvsETl0E0cXu15ZmxDOKr5CoWpAwG6wVzhfYeowASVORFeVGcSY/CDficT0l4MFyRwpJyHAllMobikr7mnkQx4ZEeO2qXV1IvjUE4Vsob0o66THHwa7Iumqw= Received: from DM5PR07CA0030.namprd07.prod.outlook.com (2603:10b6:3:16::16) by BY2PR07MB1459.namprd07.prod.outlook.com (2a01:111:e400:515f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.20; Wed, 25 Jul 2018 17:01:38 +0000 Received: from DM3NAM05FT022.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::205) by DM5PR07CA0030.outlook.office365.com (2603:10b6:3:16::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.973.16 via Frontend Transport; Wed, 25 Jul 2018 17:01: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 DM3NAM05FT022.mail.protection.outlook.com (10.152.98.132) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256) id 15.20.1017.0 via Frontend Transport; Wed, 25 Jul 2018 17:01:37 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Wed, 25 Jul 2018 10:01:23 -0700 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id w6PH1NwG010356; Wed, 25 Jul 2018 10:01:23 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w6PH1NCC010355; Wed, 25 Jul 2018 10:01:23 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 13/16] qla2xxx: Fix stalled relogin Date: Wed, 25 Jul 2018 10:01:17 -0700 Message-ID: <20180725170120.10269-14-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180725170120.10269-1-himanshu.madhani@cavium.com> References: <20180725170120.10269-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)(39860400002)(346002)(136003)(2980300002)(438002)(189003)(199004)(54906003)(110136005)(86362001)(6666003)(16586007)(47776003)(575784001)(50226002)(106002)(50466002)(316002)(48376002)(42186006)(4326008)(14444005)(51416003)(186003)(11346002)(5660300001)(2616005)(106466001)(126002)(446003)(80596001)(87636003)(69596002)(1076002)(2906002)(305945005)(8936002)(486006)(356003)(81156014)(476003)(72206003)(36756003)(81166006)(26005)(8676002)(478600001)(336012)(44832011)(76176011);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR07MB1459;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;DM3NAM05FT022;1:UK3PmVbn9XqfpoRTOxnjs32ch1m/CHsPLREftgkG8OwGd8ZFkP89/g48gAr8Ut+XUN5fMhm8L+6cIU1vC1ZdCNCNKSf9gFZL9g00VhRCsrZ4gfGBpZ/NTuOyh02ihgbn X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5d441038-a925-49e4-fc17-08d5f2504907 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:BY2PR07MB1459; X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB1459;3:IjP/HAjkWYGvQ/jNxEVcu3HJa6SS0YpGjecrdpKB6GPG9T3bfIXFB0Zmk9o1SbZOKzN4R55tSyiyERaSzA5BAybCWyWiqqAGUV+JLLnnOqgIfUQJuwI3K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Ox8jOYrSuwO+KA//xhTWojo7hYce44WbhNluPEKi0N6jLO1DJz9fCqCASyovPecZGe3uOq7LlWbmTmJXo8LzVPH/r5ZO5xKT/LFrw3LiHOIZ3f0r5/KCW99ZQ8uXgAsKoS7+tmF1+vVnyxECWOslKx0WpRFw3mSeK1rynombp/mPh7sGP9qUYtFyoTtwKapRYIBbLCLcf1Bn5j1/sORBxak75Eg/HpOV7DI4TH7tDjh1WeGfxMwJTpkXFV3lkHB1683RvTPi36evUccHeQxJ3y6YIdvQDofqicbZut1mjl6Kkfd98v7WvTn45UEryZcS8Bup5qA5n5POcHLI0sCG 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)(10201501046)(93006095)(93004095)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:BY2PR07MB1459;BCL:0;PCL:0;RULEID:;SRVR:BY2PR07MB1459; X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB1459;4:+9di9vN5wcva9KITSRHsL0GDhGB+puPB//pkfCTmaSGUN4ay3VeN6k2ilr/LJm8L+jtnILbzLLc9TCJ2YgrJhnNdBPIaccWSufrDNdRDVKFpOSL+kiJhnKjJ8iIjT36uDMTohf6mzPBz9Xp5zxGmlMUrCKC3xMX66FPe2TgbxzAIUcKhocLRF2FUUMdItnvY+bIak7/LS/AbHQnPg0NeH0+t4TSE6JRgn3uGZst3S5vReDpiAW6vJr4L6RDcqCS/LGFv/zDVPrBHmlgafiwaQUMalgz8Sbf9DgINErmoGQ6S8Nu5/bL5tiUUcj/Lx4no X-Forefront-PRVS: 0744CFB5E8 X-Microsoft-Exchange-Diagnostics: 1;BY2PR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EOFtyd2GRk6fV6X7UzdWIBM3p21ZYtPjRmH15L8pEAZq3CTu14PxV+naQMZ4relWFzTuNBsKElO0JuVbaGYNmpNuAeEF0=;7:Hanm4JMMIxYwuc4FCk3wBmS1qB8mIfANkz1LBWbMtWXvzjjBqf2URPxzftoxZhfFnsOI84QAQEbdxe0MI3Nd2iGbFZipS0s6aWXAoyYDGbJ5XjXXmlh7EtE+/z41GXXF/MsQl3gGcLy6ip+y9hhxOpiAQDarpwryDcO4vouDYbO2QX983tWYdIXRuiRYtsI07iOOGtj81SG0ZUZQkaMUybJzKEp31znNW+NlfFaYBqYYLaC7kkzyuMwF3Ft+Zca8 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 17:01:37.6389 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5d441038-a925-49e4-fc17-08d5f2504907 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: BY2PR07MB1459 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 6d12da271a39..9b07610ae720 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 Jul 25 17:01:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10544469 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 644329093 for ; Wed, 25 Jul 2018 17:01:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D27C2A1A0 for ; Wed, 25 Jul 2018 17:01:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 413B82A803; Wed, 25 Jul 2018 17:01: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 B35852A807 for ; Wed, 25 Jul 2018 17:01:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729525AbeGYSOP (ORCPT ); Wed, 25 Jul 2018 14:14:15 -0400 Received: from mail-bn3nam01on0047.outbound.protection.outlook.com ([104.47.33.47]:33696 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729470AbeGYSOP (ORCPT ); Wed, 25 Jul 2018 14:14:15 -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=UgSny+7jAlxQ+L46Hqzt7bWIENi+UE++VYMbwA81GZs=; b=QxmklrMfZ3iHbPgFvA0w7K7kPwqtd1MHxHrwCHG5oQjLfLUaM343PY7DJYqNJmFUknMWjleB0dTkf+esdWd+TpqIQ8+ijznJm4GLusOW+8eEGgdoyl19jOol4r9SeaFsCYH/m5JB0EFJdQAwcTkkWEkpiNFNHzG45C67pG8dXMQ= Received: from DM5PR07CA0030.namprd07.prod.outlook.com (2603:10b6:3:16::16) by DM2PR0701MB1391.namprd07.prod.outlook.com (2a01:111:e400:5119::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Wed, 25 Jul 2018 17:01:39 +0000 Received: from DM3NAM05FT022.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::205) by DM5PR07CA0030.outlook.office365.com (2603:10b6:3:16::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.973.16 via Frontend Transport; Wed, 25 Jul 2018 17:01:39 +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 DM3NAM05FT022.mail.protection.outlook.com (10.152.98.132) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256) id 15.20.1017.0 via Frontend Transport; Wed, 25 Jul 2018 17:01: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; Wed, 25 Jul 2018 10:01:23 -0700 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id w6PH1NIV010360; Wed, 25 Jul 2018 10:01:23 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w6PH1N1g010359; Wed, 25 Jul 2018 10:01:23 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 14/16] qla2xxx: Save frame payload size from ICB Date: Wed, 25 Jul 2018 10:01:18 -0700 Message-ID: <20180725170120.10269-15-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180725170120.10269-1-himanshu.madhani@cavium.com> References: <20180725170120.10269-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)(346002)(376002)(136003)(39860400002)(396003)(2980300002)(438002)(199004)(189003)(186003)(2616005)(106002)(87636003)(69596002)(86362001)(54906003)(476003)(110136005)(16586007)(478600001)(126002)(1076002)(5660300001)(4326008)(26005)(72206003)(106466001)(486006)(44832011)(42186006)(316002)(2906002)(51416003)(50466002)(50226002)(6666003)(36756003)(305945005)(48376002)(8676002)(81166006)(336012)(81156014)(80596001)(47776003)(356003)(8936002)(446003)(11346002)(76176011);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR0701MB1391;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;DM3NAM05FT022;1:VE9X+8P54jA1tb4GHjecT3yewE7c2nD0wimkOfkhQXCDRicG+p+XOP60Ww4+6xtAIp5bQpk3QBnY0MAjSzh/dW9aAc3L8IlwfwUk9yh2JqqiMr8IMWHp6dl5DWKoRCet X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 31133460-2923-48f4-f5d9-08d5f25049a2 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:DM2PR0701MB1391; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1391;3:BthOYd0K4kRYf3z9Vkyv9AkIReI+WgvKIv95mjH/9DLSo1mFrQuv72HgEQcYl4/lmjS2yswvAlhiqq9oiAWM2PJceD+Jx568N5Mw+C8seVPQ1ppUvjzq0gkfUyuDZWxzMKvYuoh+aCj5DeKoipD73rGXFS0jgUI1nmYlz7VkwsNuSWHrcq5ruLMbnlUb/zMyEKIUzdjXY+x12n1fsd/GFu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n1YdxW1hsdykjcDCzsfbUJiWWuUZphrbdbR//ClMdFDXy3YHYDEmOmkWvoha5TcPbGXl4YBXaacItKzb95NN0L4Fy9SpccjoRCIKtJW7VQTbpl1t3KWEalNkVWnGY70l79Ytc5f889efudXGScthF3CaHWwLoQsNb3sltQzLJ0IVBKJWIfofpMk/z+OaUOVOmoNYYg7mOLsCxMw7Jv8ohtfZiaegXOSVxNdg5mUwSqPT6GMUqLtyzk 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)(3002001)(10201501046)(93006095)(93004095)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:DM2PR0701MB1391;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0701MB1391; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1391;4:ESPK9/aT2QuJ2DmbsFYQPNwqlL3+OGWqe3+5mx53qiScY84xV6is3QV4EKgvQHHYfWGBtBCvwR2PHKqSljf2B+L2g/7C2S5q0u5ZAssYPIdq4YFTvLkym/kQBWIOtSIb3xJDr0zpJXjKL5W1TqbW9AA6qeThHZiuNEXyF//rmWC37FTLq9JxyADg5F1glO86TCglqd1rI4V1e17UyZVH+gXc3FasXfdh1xwlG0PZl2/P/GcYb9tfcL0eG6C4zoynUjsdNQYe3ox3djG8EE/zXQ== X-Forefront-PRVS: 0744CFB5E8 X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1391;23:iYherkJgI3GsuHC1cbTDZo2ryW3GEAxv6EH+JfWGkgjE9HiCC3XQiqdQhJkJKGpdAKiim+ko7h4sNytIQdYQXdLSLPJDW7D2c0RCbniB6833NAVEwOZzRb1B3pVRChTRdt5A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w6XUminsq80qzn5henste52VyKZBLzmZtfa3kI2j6QBxuLsrqq2zvOZdIlMCtRKPZJkmFZ2iBT25b3lBGdrZfsnoYpLhLmGQJakZi8GOgRzgPl68Snl1nBtJzVd5O/BrpiHBwhwleNdNzOYpAtEnccd3J0WOSM/pzgNj+Ih SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 17:01:38.6546 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 31133460-2923-48f4-f5d9-08d5f25049a2 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: DM2PR0701MB1391 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 c93e318e8d86..0db81e17c063 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -3850,6 +3850,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 74a7f372e3a7..9784cfaf14ab 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -2142,9 +2142,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 9b07610ae720..9c61d54dd9ad 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -4419,7 +4419,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); @@ -6890,7 +6890,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. */ @@ -7946,7 +7946,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 Jul 25 17:01:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10544473 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 296B8112E for ; Wed, 25 Jul 2018 17:01:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 111ED2A1A0 for ; Wed, 25 Jul 2018 17:01:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0555D2A807; Wed, 25 Jul 2018 17:01: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 1A3C12A803 for ; Wed, 25 Jul 2018 17:01:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729527AbeGYSOR (ORCPT ); Wed, 25 Jul 2018 14:14:17 -0400 Received: from mail-sn1nam01on0079.outbound.protection.outlook.com ([104.47.32.79]:27199 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729450AbeGYSOR (ORCPT ); Wed, 25 Jul 2018 14:14:17 -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=+416yBYjmLZp5VvVoMAONKJA4ULOioA90jLk+IxgzTo=; b=B16bV3IYcAknaLFpgODvlcAHwl6yTPrR5a9AXJjB/sXIgjxL2DTK2T8PEe6WYHaVTnjBKmp003ogb6oDn5ofd/I3EWUQBTSQDbMNYSyRyowjmBLmYqu0Xl7Ae+BkaVWEY96etv7XJzxyRL92v6E1wGL5iNurknkbQTJz0Bxvqn4= Received: from SN1PR0701CA0016.namprd07.prod.outlook.com (2a01:111:e400:5173::26) by SN1PR07MB1471.namprd07.prod.outlook.com (2a01:111:e400:5838::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.16; Wed, 25 Jul 2018 17:01:40 +0000 Received: from DM3NAM05FT064.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::208) by SN1PR0701CA0016.outlook.office365.com (2a01:111:e400:5173::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.16 via Frontend Transport; Wed, 25 Jul 2018 17:01: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 DM3NAM05FT064.mail.protection.outlook.com (10.152.98.188) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1017.0 via Frontend Transport; Wed, 25 Jul 2018 17:01: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; Wed, 25 Jul 2018 10:01:23 -0700 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id w6PH1NrI010372; Wed, 25 Jul 2018 10:01:23 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w6PH1Neh010368; Wed, 25 Jul 2018 10:01:23 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 15/16] qla2xxx: Migrate NVME N2N handling into state machine Date: Wed, 25 Jul 2018 10:01:19 -0700 Message-ID: <20180725170120.10269-16-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180725170120.10269-1-himanshu.madhani@cavium.com> References: <20180725170120.10269-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)(136003)(376002)(346002)(2980300002)(438002)(199004)(189003)(44832011)(50226002)(8936002)(6666003)(106466001)(8676002)(81166006)(81156014)(305945005)(80596001)(69596002)(36756003)(575784001)(86362001)(5660300001)(356003)(14444005)(48376002)(11346002)(1076002)(76176011)(2616005)(106002)(486006)(316002)(126002)(336012)(476003)(50466002)(51416003)(72206003)(47776003)(446003)(4326008)(26005)(2906002)(42186006)(110136005)(186003)(54906003)(16586007)(53946003)(478600001)(87636003);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR07MB1471;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;DM3NAM05FT064;1:ScR8keuSTFZHTEPJd+JtRW5/KGlUWAi6l1RgKhjf2rap6dfDqgckN980Mk4C+25IZvAcdVbtDMSflOzKGO+FBaj6DOiZ9RDvyuAKPX4u/DkPcnn8bZIuEKkR0Yh8W8xp X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f8c64d3e-343f-4278-70a7-08d5f2504a88 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:SN1PR07MB1471; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1471;3:bC3TIQr+mgpFcs6jE6TFX1HhE32yGA2wk4xWmfESEsVvW+rtlHsBKRsW/tY/6H+2l0z0Sf8UALWToEplaA1a//fU/msx2fn/VB3Jzn2jDVvvS8zJooTNvNZYORG/HQqouMkdLv67mUGMHDCswB863LNC23ZXp32fdHY213Cs93/iruY5/C1x5v1ONJyVqWD5KfAolf9tIwCDHMm+z8XK+4Hn7/DaEuRyKGMWCaExB6jNLdk55KEQvLf6HdiE06gBqLANCVBKAFuVnMFf2mlWSg8RdDzE4DyyFGcw0V865Vhl50vp5hrA5aSbcbSaPaGTHks35cEZiEZl5iV26L9WDHniZ0hzvOtgk9zMSRsRkfU=;25:UE3vNmkagemnoJFhGEx5G2qEBZABWjkRdK9MgHoXfvZvGZdSvY2hoaULhEbEkj6WiP/SlYWzw7MmmE0isKLRifuXMpYsjs9KE1vv5IoMbxcKXsttMFC9Lb9SW8PVKdaeHsVAQsNYB2q8ivza/YH8MbjhNqbiQDdiRacS3fLUrbWhAn0lHJ+bHSj+KQxhhuq3C3Evd5Z5aGE3EMrnQmCwfToZNPrAsxATfQwWFcdQOtSAXOSMOisnOWwdt9wXawYqIiPX9rYI8SvdZD7Pa2VdBFhgcINQzTMWL65z1jnT1/Av8lu9pIuVxLFgSeNfZSNe4wlPrPmJj4s41M8kDKd8PQ== X-MS-TrafficTypeDiagnostic: SN1PR07MB1471: X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1471;31:ubDgY9SEgdzM4UMN0/UW/w9RBp4+NyG14shOivOzb9xu3ZILxB3uSiqY9FpirvStGF368X4h7bypHTYObM5ILOA4xWrSvkF8kLqgHF61NGynTTO1uIkPvi6LSKf+N3Xr6fA4ryoLMjX97SQ7vcVoe0KIBYSLO+baRP/DTFCYvLk0g9B2Ac1wNrdE+i0jNAbbUiiAmM4KsfYBk5c2QLkdEi8d3dEZGsC1DziC95sbtgM=;20:gNEpVefKa50QCP6UTXRsuNPKJbZTiCDWPVa65F6ysmmS7gqcnoOdqZjHJlk4RwSUH7MVOendocbGHr0EFP1THcX7DetmRwmJac3dNDG6FJNmoJl/Q12GPG56Bk3UjMGcdwc7pGJLwbou3GpyoZoL9tNP85XbswJf1R+WUddR9BYh+GGM2c1kSMYdsUg4R1mvACRe0/+qAPkgPqXre/O0oLrbTZZi4NRc/rPZKuqWPtY+9TmFHgZxmUv7pWp0iU6Zs5RqQLeIkILgnZvLrJR7BETZNcNVmPZuw8QRFjoYPmQXyi+/vD+tVMe13l6DwuzD8vkw02xmwgu6GUL5FrspQGC4fasTi+7oUjVj3WirvGBA9rJm9JoZG7ccWMFaJIS0vKTDGOkUgGhLh92A9Sc7009LORyJyK28yjVZ6zqJ+nmKfikjFioPHr74aiI9Rlr/P1gSkN0M0Gjw4aOF/tMnTMZpW6VQe+Tuzab8N6rKKCmnKkFT0k4q+usri7rNAjZO 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)(3002001)(93006095)(93004095)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:SN1PR07MB1471;BCL:0;PCL:0;RULEID:;SRVR:SN1PR07MB1471; X-Microsoft-Exchange-Diagn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fljzCEa0XBvCNwS23szl93ly1OW0y8iRkUvg8Gxj9YEd5bRajABL+Tz+AhJjWIM/WjKpqcfPVTz1J7Errj6BE1Az/cxM52bRwjhfP3+Er5TTVrICYN2ihhsHK+COOKLCNRiFySpzWzc0QvIMFMBNMJfCvDmTp/kO87PeSm3Jc2Hr6QxnqRYHUJUWZUD1Ngpl4WIm2sp4+8XZRf8WsH+TYPKqJhENCo1+OHjiTem2O1p1FDNYu+CvYVeIY9pXgRAXSYfxSaQ+o+cOHDiKRK8G2N5mf/obkS873gLhRfQ6pQ8iTcEujMLoW1I6pGEgA1toiaA==;5:DAQD94oi+PFLgTewLj33JQyfs0M83GgHhXLXatpQI7bpL+kZ5Jsc/JQIYQYN9tvLz/h7U4ZDCRAUXtp2PGeJwo08JcJr2i4QID5XqFbjC3MVNSs49ZCennc1Sk18RbdgFWSMuA2/GkBUrZUxBZsW4g47ttTIe78rIVI87mrVA18=;7:M5rY+98IYt4pAMUtZvJzjXJh6oMBIW6jhjRJS4kb/f9FMqtmuexpOPX11EVyn/xaFtGlmAQGr6WTplzXTWa7ID8LkoAcvgYBlOwxOHfO2iAy88rdf5DyNB1uM+jjPtYTkWjDoJecORy6ebUTLjJCjliLSqV09inJ4dr+h1PbUgGt4FhiQ9B4iejZjuzu1GdSupG6YzdeAWGpuC81CgoAJWJsKVjhfv1ivHDY73l9TOfocSTdDWPPRwyKiIai9HgT SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 17:01:39.9085 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f8c64d3e-343f-4278-70a7-08d5f2504a88 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: SN1PR07MB1471 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 | 11 +- 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 | 225 ++++++++++++++++++++++++++++++------- drivers/scsi/qla2xxx/qla_inline.h | 2 - drivers/scsi/qla2xxx/qla_iocb.c | 112 +++++++++++++----- drivers/scsi/qla2xxx/qla_mbx.c | 75 +++++++++---- 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, 406 insertions(+), 126 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 0db81e17c063..1b61ec9721b8 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -400,6 +400,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]; @@ -2314,6 +2316,7 @@ enum fcport_mgt_event { FCME_ADISC_DONE, FCME_GNNID_DONE, FCME_GFPNID_DONE, + FCME_ELS_PLOGI_DONE, }; enum rscn_addr_format { @@ -2410,6 +2413,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; @@ -2420,7 +2424,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 @@ -3230,6 +3235,7 @@ enum qla_work_type { QLA_EVT_GFPNID, QLA_EVT_SP_RETRY, QLA_EVT_IIDMA, + QLA_EVT_ELS_PLOGI, }; @@ -3910,6 +3916,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 b164b80de232..178974896b5c 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 9784cfaf14ab..e59af6432897 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -3392,19 +3392,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, - sp->u.iocb_cmd.u.ctarg.req_allocated_size, - 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, - sp->u.iocb_cmd.u.ctarg.rsp_allocated_size, - 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 9c61d54dd9ad..a62b707bb3d5 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,9 @@ 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 (fcport->loop_id != FC_NO_LOOP_ID && + (id.b24 != fcport->d_id.b24 || + fcport->loop_id != loop_id)) { qlt_schedule_sess_for_deletion(fcport); return; } @@ -599,11 +619,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) { @@ -633,6 +648,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) @@ -707,12 +724,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; @@ -1022,9 +1066,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; @@ -1166,8 +1210,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; @@ -1288,36 +1333,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: @@ -1431,6 +1516,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; @@ -1532,6 +1626,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; @@ -4161,7 +4258,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) + qlt_update_host_map(vha, id); spin_unlock_irqrestore(&ha->hardware_lock, flags); if (!vha->flags.init_done) @@ -4814,6 +4912,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; @@ -5103,10 +5226,20 @@ 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_set_fcport_state(fcport, FCS_ONLINE); 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); return; @@ -6989,6 +7122,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) & @@ -8073,6 +8209,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 1d5f73b4c196..4351736b2426 100644 --- a/drivers/scsi/qla2xxx/qla_inline.h +++ b/drivers/scsi/qla2xxx/qla_inline.h @@ -282,8 +282,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 70517cd09e32..0ddbd6254cb2 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,66 @@ 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; + + 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); + } + 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; @@ -4687,7 +4724,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 c781de0bdb66..42b8f0d3e580 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -4781,7 +4781,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", @@ -4809,10 +4808,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; } @@ -4854,9 +4853,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); @@ -4917,12 +4913,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); + } } } @@ -5057,6 +5063,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 7732e9336d43..971cbe1e8b43 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c @@ -1624,9 +1624,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 Jul 25 17:01: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: 10544471 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 90AE7112E for ; Wed, 25 Jul 2018 17:01:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DC302A1A0 for ; Wed, 25 Jul 2018 17:01:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71C5B2A810; Wed, 25 Jul 2018 17:01:46 +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 42B2D2A1A0 for ; Wed, 25 Jul 2018 17:01:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729526AbeGYSOR (ORCPT ); Wed, 25 Jul 2018 14:14:17 -0400 Received: from mail-eopbgr720083.outbound.protection.outlook.com ([40.107.72.83]:11344 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728771AbeGYSOR (ORCPT ); Wed, 25 Jul 2018 14:14:17 -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=QW/uyQsoMjQwfuuXmQeErJ4FOiMm5wrMTOzR1nOiPcbi3EqfkExWz+ahockPqc9Wqhsd67mAyqQ/pqfhO58cl4P4e04v7qi9Vc7c6aI588KRtVLjdKUeVWc65a/pSA+fL6+xUUPXK1ovmRvMhO8o2HdxtrYfYB+Tc8aEJCNUMLI= Received: from SN1PR0701CA0040.namprd07.prod.outlook.com (2a01:111:e400:5173::50) by BY2PR07MB1457.namprd07.prod.outlook.com (2a01:111:e400:515f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.20; Wed, 25 Jul 2018 17:01:42 +0000 Received: from DM3NAM05FT064.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::201) by SN1PR0701CA0040.outlook.office365.com (2a01:111:e400:5173::50) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.16 via Frontend Transport; Wed, 25 Jul 2018 17:01: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 DM3NAM05FT064.mail.protection.outlook.com (10.152.98.188) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1017.0 via Frontend Transport; Wed, 25 Jul 2018 17:01: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; Wed, 25 Jul 2018 10:01:24 -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 w6PH1Nn1010376; Wed, 25 Jul 2018 10:01:23 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w6PH1NLf010375; Wed, 25 Jul 2018 10:01:23 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 16/16] qla2xxx: Update driver version to 10.00.00.08-k Date: Wed, 25 Jul 2018 10:01:20 -0700 Message-ID: <20180725170120.10269-17-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180725170120.10269-1-himanshu.madhani@cavium.com> References: <20180725170120.10269-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)(396003)(39860400002)(136003)(2980300002)(438002)(189003)(199004)(72206003)(478600001)(47776003)(87636003)(356003)(305945005)(44832011)(80596001)(446003)(11346002)(69596002)(336012)(26005)(476003)(36756003)(50466002)(126002)(48376002)(2616005)(186003)(486006)(4326008)(51416003)(76176011)(106466001)(86362001)(14444005)(2906002)(50226002)(106002)(81156014)(81166006)(8676002)(1076002)(316002)(54906003)(42186006)(5660300001)(16586007)(110136005)(8936002);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR07MB1457;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;DM3NAM05FT064;1:UdWo+FmW3n1HyPCRH6Ul5r7OEgiIEXkTuQz7S78xUfKdK2DpbWvvvlMCUZv5DxOACxwGG0HPm2EKrS1SaZKIEbJyeKw3xfcKbZkZiWFZCQL/qolPNn9ZTH7owD9v3fNV X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7eb4b35a-839f-41b7-7a34-08d5f2504b93 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:BY2PR07MB1457; X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB1457;3:MkwsauAGl0WPsTxtXJyoBghGYeK1vQJvsTEphJnVa8kpO8JjnKNAywGwKmxj6pk8DZaj5GUTakafjmRQs6Wc5XwHnNms+4HPJz47IakUQGhBAAjwJaPiK+1ntk2l69O6sgZku5mLrV/Y+2oYIMTA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bI3ECpMJvPHK83zMtuXil0vVdMZf3h+GISRRjti1TiRucdI03eM78JX1rzzgqxiMEGUXtacHRzZ2YfAdxAMczShIMQ4nivZbP/2AsBJXqYbXDHb5CPkOXhkRpxZGVDvth2sXHhGkhbk50sP+flfrZGkOZG9tc+wVmwq65d8f3syJWC7WVAubbCLWe+6uZ9GunGykVCeDH/ta7AAaXwRQPFaJDs63ujEKMjWxDmc44nl4ORxdLtvOGCFE6ojKUlRGD9nGzMkOjQ/obZWGX4QJ+DJ7gt4zuaDnBz1HAzV6n+FaC5NAIXZozNBksCt 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)(3002001)(3231311)(944501410)(52105095)(10201501046)(93006095)(93004095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:BY2PR07MB1457;BCL:0;PCL:0;RULEID:;SRVR:BY2PR07MB1457; X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB1457;4:ma3MZu+skpNvCcyEa0DAT9s6dIkNAcvKi2J7H0cBkROr5eFZpOaP/NZ9upi8ihRQL1r3MkfmPL0HQ2v89UeHFu/PnoQ/ycW1Pk7iAtOYvYBWuN/koFSlE9UG0LbZ1KPCgL5jBxkUpcU5qEHlKAatTkp46wH7amMVIQvxAQlcaNUZnaa2+cA7T79e/f2DTa0k4a70HpbV4eMOa4DXL6WDMylW2XLZAx8brKLg2Gr9fuBPpKxlsxZPTiozZYiBZv3BhNpIpa1qgf5SomHqCjM31Q== X-Forefront-PRVS: 0744CFB5E8 X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB1457;23:CiPE1g7tZowRIpOa+qq4tpy42XLG3q1199fz/xMSt9CrYxqukrutmoERUD1x++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VNoWNBfkbrqYhjYKapHbYC7sTFUJG4y6hMGdLMzrIrEbTBnp4u3W0bYCsD/P8Nv5lDxfFZ2N39JFFqLTwb2Qg6HoVJxP1VQA2Imx7OFPetNgAjXttc2hDjUs3cl2OIKTkSjnBI4GuEUE2uQkMR5xKCv6Vo+/d7WpLP6Itpf6CyCWgMO7cT51jiNts4P4v/p3IG80VYSqwi605qjQS0twKbdMZei+JPJem9YjpA3jo SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 17:01:41.9086 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7eb4b35a-839f-41b7-7a34-08d5f2504b93 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: BY2PR07MB1457 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