From patchwork Thu Aug 2 20:16:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10554155 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 C4AFA157D for ; Thu, 2 Aug 2018 20:17:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B17D42C444 for ; Thu, 2 Aug 2018 20:17:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A55DF2C459; Thu, 2 Aug 2018 20:17:09 +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 779642C444 for ; Thu, 2 Aug 2018 20:17:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727355AbeHBWJt (ORCPT ); Thu, 2 Aug 2018 18:09:49 -0400 Received: from mail-sn1nam01on0084.outbound.protection.outlook.com ([104.47.32.84]:59587 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727111AbeHBWJt (ORCPT ); Thu, 2 Aug 2018 18:09:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bC4Syc/8mUt4OryPbD0RqJihQofIJ8P+hGAUD466+/g=; b=CGoMrBVdSeuMg3yGH/IfNglpFggbQ2CSab7EBcMMnZ1hfqgI1b+X/JJM/sZUVbIeMTHi239UKf9K9bJxi0CZEaKowD8wxU8QVDsRlz1nJtuDWgWaNsLq/o52VnnLvhqIVtIL8RZ+1vHcoFEGdiwuU5S31TxX2rc6Ce68pbTsBm4= Received: from DM5PR07CA0085.namprd07.prod.outlook.com (2603:10b6:4:ae::14) by MW2PR07MB4075.namprd07.prod.outlook.com (2603:10b6:907:7::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Thu, 2 Aug 2018 20:17:03 +0000 Received: from BY2NAM05FT006.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by DM5PR07CA0085.outlook.office365.com (2603:10b6:4:ae::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.14 via Frontend Transport; Thu, 2 Aug 2018 20:17:02 +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 BY2NAM05FT006.mail.protection.outlook.com (10.152.100.143) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Thu, 2 Aug 2018 20:17:02 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Thu, 2 Aug 2018 13:16:59 -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 w72KGwVA007942; Thu, 2 Aug 2018 13:16:58 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w72KGwFs007941; Thu, 2 Aug 2018 13:16:58 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 01/16] qla2xxx: Cleanup for N2N code Date: Thu, 2 Aug 2018 13:16:43 -0700 Message-ID: <20180802201658.7903-2-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180802201658.7903-1-himanshu.madhani@cavium.com> References: <20180802201658.7903-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(376002)(346002)(396003)(39860400002)(2980300002)(438002)(199004)(189003)(316002)(5660300001)(50466002)(69596002)(110136005)(54906003)(81156014)(486006)(48376002)(81166006)(305945005)(2906002)(8676002)(106002)(80596001)(76176011)(51416003)(126002)(1076002)(2616005)(186003)(44832011)(16586007)(8936002)(476003)(26005)(356003)(42186006)(446003)(336012)(11346002)(50226002)(4326008)(72206003)(36756003)(86362001)(87636003)(478600001)(47776003)(6666003)(106466001)(575784001);DIR:OUT;SFP:1101;SCL:1;SRVR:MW2PR07MB4075;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BY2NAM05FT006;1:RiwL5nRU1PooCiIU4rrKKz442SNdMyHOPdp2YE8duHH1ZCITF1MvHmzapOttD+DfH7B5p7dQLoKImyTlkqDjFxuHbBY9e+OnaJlmaQ7xHW5puwZoWIO0Gbwt5oSsKp8R X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c286d6f7-a6ab-4431-7a53-08d5f8b4e8cd X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:MW2PR07MB4075; X-Microsoft-Exchange-Diagnostics: 1;MW2PR07MB4075;3:lp5Lut4FzZ1DKoy7PkGkT4G7F3JlsYwBEy2yYGGzpfOkZjAHflxtox2ne9QMsS1TR0f7KZaQ5mLFdOrsRBiua2JqgCBWe8rIfUCNjEaqrNADkHKO8mhhe6RPH2MMPi6dW/Sz3je9u6iEA9czIdhXgXcVj0JzAZEPpFjJnz86wYmwVTrxrfXyoyoZo8M/93wUayfKpcZPJTW2/mga32xCHqx+cK/A5ae0jtGd0DzYrvv1bedWJFfN15QrUzx11BaI+OU1OT/QTm9yfl+iKXMvMNfkkAFfBwVaUqLrlO6iUS21a+20iIaezuy78fThDpKYkc2ARu0m3VgVmLirur4eRgMqUZqyGqQbrRsemt2BTyA=;25:NmR7XBpDy/r3TPmieCVjHPuFZmB5V3OaJwVPXvbkNplyadIKL6VWjEGmyLmktKOW6pwQZA/zFLHqRUIq8cMP4ykn2UTJAR4lA9MrvY2nNP4IMnhoy8LT3XAr/gvvdTtMfAGNg9Y+Ioao7O1eCPGWl/bdN5OGbA41rtlGeYhzX3MPh+f5kRUxlaq+eRpaXvTY8bIA4u9fo43PTBXIO3g/u6ovQ64pt4DJgPONJ3vSFYQNdMqRpfdAOKZ8GSO9mYWHOmqxGuap+LNQpCWY21Zu3gKMOREWW7b293CBWaTAjer/n8ly7ZQgMFLtVrcItPhigZdJh5DWh8q913XlNK4CwA== X-MS-TrafficTypeDiagnostic: MW2PR07MB4075: X-Microsoft-Exchange-Diagnostics: 1;MW2PR07MB4075;31:duyJAV5pM1ykVhXh+E9UEIyFTJDbmlrnWU+Afockz3EhoEKNBguBkBKgaZtnHWOxMrYZfxv52pgHUl17s/Tc1+PEaG63K9pd+fwQFbLjbzlgYkxCEYQPVVuCj3BdoEsseuDOXi6yLER3b1ifi38fd9rt8cYZFXmJ3J6qAgYbRemGX4Fx9mQwJLBFF920z68tQwLXCP/zVFhEjdFLZ36RaU7MBGOlM3+3M05rUYZgcqk=;20:zXnWiJZq5n0PmWCFxxoFDWeXCjjvvs48yEVQlkburqWo5al7cWfHsDyr1GHgbMZ8SrBSp+fg+PSrLrpgfNS0tvNfZt5FcM51guaopVX3oK6wHxlP7b9tHDiGjOeM2MuGjosAnNbR2cTOMmiNEKQtrdCbm71VoKjB3wJvG7Y0p1AGZkbdJZeQAjjp66Ov0IhfW1DoIlYpd2zUB8/P22OWVoyYCB7Pr6PBy0BzRAbwIwgAkMoVMg+Q0LR0YPg3oAPC5Z545RqqKMajKDAZwWJh4ohmL4xDSvWxpzWbDEe0A2gEuplxaQkf7KSjGHpN2gDe3MNs/Zv0v1TLRPxD+Qd5pPJDzkeRockmDCdtQbunE6plGsWIOIsfkhz7J3wAYRCl03Rxh4LCgN5mTMYqWGE9Gex1V7hZHU6x6lMtiLyngyRkDiM5hLqr7SkKKWGspa8bGmTCqfSTHn19/XAyIVhymOMa7qjLxCE+DS4IggN/PJ8qJwRQof4X3o2LKttK/EMr 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)(3231311)(944501410)(52105095)(93006095)(93004095)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:MW2PR07MB4075;BCL:0;PCL:0;RULEID:;SRVR:MW2PR07MB4075; X-Microsoft-Exchange-Diagnostics: 1;MW2PR07MB4075;4:ENDHJyyMBOT21lgjv+CAr4pDFKO3BbAbB1fL4tZITq9Oh3nOt/tD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T+Utj7Ev297BJlKfR2rCxywHMuJZCsxO94r+MbJQ8gF0F8uzmt8LAhOwNhy6kzOAqTjcnOZCvG6123Kdp0mqgjkkFdhs0FvFhYhk7bijru7D7HMyu3B7RLEDjrDPmBkAS3lMCnbKwlIRw19vu0Y16DGx4C4XmkRA==;5:Jqce7xvFidXGsDclc1Z1jPUGT8RUylcY1BbwDWBYpzLLkqU9MuQIjA5aYcB1Wr9qL2eQt/FESFD/xdCQW4SrGZV2t6t899NuSQTKFAlNe9ZyDvKiUNAa1vHHaHwtxPhD9vfS9LCmK/M/ItcV9luWyBYw29HwUCvDlIPLuwJhOqk=;7:1HH0+DiVJSf0md/Z60Becl17v4Ipy96l4iUX+AWpYYiWMAnZfqe0om/FzVNqFLVk3kMmlVhmIX3u7bWv+IQO7nGIbQ05Zx4hDz4fWv/NNQ+SApTDc6bnuNgFWTdt6i6gUQLNb7p6fNN7YJL3qvRxAJSdixK2i3rigFFjXf4jvkdxrZUBmKJfnqQg53ZnIyq2iVMF4ybecmYJ95/4gEDjtc+8I9MqO8S6OWQCQKk8XuBf6xMoyxcDpCoBVl6VNT6W SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 20:17:02.4343 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c286d6f7-a6ab-4431-7a53-08d5f8b4e8cd X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR07MB4075 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c | 112 ---------------------------------------- drivers/scsi/qla2xxx/qla_iocb.c | 25 --------- 2 files changed, 137 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 7b675243bd16..1de78697dc0d 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -4687,110 +4687,6 @@ qla2x00_configure_loop(scsi_qla_host_t *vha) } /* - * N2N Login - * Updates Fibre Channel Device Database with local loop devices. - * - * Input: - * ha = adapter block pointer. - * - * Returns: - */ -static int qla24xx_n2n_handle_login(struct scsi_qla_host *vha, - fc_port_t *fcport) -{ - struct qla_hw_data *ha = vha->hw; - int res = QLA_SUCCESS, rval; - int greater_wwpn = 0; - int logged_in = 0; - - if (ha->current_topology != ISP_CFG_N) - return res; - - if (wwn_to_u64(vha->port_name) > - wwn_to_u64(vha->n2n_port_name)) { - ql_dbg(ql_dbg_disc, vha, 0x2002, - "HBA WWPN is greater %llx > target %llx\n", - wwn_to_u64(vha->port_name), - wwn_to_u64(vha->n2n_port_name)); - greater_wwpn = 1; - fcport->d_id.b24 = vha->n2n_id; - } - - fcport->loop_id = vha->loop_id; - fcport->fc4f_nvme = 0; - fcport->query = 1; - - ql_dbg(ql_dbg_disc, vha, 0x4001, - "Initiate N2N login handler: HBA port_id=%06x loopid=%d\n", - fcport->d_id.b24, vha->loop_id); - - /* Fill in member data. */ - if (!greater_wwpn) { - rval = qla2x00_get_port_database(vha, fcport, 0); - ql_dbg(ql_dbg_disc, vha, 0x1051, - "Remote login-state (%x/%x) port_id=%06x loop_id=%x, rval=%d\n", - fcport->current_login_state, fcport->last_login_state, - fcport->d_id.b24, fcport->loop_id, rval); - - if (((fcport->current_login_state & 0xf) == 0x4) || - ((fcport->current_login_state & 0xf) == 0x6)) - logged_in = 1; - } - - if (logged_in || greater_wwpn) { - if (!vha->nvme_local_port && vha->flags.nvme_enabled) - qla_nvme_register_hba(vha); - - /* Set connected N_Port d_id */ - if (vha->flags.nvme_enabled) - fcport->fc4f_nvme = 1; - - fcport->scan_state = QLA_FCPORT_FOUND; - fcport->fw_login_state = DSC_LS_PORT_UNAVAIL; - fcport->disc_state = DSC_GNL; - fcport->n2n_flag = 1; - fcport->flags = 3; - vha->hw->flags.gpsc_supported = 0; - - if (greater_wwpn) { - ql_dbg(ql_dbg_disc, vha, 0x20e5, - "%s %d PLOGI ELS %8phC\n", - __func__, __LINE__, fcport->port_name); - - res = qla24xx_els_dcmd2_iocb(vha, ELS_DCMD_PLOGI, - fcport, fcport->d_id); - } - - if (res != QLA_SUCCESS) { - ql_log(ql_log_info, vha, 0xd04d, - "PLOGI Failed: portid=%06x - retrying\n", - fcport->d_id.b24); - res = QLA_SUCCESS; - } else { - /* State 0x6 means FCP PRLI complete */ - if ((fcport->current_login_state & 0xf) == 0x6) { - ql_dbg(ql_dbg_disc, vha, 0x2118, - "%s %d %8phC post GPDB work\n", - __func__, __LINE__, fcport->port_name); - fcport->chip_reset = - vha->hw->base_qpair->chip_reset; - qla24xx_post_gpdb_work(vha, fcport, 0); - } else { - ql_dbg(ql_dbg_disc, vha, 0x2118, - "%s %d %8phC post NVMe PRLI\n", - __func__, __LINE__, fcport->port_name); - qla24xx_post_prli_work(vha, fcport); - } - } - } else { - /* Wait for next database change */ - set_bit(N2N_LOGIN_NEEDED, &vha->dpc_flags); - } - - return res; -} - -/* * qla2x00_configure_local_loop * Updates Fibre Channel Device Database with local loop devices. * @@ -4847,14 +4743,6 @@ qla2x00_configure_local_loop(scsi_qla_host_t *vha) } new_fcport->flags &= ~FCF_FABRIC_DEVICE; - /* Inititae N2N login. */ - if (test_and_clear_bit(N2N_LOGIN_NEEDED, &vha->dpc_flags)) { - rval = qla24xx_n2n_handle_login(vha, new_fcport); - if (rval != QLA_SUCCESS) - goto cleanup_allocation; - return QLA_SUCCESS; - } - /* Add devices to port list. */ id_iter = (char *)ha->gid_list; for (index = 0; index < entries; index++) { diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index a91cca52b5d5..b349e9b94c08 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -2568,26 +2568,6 @@ qla24xx_els_logo_iocb(srb_t *sp, struct els_entry_24xx *els_iocb) } static void -qla2x00_els_dcmd2_sp_free(void *data) -{ - srb_t *sp = data; - struct srb_iocb *elsio = &sp->u.iocb_cmd; - - if (elsio->u.els_plogi.els_plogi_pyld) - dma_free_coherent(&sp->vha->hw->pdev->dev, DMA_POOL_SIZE, - elsio->u.els_plogi.els_plogi_pyld, - elsio->u.els_plogi.els_plogi_pyld_dma); - - if (elsio->u.els_plogi.els_resp_pyld) - dma_free_coherent(&sp->vha->hw->pdev->dev, DMA_POOL_SIZE, - elsio->u.els_plogi.els_resp_pyld, - elsio->u.els_plogi.els_resp_pyld_dma); - - del_timer(&elsio->timer); - qla2x00_rel_sp(sp); -} - -static void qla2x00_els_dcmd2_iocb_timeout(void *data) { srb_t *sp = data; @@ -2648,10 +2628,6 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, } elsio = &sp->u.iocb_cmd; - fcport->d_id.b.domain = remote_did.b.domain; - fcport->d_id.b.area = remote_did.b.area; - fcport->d_id.b.al_pa = remote_did.b.al_pa; - ql_dbg(ql_dbg_io, vha, 0x3073, "Enter: PLOGI portid=%06x\n", fcport->d_id.b24); @@ -2664,7 +2640,6 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, qla2x00_init_timer(sp, ELS_DCMD_TIMEOUT); sp->done = qla2x00_els_dcmd2_sp_done; - sp->free = qla2x00_els_dcmd2_sp_free; ptr = elsio->u.els_plogi.els_plogi_pyld = dma_alloc_coherent(&ha->pdev->dev, DMA_POOL_SIZE, From patchwork Thu Aug 2 20:16:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10554187 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 95DF61708 for ; Thu, 2 Aug 2018 20:21:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DE572C4CF for ; Thu, 2 Aug 2018 20:21:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7228C2C464; Thu, 2 Aug 2018 20:21:14 +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 539492C4CF for ; Thu, 2 Aug 2018 20:21:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727355AbeHBWNz (ORCPT ); Thu, 2 Aug 2018 18:13:55 -0400 Received: from mail-co1nam03on0069.outbound.protection.outlook.com ([104.47.40.69]:43560 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727136AbeHBWNy (ORCPT ); Thu, 2 Aug 2018 18:13:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tXjhiBKYPThYZby09BHInMxwOsQpPVZWeYfKta1C85Y=; b=NIMh0igAOKl0GyXi2tb5E86xpViVllUWA7jvE5C7kLPiG77xW07J9A/niGwJnKBtG1g4w9tz5j7FAnUA9XZ4ICB6kg01ZWYbNEw2WjcsC6jLd9hVjhtdKKcopDU+t+c8EvxASDacdlKgWhV5FTPHmsBAL1S40Y4y+QDWB7KU5ns= Received: from BYAPR07CA0016.namprd07.prod.outlook.com (2603:10b6:a02:bc::29) by SN1PR07MB4080.namprd07.prod.outlook.com (2603:10b6:802:2e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Thu, 2 Aug 2018 20:17:04 +0000 Received: from BY2NAM05FT024.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::201) by BYAPR07CA0016.outlook.office365.com (2603:10b6:a02:bc::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.15 via Frontend Transport; Thu, 2 Aug 2018 20:17:04 +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 BY2NAM05FT024.mail.protection.outlook.com (10.152.100.161) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Thu, 2 Aug 2018 20:17:04 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Thu, 2 Aug 2018 13:16:59 -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 w72KGwTC007946; Thu, 2 Aug 2018 13:16:58 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w72KGweo007945; Thu, 2 Aug 2018 13:16:58 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 02/16] qla2xxx: Fix N2N link re-connect Date: Thu, 2 Aug 2018 13:16:44 -0700 Message-ID: <20180802201658.7903-3-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180802201658.7903-1-himanshu.madhani@cavium.com> References: <20180802201658.7903-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)(39860400002)(346002)(376002)(2980300002)(438002)(199004)(189003)(81156014)(80596001)(36756003)(26005)(8936002)(76176011)(87636003)(305945005)(8676002)(16586007)(2906002)(42186006)(478600001)(5660300001)(72206003)(47776003)(54906003)(110136005)(106002)(1076002)(106466001)(356003)(6666003)(51416003)(81166006)(50226002)(4326008)(11346002)(575784001)(86362001)(44832011)(336012)(486006)(126002)(14444005)(48376002)(476003)(50466002)(446003)(2616005)(186003)(69596002)(316002);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR07MB4080;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;BY2NAM05FT024;1:GAeiLyrjGsfW4Zg72dFkecV9PY65bHrl+6ydx91gqzyxQs7AY2tBEwxbijPDoDtY6g9H+FQRFF2kptNfHq2jmOsVdLPcc5Zan0DsM6m0naCvJnTqaU7e06UgZ4MvvbUs X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f5def58e-31d1-4999-fbfa-08d5f8b4e9ce X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:SN1PR07MB4080; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB4080;3:StjaPBc8a7bD7yOSqF/jApqXYFArsV7LsHMYU8pKvZT/yQICDJ0p6ZvfEZk2sZ1xkeSOSU1MixZD4XU7MSKXFXRIBygZFkBZg4A2NmFIc6Za+kUT1TJzxSq7nA5/udSlicrxwqZCvPtKArFxKUJphCfTHUTnz0d8yCf6RUNn3pa9Nipc47w4/rrciOaja46jQ6Y151C7nEvYFXDZT+IukMqXNNY0JjIYWWoTJ9KbRSsQmGmtfOJZl5IWmyMDFQHLlpfmRFihVqV799GlgeZj4wHSolzJN8dG9O17HuJWbUZzGf9afSSvUsdc6k9VpGFWSlhXM2dxhRia3mSTfJTR6LmfroHQV+JfaKaaer5Vc3M=;25:lICG0b1D8jK4tEkzlD8tpUYO1/zBfqtpLj5/eSW6JvUpbFDVPvlRmuo6DMP5giXzfJxlpedH1bGzanJ7fjwQq2gCuVxIKwzEw9K1Yus7Wq9yBtuDXv2BKoN4zTtzFhhB7UwftQRJcV2gfqBQ5a6vFUiNnTTsmilytIvlnTLsFRFOL910KKJGSFmXwer6SmixqieRUZ0C3Hlr6feO4RUqyrzZJNUKuVBhwp+Fy/GPLDFEfb06iySS/AY6RzY04tbbsCHPgjJxzmJ5R+Qjgwdade54Q8BBwKsCcZT42VU9kk40XNHJE/vYXKGHb3AFKLkE/bbUcDuC2OQPvqD2SL3Lng== X-MS-TrafficTypeDiagnostic: SN1PR07MB4080: X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB4080;31:zmM4E5MaFwmqub8/2f6UxGnVbmquoExwWv4Kt6EFz/4pLLGu87cjr5a2rXvGzaNkVqKBIAqHIyWOFJbYqJrwhI8cU4zf5Bn1/qJJ3Tn6M5+DhLkefyL3RkUJunJ3wEGfc9JmT3jUEXGvqoZKR3MDXzZhREg7RpgAroIrzG4Wr6QGskpGsT4fDVHVM0gM4NJkz0BLMfIX6XP/3UylcoQ2k/pcseqFAnpDM3jXIHU8YOo=;20:b+ml5/XnoDi4IEoSO9TXucU4wBlJ/iie80sGQq+TfHDPu3YPPpZIPe49y1a8d+nGvcT210i6GWgxZr7RLdZQ0z+VBNMqq13l5R9bZEeiS0S1ZknPbQ7E5WlB1mCtiao2fmYfjB9k9FEGwWpcIoUOm6Or4JpSOmNODz7tX6PnE++mfAIma83J1/Mm1+6XziX2KICluGLKbIc48O4rlPEyvctCol1hB/UfhFwGsqthbalkL85nVmjHSR8R+An60FrLZ70KSs0kzJEpaS1/DggbrFQK1UVi3v+LJhheGL9gK1zMYPvzuP2vF6mcvHK0QG4d44HfCxV0ReqLPIuOl1fzEv4999DxzHGFN1+/9SPme2w87UuPjb+ae/bkt+6cPdhLpJwuykHI81QVM0q3szl/zGOeVSK35C/q8AToPY2QuYQdxhh2YJZuOTd44VkMwpGEejl6bQ+T3523K637a0AY+t+zwhslH/R5QqjpCWrTT7QN1TdxlIc7RqqCyoMSDCqq 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)(3002001)(93006095)(93004095)(3231311)(944501410)(52105095)(10201501046)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:SN1PR07MB4080;BCL:0;PCL:0;RULEID:;SRVR:SN1PR07MB4080; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB4080;4:EyxePoKHDPnWsWk+46yrEW33IFhkOCtLLKgpvok/lj+KsCeN1jZBuDPXzW18mJvAx+F6b5MRQj2FUstgKoI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f0RKbyTOelfu6qSHZ0Dsefkm3Lx4CoMUI6A6h4jYFswG3dX2BQHdZQOlYHXM5c0UkxO1a04+bw42kAvhT9LJVPq/o2F68isX9fRmE9+72cKVep37REiGhTuZdIOTsBWcjsexL3s9qkiTDpMqe9kEC5BR5amkTFbkMxGIxfAPwV/aHHnt0Pq3NvHxIEGusLCzviTwEKnHx2g==;5:Uw4sylakP17cmhpjufdIbVpnsxHluv9+F+DJezb/hnG8gLmyk1cf3T/F5+byvxteAkB9s0P4ae0GKaxgU0ZbIOTBMneo2zLfYp6MQugbnE4reqzKADB8No6QRMYTM/hOWL1jLLPkjWKx6zROGSQT2DNEvhs7XZpbCM8LAixxVU4=;7:3StkVhcHoA3S6dOrHCDkx5vQ4xuLtipNkBRePKSSrTB8ofOYYZ9OnOZ2FPrEcGNNXZBsRMlgSHDHj/K+TfcoZh0j3Qi/tKtt8A1ACFnmXuKaLZCrgntNDx9GyJN1+T6wC5mbxbRLV2V0k3ErnDQVKO2DMoQdYge5daBKgUg7k1pmk/YVNHXscvUlRQ57mUQEJqxVRkvlZBNnMhe2koNFxPovs2ytcZ2zLZWHtjXVub2GtKj5UZ9GHkHY9w77t8Y1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 20:17:04.1063 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f5def58e-31d1-4999-fbfa-08d5f8b4e9ce 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: SN1PR07MB4080 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 | 227 +++++++++++++++++++++++++------------- 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, 181 insertions(+), 108 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 9442e18aef6f..ee4d1f4fdf95 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -377,6 +377,7 @@ struct srb_iocb { #define SRB_LOGIN_COND_PLOGI BIT_1 #define SRB_LOGIN_SKIP_PRLI BIT_2 #define SRB_LOGIN_NVME_PRLI BIT_3 +#define SRB_LOGIN_PRLI_ONLY BIT_4 uint16_t data[2]; u32 iop[2]; } logio; @@ -4236,7 +4237,7 @@ typedef struct scsi_qla_host { #define FCOE_CTX_RESET_NEEDED 18 /* Initiate FCoE context reset */ #define MPI_RESET_NEEDED 19 /* Initiate MPI FW reset */ #define ISP_QUIESCE_NEEDED 20 /* Driver need some quiescence */ -#define FREE_BIT 21 +#define N2N_LINK_RESET 21 #define PORT_UPDATE_NEEDED 22 #define FX00_RESET_RECOVERY 23 #define FX00_TARGET_SCAN 24 diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 1de78697dc0d..52e163553e90 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -160,6 +160,22 @@ qla2x00_async_login_sp_done(void *ptr, int res) sp->free(sp); } +static inline bool +fcport_is_smaller(fc_port_t *fcport) +{ + if (wwn_to_u64(fcport->port_name) < + wwn_to_u64(fcport->vha->port_name)) + return true; + else + return false; +} + +static inline bool +fcport_is_bigger(fc_port_t *fcport) +{ + return !fcport_is_smaller(fcport); +} + int qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport, uint16_t *data) @@ -189,13 +205,18 @@ qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport, qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); sp->done = qla2x00_async_login_sp_done; - lio->u.logio.flags |= SRB_LOGIN_COND_PLOGI; + if (N2N_TOPO(fcport->vha->hw) && fcport_is_bigger(fcport)) { + lio->u.logio.flags |= SRB_LOGIN_PRLI_ONLY; + } else { + lio->u.logio.flags |= SRB_LOGIN_COND_PLOGI; - if (fcport->fc4f_nvme) - lio->u.logio.flags |= SRB_LOGIN_SKIP_PRLI; + if (fcport->fc4f_nvme) + lio->u.logio.flags |= SRB_LOGIN_SKIP_PRLI; + + if (data[1] & QLA_LOGIO_LOGIN_RETRIED) + lio->u.logio.flags |= SRB_LOGIN_RETRIED; + } - if (data[1] & QLA_LOGIO_LOGIN_RETRIED) - lio->u.logio.flags |= SRB_LOGIN_RETRIED; rval = qla2x00_start_sp(sp); if (rval != QLA_SUCCESS) { fcport->flags |= FCF_LOGIN_NEEDED; @@ -497,15 +518,18 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, for (i = 0; i < n; i++) { e = &vha->gnl.l[i]; wwn = wwn_to_u64(e->port_name); + id.b.domain = e->port_id[2]; + id.b.area = e->port_id[1]; + id.b.al_pa = e->port_id[0]; + id.b.rsvd_1 = 0; if (memcmp((u8 *)&wwn, fcport->port_name, WWN_SIZE)) continue; + if (IS_SW_RESV_ADDR(id)) + continue; + found = 1; - id.b.domain = e->port_id[2]; - id.b.area = e->port_id[1]; - id.b.al_pa = e->port_id[0]; - id.b.rsvd_1 = 0; loop_id = le16_to_cpu(e->nport_handle); loop_id = (loop_id & 0x7fff); @@ -518,14 +542,18 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa, loop_id, fcport->loop_id); - if ((id.b24 != fcport->d_id.b24) || - ((fcport->loop_id != FC_NO_LOOP_ID) && - (fcport->loop_id != loop_id))) { - ql_dbg(ql_dbg_disc, vha, 0x20e3, - "%s %d %8phC post del sess\n", - __func__, __LINE__, fcport->port_name); - qlt_schedule_sess_for_deletion(fcport); - return; + switch (fcport->disc_state) { + case DSC_DELETE_PEND: + case DSC_DELETED: + break; + default: + if ((id.b24 != fcport->d_id.b24) || + ((fcport->loop_id != FC_NO_LOOP_ID) && + (fcport->loop_id != loop_id))) { + qlt_schedule_sess_for_deletion(fcport); + return; + } + break; } fcport->loop_id = loop_id; @@ -544,66 +572,122 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, fcport->login_pause = 1; } - if (fcport->fc4f_nvme) + if (fcport->fc4f_nvme) current_login_state = e->current_login_state >> 4; else current_login_state = e->current_login_state & 0xf; - switch (current_login_state) { - case DSC_LS_PRLI_COMP: - ql_dbg(ql_dbg_disc, vha, 0x20e4, - "%s %d %8phC post gpdb\n", - __func__, __LINE__, fcport->port_name); + switch (vha->hw->current_topology) { + default: + switch (current_login_state) { + case DSC_LS_PRLI_COMP: + ql_dbg(ql_dbg_disc + ql_dbg_verbose, + vha, 0x20e4, "%s %d %8phC post gpdb\n", + __func__, __LINE__, fcport->port_name); - if ((e->prli_svc_param_word_3[0] & BIT_4) == 0) - fcport->port_type = FCT_INITIATOR; - else - fcport->port_type = FCT_TARGET; + if ((e->prli_svc_param_word_3[0] & BIT_4) == 0) + fcport->port_type = FCT_INITIATOR; + else + fcport->port_type = FCT_TARGET; + data[0] = data[1] = 0; + qla2x00_post_async_adisc_work(vha, fcport, + data); + break; + case DSC_LS_PORT_UNAVAIL: + default: + if (fcport->loop_id != FC_NO_LOOP_ID) + qla2x00_clear_loop_id(fcport); - data[0] = data[1] = 0; - qla2x00_post_async_adisc_work(vha, fcport, data); - break; - case DSC_LS_PORT_UNAVAIL: - default: - if (fcport->loop_id == FC_NO_LOOP_ID) { - qla2x00_find_new_loop_id(vha, fcport); + fcport->loop_id = loop_id; fcport->fw_login_state = DSC_LS_PORT_UNAVAIL; + qla24xx_fcport_handle_login(vha, fcport); + break; } - ql_dbg(ql_dbg_disc, vha, 0x20e5, - "%s %d %8phC\n", - __func__, __LINE__, fcport->port_name); - qla24xx_fcport_handle_login(vha, fcport); break; - } + case ISP_CFG_N: + switch (current_login_state) { + case DSC_LS_PRLI_COMP: + if ((e->prli_svc_param_word_3[0] & BIT_4) == 0) + fcport->port_type = FCT_INITIATOR; + else + fcport->port_type = FCT_TARGET; + + data[0] = data[1] = 0; + qla2x00_post_async_adisc_work(vha, fcport, + data); + break; + case DSC_LS_PLOGI_COMP: + if (fcport_is_bigger(fcport)) { + /* local adapter is smaller */ + if (fcport->loop_id != FC_NO_LOOP_ID) + qla2x00_clear_loop_id(fcport); + + fcport->loop_id = loop_id; + qla24xx_fcport_handle_login(vha, + fcport); + break; + } + /* drop through */ + default: + if (fcport_is_smaller(fcport)) { + /* local adapter is bigger */ + if (fcport->loop_id != FC_NO_LOOP_ID) + qla2x00_clear_loop_id(fcport); + + fcport->loop_id = loop_id; + qla24xx_fcport_handle_login(vha, + fcport); + } + break; + } + break; + } /* switch (ha->current_topology) */ } if (!found) { - /* fw has no record of this port */ - for (i = 0; i < n; i++) { - e = &vha->gnl.l[i]; - id.b.domain = e->port_id[0]; - id.b.area = e->port_id[1]; - id.b.al_pa = e->port_id[2]; - id.b.rsvd_1 = 0; - loop_id = le16_to_cpu(e->nport_handle); - - if (fcport->d_id.b24 == id.b24) { - conflict_fcport = - qla2x00_find_fcport_by_wwpn(vha, - e->port_name, 0); - ql_dbg(ql_dbg_disc, vha, 0x20e6, - "%s %d %8phC post del sess\n", - __func__, __LINE__, - conflict_fcport->port_name); - qlt_schedule_sess_for_deletion - (conflict_fcport); + switch (vha->hw->current_topology) { + case ISP_CFG_F: + case ISP_CFG_FL: + for (i = 0; i < n; i++) { + e = &vha->gnl.l[i]; + id.b.domain = e->port_id[0]; + id.b.area = e->port_id[1]; + id.b.al_pa = e->port_id[2]; + id.b.rsvd_1 = 0; + loop_id = le16_to_cpu(e->nport_handle); + + if (fcport->d_id.b24 == id.b24) { + conflict_fcport = + qla2x00_find_fcport_by_wwpn(vha, + e->port_name, 0); + ql_dbg(ql_dbg_disc + ql_dbg_verbose, + vha, 0x20e5, + "%s %d %8phC post del sess\n", + __func__, __LINE__, + conflict_fcport->port_name); + qlt_schedule_sess_for_deletion + (conflict_fcport); + } + /* + * FW already picked this loop id for + * another fcport + */ + if (fcport->loop_id == loop_id) + fcport->loop_id = FC_NO_LOOP_ID; } - - /* FW already picked this loop id for another fcport */ - if (fcport->loop_id == loop_id) - fcport->loop_id = FC_NO_LOOP_ID; + qla24xx_fcport_handle_login(vha, fcport); + break; + case ISP_CFG_N: + /* + * FW handles the initial login for n2n. + * Do link reinit to trigger this auto login. + */ + set_bit(N2N_LINK_RESET, &vha->dpc_flags); + qla2xxx_wake_dpc(vha); + break; + default: + break; } - qla24xx_fcport_handle_login(vha, fcport); } } /* gnl_event */ @@ -4590,20 +4674,10 @@ qla2x00_configure_loop(scsi_qla_host_t *vha) } else if (ha->current_topology == ISP_CFG_N) { clear_bit(RSCN_UPDATE, &flags); - if (ha->flags.rida_fmt2) { - /* With Rida Format 2, the login is already triggered. - * We know who is on the other side of the wire. - * No need to login to do login to find out or drop into - * qla2x00_configure_local_loop(). - */ + if (qla_tgt_mode_enabled(vha)) { + /* allow the other side to start the login */ clear_bit(LOCAL_LOOP_UPDATE, &flags); set_bit(RELOGIN_NEEDED, &vha->dpc_flags); - } else { - if (qla_tgt_mode_enabled(vha)) { - /* allow the other side to start the login */ - clear_bit(LOCAL_LOOP_UPDATE, &flags); - set_bit(RELOGIN_NEEDED, &vha->dpc_flags); - } } } else if (ha->current_topology == ISP_CFG_NL) { clear_bit(RSCN_UPDATE, &flags); @@ -7929,8 +8003,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha) } /* enable RIDA Format2 */ - if (qla_tgt_mode_enabled(vha) || qla_dual_mode_enabled(vha)) - icb->firmware_options_3 |= BIT_0; + icb->firmware_options_3 |= BIT_0; if (IS_QLA27XX(ha)) { icb->firmware_options_3 |= BIT_8; diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index b349e9b94c08..e1ff2e27e59f 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -2240,12 +2240,15 @@ qla24xx_login_iocb(srb_t *sp, struct logio_entry_24xx *logio) struct srb_iocb *lio = &sp->u.iocb_cmd; logio->entry_type = LOGINOUT_PORT_IOCB_TYPE; - logio->control_flags = cpu_to_le16(LCF_COMMAND_PLOGI); - - if (lio->u.logio.flags & SRB_LOGIN_COND_PLOGI) - logio->control_flags |= cpu_to_le16(LCF_COND_PLOGI); - if (lio->u.logio.flags & SRB_LOGIN_SKIP_PRLI) - logio->control_flags |= cpu_to_le16(LCF_SKIP_PRLI); + if (lio->u.logio.flags & SRB_LOGIN_PRLI_ONLY) { + logio->control_flags = cpu_to_le16(LCF_COMMAND_PRLI); + } else { + logio->control_flags = cpu_to_le16(LCF_COMMAND_PLOGI); + if (lio->u.logio.flags & SRB_LOGIN_COND_PLOGI) + logio->control_flags |= cpu_to_le16(LCF_COND_PLOGI); + if (lio->u.logio.flags & SRB_LOGIN_SKIP_PRLI) + logio->control_flags |= cpu_to_le16(LCF_SKIP_PRLI); + } logio->nport_handle = cpu_to_le16(sp->fcport->loop_id); logio->port_id[0] = sp->fcport->d_id.b.al_pa; logio->port_id[1] = sp->fcport->d_id.b.area; diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 9fa5a2557f2c..e90fb17d2121 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -908,7 +908,8 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) if (!atomic_read(&vha->loop_down_timer)) atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); - qla2x00_mark_all_devices_lost(vha, 1); + if (!N2N_TOPO(ha)) + qla2x00_mark_all_devices_lost(vha, 1); } if (vha->vp_idx) { diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 7e875f575229..4e42ce057a37 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -2177,7 +2177,10 @@ qla2x00_lip_reset(scsi_qla_host_t *vha) mcp->out_mb = MBX_2|MBX_1|MBX_0; } else if (IS_FWI2_CAPABLE(vha->hw)) { mcp->mb[0] = MBC_LIP_FULL_LOGIN; - mcp->mb[1] = BIT_6; + if (N2N_TOPO(vha->hw)) + mcp->mb[1] = BIT_4; /* re-init */ + else + mcp->mb[1] = BIT_6; /* LIP */ mcp->mb[2] = 0; mcp->mb[3] = vha->hw->loop_reset_delay; mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0; @@ -3911,28 +3914,6 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, if (fcport) { fcport->plogi_nack_done_deadline = jiffies + HZ; fcport->scan_state = QLA_FCPORT_FOUND; - switch (fcport->disc_state) { - case DSC_DELETED: - ql_dbg(ql_dbg_disc, vha, 0x210d, - "%s %d %8phC login\n", - __func__, __LINE__, fcport->port_name); - qla24xx_fcport_handle_login(vha, fcport); - break; - case DSC_DELETE_PEND: - break; - default: - qlt_schedule_sess_for_deletion(fcport); - break; - } - } else { - id.b.al_pa = rptid_entry->u.f2.remote_nport_id[0]; - id.b.area = rptid_entry->u.f2.remote_nport_id[1]; - id.b.domain = rptid_entry->u.f2.remote_nport_id[2]; - qla24xx_post_newsess_work(vha, &id, - rptid_entry->u.f2.port_name, - rptid_entry->u.f2.node_name, - NULL, - FC4_TYPE_UNKNOWN); } } } diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index e881fce7477a..eb804e2feedf 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -6186,6 +6186,11 @@ qla2x00_do_dpc(void *data) if (!IS_QLAFX00(ha)) qla2x00_do_dpc_all_vps(base_vha); + if (test_and_clear_bit(N2N_LINK_RESET, + &base_vha->dpc_flags)) { + qla2x00_lip_reset(base_vha); + } + ha->dpc_active = 0; end_loop: set_current_state(TASK_INTERRUPTIBLE); diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 3de11153d1d3..9d10989ed027 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -805,6 +805,10 @@ qlt_plogi_ack_find_add(struct scsi_qla_host *vha, port_id_t *id, list_for_each_entry(pla, &vha->plogi_ack_list, list) { if (pla->id.b24 == id->b24) { + ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0x210d, + "%s %d %8phC Term INOT due to new INOT", + __func__, __LINE__, + pla->iocb.u.isp24.port_name); qlt_send_term_imm_notif(vha, &pla->iocb, 1); memcpy(&pla->iocb, iocb, sizeof(pla->iocb)); return pla; @@ -1073,6 +1077,7 @@ void qlt_free_session_done(struct work_struct *work) struct qlt_plogi_ack_t *con = sess->plogi_link[QLT_PLOGI_LINK_CONFLICT]; struct imm_ntfy_from_isp *iocb; + own = sess->plogi_link[QLT_PLOGI_LINK_SAME_WWN]; if (con) { iocb = &con->iocb; @@ -4716,6 +4721,10 @@ static int qlt_handle_login(struct scsi_qla_host *vha, pla = qlt_plogi_ack_find_add(vha, &port_id, iocb); if (!pla) { + ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0xffff, + "%s %d %8phC Term INOT due to mem alloc fail", + __func__, __LINE__, + iocb->u.isp24.port_name); qlt_send_term_imm_notif(vha, iocb, 1); goto out; } From patchwork Thu Aug 2 20:16:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10554185 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 BB1381708 for ; Thu, 2 Aug 2018 20:18:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E16D2BFCB for ; Thu, 2 Aug 2018 20:18:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 824732BFD6; Thu, 2 Aug 2018 20:18:14 +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 AD3AB2BFCB for ; Thu, 2 Aug 2018 20:18:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729367AbeHBWKy (ORCPT ); Thu, 2 Aug 2018 18:10:54 -0400 Received: from mail-sn1nam02on0043.outbound.protection.outlook.com ([104.47.36.43]:13248 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727180AbeHBWKy (ORCPT ); Thu, 2 Aug 2018 18:10:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mkYEV3tjSypj805BGdR+B4OCmgwpgOAQTh6ki9LVDKs=; b=MGAEbaql775uyEn3FN6xjr8Tum0JQL2do+SB9oQ51Pd3rsG7gC/spW3/ejG6Utjzr6rUEV098rv40JIa3/YMl0l4czkSESRGmtAJsfX4pM/vYhelfppH7i3Sovc92j1guDnmHY5NuUrdQY/7Urna5VpeTM9p3heSYkHljx8aZ4s= Received: from DM5PR07CA0085.namprd07.prod.outlook.com (2603:10b6:4:ae::14) by DM2PR0701MB1389.namprd07.prod.outlook.com (2a01:111:e400:5119::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.20; Thu, 2 Aug 2018 20:17:05 +0000 Received: from BY2NAM05FT006.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by DM5PR07CA0085.outlook.office365.com (2603:10b6:4:ae::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.14 via Frontend Transport; Thu, 2 Aug 2018 20:17:05 +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 BY2NAM05FT006.mail.protection.outlook.com (10.152.100.143) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Thu, 2 Aug 2018 20:17:05 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Thu, 2 Aug 2018 13:16:59 -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 w72KGxZI007950; Thu, 2 Aug 2018 13:16:59 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w72KGxqg007949; Thu, 2 Aug 2018 13:16:59 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 03/16] qla2xxx: Fix login retry count Date: Thu, 2 Aug 2018 13:16:45 -0700 Message-ID: <20180802201658.7903-4-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180802201658.7903-1-himanshu.madhani@cavium.com> References: <20180802201658.7903-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(346002)(39860400002)(396003)(376002)(2980300002)(438002)(199004)(189003)(575784001)(8936002)(50466002)(72206003)(305945005)(14444005)(44832011)(50226002)(36756003)(2616005)(476003)(42186006)(106466001)(126002)(2906002)(86362001)(486006)(478600001)(1076002)(16586007)(316002)(81156014)(76176011)(11346002)(336012)(110136005)(446003)(81166006)(186003)(8676002)(51416003)(26005)(5660300001)(87636003)(47776003)(54906003)(4326008)(69596002)(106002)(80596001)(6666003)(48376002)(356003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR0701MB1389;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;BY2NAM05FT006;1:n2xOenxPsedSmBwYwL4UvOqiE2AXzKW/5oOKjC962IdGJWtUOnKAGuT1Dq9wbsRfDiT9M+lBv9zWMfHqLPTKfgUhaPpdZFpHmOk5C9sA3xGoxdJtE92nUh3zSbuJNVQZ X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 02a09437-b717-479b-e1b8-08d5f8b4ea75 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:DM2PR0701MB1389; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1389;3:5PaOYLlctGcV4ujZAqS1DK9WNyaCV31z63gcE9iaOLGEfAaS/JFWRs/Tt5MMx/n5k8mPiZweB932/ch+tknKyP7ZoSJL2Ghsvx5v9ypA4MMYWpbkmvNpsL2GWXcfomFNY7L8QKYn4Kmox1c9dP1z4ejYys1fZ8bmbtMH2OHw1/fwa5YsrL/saTF6JqjVCwMBblQC9Z6JMa6TACd3fDm3mbxhTx77xyDW2OVEyCxMFdl22Tzv8sg9NJTe7CDHSnJ8c4aQyMXgiaq0tDkXPCj4/eUcESjAbowO6etKpfAG8wHggJDpYjQMpqad6tJ89Xc1AGpR6kNTr+Dm5AtH8SdiWd4+p6pTJYhHavcYCsSsgJo=;25:uVT2yxsqyqh+0bT/1uk2ud0doDcK8Uok4NKgHhKhef6lRiHUFA0DKEijKavVpzVTGw8qpYwjxKpyjxNvD+Bf4JxUrAL/4jxE0N9mD8YD0N6Zw3CQeBeIzU1oL9s2DhggMv0WlTW9LVbjlK2XWCJnPwEkggQSQzoA2xO6Bf8evCTxt6tAcebMWHpaKFLENbkFeP/2VcGrzMyySfmjXwfJPDuvxWmblCYR6lv0UZ7UT7DNe4R66nQGbMRGgQ7t4Gr8lETbE3rAJSWd/Qp456WPW7obbYPYcPNWI4xck/9dEQZeVUJ1dGTyS+xfqcFsJUXl33NUXO3mPBND+0wyOkdVCg== X-MS-TrafficTypeDiagnostic: DM2PR0701MB1389: X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1389;31:gSzxMNLT1galcU0ujtyz8ilzOCuoJ+m2SwdKDgDUspHEYcE5nXjgNqgh1zM/VbzyzXWWOcjzyqZrzMy5L1CI0P1fV78fdjpA4h5/U68cno2Z9zE1cVwsZG5v4fEZXSfshnlXQCA8+f76PO/iy8OQGJm1XskA5uQZx0l7tGFIYWkXB2f6eWCDEJ4p4VM8ssIEkZxUpJVZaR+3uLSVxjaLabNkHYcCs9lYc2AEpe7PeQo=;20:hLXyUcVygPPoH9FpURRdd0NstP1YnavyXfZpMBWeiKISxj2xTnfl5s+qj7/yeJo9vb30U22hMS9wWdxE9Fxi9jmNUjbaTpLgR1zFq4i9evZBCxC2XughX5wVCXuLLlvKNeWpnZZ2rIPInTkEllipLBKbeEcFVRIElJOdLv+9ynnBlJiLqMIFlFe98sArQFqT7hUWFcCHBnl4quNoURzdUmyZOYOdI/oDme3dP3Wk9wq8eq4vyzZiWVizStJnnxmAhUKNqNAxG0zhswvn95tGwOJtWQG6+mEw1a0Dq6xIJzbo8+xTBMBzl6G2hbUHFs0RLB1sHF+/trNNtdPO0Yp8JY1LgrTWXDvJ2RbJVKl1jzjeUAfU6H524dW6RfxDp8965EC4amHVWA11nFXLNx3h7EWkcnmKrhQpO5/OcyuxBmWyYpDY73bX3dQlxkPbC5hI68gjChXmRA2fHGvyQ+vAWeL4XEtaFCmiMcZymJ2wQpzDVuxAmU0gpx8f3O/HXSlN 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)(10201501046)(93006095)(93004095)(3002001)(149027)(150027)(6041310)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:DM2PR0701MB1389;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0701MB1389; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1389;4:TQEHtHovdvDQ34VLnunnoHcVTy5WaICRQH42I/vbifFltyWt8LMeoVPXxy0gb7bdVf5XYknWVyp3wTom7crcTTxgY6rwiOwUurFxKlrGOD/BhlVrooxJCnfcZi5qw9pKzom0/rHlUdbzVf9MDAruzpS6F0gf9judVDNt5p4FS5pd3wEu+WyFN5mNaxovapohhAF7JH88zqSIErMScM8LJ0brfxo0XqunpxBZPpnHUkuT1RY1akvT1/4nqZDGfv80D6FJid+kqQjuWz4YfCtf5w== X-Forefront-PRVS: 07521929C1 X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1389;23:JRzduIJmkov2nV+ln1eKfsbonyBHtie7vJC7SmKs3jdq5UonvQMUVYUjdaEo/6pyRznTOcDcbKmyYEYjHfguakiLs0KenZdhhaFzyd92Nz8Xw365U6oyLgfJB8r6GYzlz9yPnnP1G6jcV3hEdMTpS9UtvcT0q60yeE7CxBaeYEn5pnf+sC1RJi3066LyOT0E+WuJMrZN5+G7ot1midQbOwLwxmY+3n21SkGHcB6w1ql9gmFqWXF89jG4oDUxUrEq4S677dlMw1eQ4gqZMgHy0veF4hzz8kPyfo26SDDfKliqYaAKvTJTckgYe9QKMYQIRsNwVNpvrmM+XkRB9bObY/ooxtxLCAnJ6T++G2CoQhSDzMtfqz6UxFvsi4N1xAKq3N0TPk16nINig/ZX0g0+CyNgaUKlXYeI3QptfzhORmNzWSOanzetuZsQcpX6nECT89SPLhmm+//+0uQ2ga1AJ3hIRmxZ4Hg+w8ou+flEekmWYn6eVLkklCUq4wPKI+9+R8Sdjq874uPRC+o1h6bXLvHpePP/bPABDZggJ9MoHyVjV9i0iHIX7p2tZ1jyqN4LVliVd3MBYyqYbkV2CvW6N/FJFjWoZkZTm/duaktO8p1gijoFth0iJaE/bqSvnmqR/uqvXeOn9w1dBTPh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K3UE15Dzp6uHXGwCBC+uLIjW4lWNz0k/GJFl1ATeSq2WUyvPBgcO2X3pAVinlywmZUqFg9hN6CiC4jNXyzGR6IYi5RWCb7DV5J4tBjb25cYIg+f+uHafGmnPgqla5DMnquWWSZIZPNJskRHg8Mfhh9ZGbQ84PkL7CfkOlPcHV2lf2W3pn5aA/DPMrUlyLxvGXexufwjwtLAVOaYDMXatfTlWcjW5D91Q3Px/vEnMMpfYiscUmd0KX7XSlCIUbctk9gwoOKwiBVxcaVWYc2gwqB9rJh7r8C46KCYu3qw883YXTY0G6mecQKoUq6KOO5kkCc1M9iyi6HA==;5:oxnz9LJRTe/52EGK4o76mRmdP59N9Akf3xOi5R5mOk/Ql1tjkbuTs6Jqc4HiyUQ7zTdqRfwhP2k6Hi6d0dYLNFMgq59Imq0xQpJBE/N/5smpi2ujl4Tn+A8YDHTkUqtovvI2l7zfS1ehkqWOYtdKgGiGkpD5ZgqaD0RH/ZyFnrU=;7:iLcxkM41Ue6nQsFh32rUZta32bGaEKzztToeOfEoq0okMjmzcneBRJ7f/W6IRQ+/pcuSiJyK7LWf6K9aHf906ytf9AmREcRQUHzAaNb5/PUOUHV46EyLMmuXvz+D+fPRJKmlO5ltnFsG8Hx29TEhzPdVB0mU5gecfMN4EoWtM3kl3Rba8Ou4a2O8AhSP84pS/yvmqYeNOMXiw+Ap0cARUEZeswV2TdXDFYJo9gG/7ykuP1dU7ZGeYm5xQDyFuyZ1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 20:17:05.2157 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 02a09437-b717-479b-e1b8-08d5f8b4ea75 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: DM2PR0701MB1389 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Quinn Tran Login retry count was not properly decrementing, which lead to endless login retry. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_gs.c | 16 +++++++ drivers/scsi/qla2xxx/qla_init.c | 23 +++------- drivers/scsi/qla2xxx/qla_mbx.c | 1 + drivers/scsi/qla2xxx/qla_os.c | 90 ++++++++++++++++++++------------------- drivers/scsi/qla2xxx/qla_target.c | 3 +- 5 files changed, 70 insertions(+), 63 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 4bc2b66b299f..5139a3577bb3 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -3475,6 +3475,14 @@ void qla24xx_handle_gpnid_event(scsi_qla_host_t *vha, struct event_arg *ea) fcport->rscn_gen++; fcport->scan_state = QLA_FCPORT_FOUND; fcport->flags |= FCF_FABRIC_DEVICE; + if (fcport->login_retry == 0) { + fcport->login_retry = + vha->hw->login_retry_count; + ql_dbg(ql_dbg_disc, vha, 0xffff, + "Port login retry %8phN, lid 0x%04x cnt=%d.\n", + fcport->port_name, fcport->loop_id, + fcport->login_retry); + } switch (fcport->disc_state) { case DSC_LOGIN_COMPLETE: /* recheck session is still intact. */ @@ -3967,6 +3975,14 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp) } else { if (fcport->rscn_rcvd || fcport->disc_state != DSC_LOGIN_COMPLETE) { + if (fcport->login_retry == 0) { + fcport->login_retry = + vha->hw->login_retry_count; + ql_dbg(ql_dbg_disc, vha, 0x20a3, + "Port login retry %8phN, lid 0x%04x retry cnt=%d.\n", + fcport->port_name, fcport->loop_id, + fcport->login_retry); + } fcport->rscn_rcvd = 0; qla24xx_fcport_handle_login(vha, fcport); } diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 52e163553e90..aea264100673 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); @@ -1256,11 +1253,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, @@ -1273,6 +1269,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; @@ -1289,6 +1286,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); @@ -1303,6 +1301,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; @@ -1386,17 +1385,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); @@ -1882,7 +1870,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; @@ -5076,11 +5063,11 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) if (IS_QLAFX00(vha->hw)) { qla2x00_set_fcport_state(fcport, FCS_ONLINE); } else { - fcport->login_retry = 0; fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT); fcport->disc_state = DSC_LOGIN_COMPLETE; fcport->deleted = 0; fcport->logout_on_delete = 1; + fcport->login_retry = vha->hw->login_retry_count; qla2x00_set_fcport_state(fcport, FCS_ONLINE); } diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 4e42ce057a37..17537f0b3b54 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -3912,6 +3912,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, rptid_entry->u.f2.port_name, 1); if (fcport) { + fcport->login_retry = vha->hw->login_retry_count; fcport->plogi_nack_done_deadline = jiffies + HZ; fcport->scan_state = QLA_FCPORT_FOUND; } diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index eb804e2feedf..e218d68de532 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -3838,14 +3838,6 @@ void qla2x00_mark_device_lost(scsi_qla_host_t *vha, fc_port_t *fcport, return; set_bit(RELOGIN_NEEDED, &vha->dpc_flags); - - if (fcport->login_retry == 0) { - fcport->login_retry = vha->hw->login_retry_count; - - ql_dbg(ql_dbg_disc, vha, 0x20a3, - "Port login retry %8phN, lid 0x%04x retry cnt=%d.\n", - fcport->port_name, fcport->loop_id, fcport->login_retry); - } } /* @@ -5098,7 +5090,7 @@ int qla24xx_post_relogin_work(struct scsi_qla_host *vha) void qla2x00_relogin(struct scsi_qla_host *vha) { fc_port_t *fcport; - int status; + int status, relogin_needed = 0; struct event_arg ea; list_for_each_entry(fcport, &vha->vp_fcports, list) { @@ -5107,47 +5099,59 @@ void qla2x00_relogin(struct scsi_qla_host *vha) * to it if we haven't run out of retries. */ if (atomic_read(&fcport->state) != FCS_ONLINE && - fcport->login_retry && - !(fcport->flags & (FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE))) { - if (vha->hw->current_topology != ISP_CFG_NL) { - ql_dbg(ql_dbg_disc, fcport->vha, 0x2108, - "%s %8phC DS %d LS %d\n", __func__, - fcport->port_name, fcport->disc_state, - fcport->fw_login_state); - memset(&ea, 0, sizeof(ea)); - ea.event = FCME_RELOGIN; - ea.fcport = fcport; - qla2x00_fcport_event_handler(vha, &ea); - } else if (vha->hw->current_topology == ISP_CFG_NL) { - fcport->login_retry--; - status = qla2x00_local_device_login(vha, - fcport); - if (status == QLA_SUCCESS) { - fcport->old_loop_id = fcport->loop_id; - ql_dbg(ql_dbg_disc, vha, 0x2003, - "Port login OK: logged in ID 0x%x.\n", - fcport->loop_id); - qla2x00_update_fcport(vha, fcport); - } else if (status == 1) { - set_bit(RELOGIN_NEEDED, &vha->dpc_flags); - /* retry the login again */ - ql_dbg(ql_dbg_disc, vha, 0x2007, - "Retrying %d login again loop_id 0x%x.\n", - fcport->login_retry, - fcport->loop_id); - } else { - fcport->login_retry = 0; - } + fcport->login_retry) { + if (fcport->scan_state != QLA_FCPORT_FOUND || + fcport->disc_state == DSC_LOGIN_COMPLETE) + continue; - if (fcport->login_retry == 0 && - status != QLA_SUCCESS) - qla2x00_clear_loop_id(fcport); + if (fcport->flags & (FCF_ASYNC_SENT|FCF_ASYNC_ACTIVE) || + fcport->disc_state == DSC_DELETE_PEND) { + relogin_needed = 1; + } else { + if (vha->hw->current_topology != ISP_CFG_NL) { + memset(&ea, 0, sizeof(ea)); + ea.event = FCME_RELOGIN; + ea.fcport = fcport; + qla2x00_fcport_event_handler(vha, &ea); + } else if (vha->hw->current_topology == + ISP_CFG_NL) { + fcport->login_retry--; + status = + qla2x00_local_device_login(vha, + fcport); + if (status == QLA_SUCCESS) { + fcport->old_loop_id = + fcport->loop_id; + ql_dbg(ql_dbg_disc, vha, 0x2003, + "Port login OK: logged in ID 0x%x.\n", + fcport->loop_id); + qla2x00_update_fcport + (vha, fcport); + } else if (status == 1) { + set_bit(RELOGIN_NEEDED, + &vha->dpc_flags); + /* retry the login again */ + ql_dbg(ql_dbg_disc, vha, 0x2007, + "Retrying %d login again loop_id 0x%x.\n", + fcport->login_retry, + fcport->loop_id); + } else { + fcport->login_retry = 0; + } + + if (fcport->login_retry == 0 && + status != QLA_SUCCESS) + qla2x00_clear_loop_id(fcport); + } } } if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) break; } + if (relogin_needed) + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + ql_dbg(ql_dbg_disc, vha, 0x400e, "Relogin end.\n"); } diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 9d10989ed027..4f9c315813df 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -1057,7 +1057,6 @@ void qlt_free_session_done(struct work_struct *work) sess->disc_state = DSC_DELETED; sess->fw_login_state = DSC_LS_PORT_UNAVAIL; sess->deleted = QLA_SESS_DELETED; - sess->login_retry = vha->hw->login_retry_count; if (sess->login_succ && !IS_SW_RESV_ADDR(sess->d_id)) { vha->fcport_count--; @@ -1161,7 +1160,7 @@ void qlt_unreg_sess(struct fc_port *sess) if (sess->se_sess) vha->hw->tgt.tgt_ops->clear_nacl_from_fcport_map(sess); - qla2x00_mark_device_lost(vha, sess, 1, 1); + qla2x00_mark_device_lost(vha, sess, 0, 0); sess->deleted = QLA_SESS_DELETION_IN_PROGRESS; sess->disc_state = DSC_DELETE_PEND; From patchwork Thu Aug 2 20:16:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10554159 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 D7CA39093 for ; Thu, 2 Aug 2018 20:17:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C425D2C444 for ; Thu, 2 Aug 2018 20:17:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B7D5F2C451; Thu, 2 Aug 2018 20:17:11 +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 4F3F72C461 for ; Thu, 2 Aug 2018 20:17:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727841AbeHBWJw (ORCPT ); Thu, 2 Aug 2018 18:09:52 -0400 Received: from mail-sn1nam01on0066.outbound.protection.outlook.com ([104.47.32.66]:60016 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727302AbeHBWJv (ORCPT ); Thu, 2 Aug 2018 18:09:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZypwnS/KIZRjJhDD4wMtKbx30p+lCstCBOuLlSjO+rw=; b=SPjWmH3xUMxL85J3+F9s6zmUylfhNIe3+CkkGC+JDn9cbaKxBzwhFwIRHkvzGdSwjLetOi4DdDWrzQSk8UqvtcTJjeWYvKArHC58AY0a+0+jr/bmQMVXbJU7dhIQkbQ5kYkWbSuSco6vdT0maBhWdin7vN9DisM7ZTxLdhxOHO0= Received: from DM5PR07CA0085.namprd07.prod.outlook.com (2603:10b6:4:ae::14) by BN3PR0701MB1378.namprd07.prod.outlook.com (2a01:111:e400:4018::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Thu, 2 Aug 2018 20:17:06 +0000 Received: from BY2NAM05FT006.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by DM5PR07CA0085.outlook.office365.com (2603:10b6:4:ae::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.14 via Frontend Transport; Thu, 2 Aug 2018 20:17:06 +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 BY2NAM05FT006.mail.protection.outlook.com (10.152.100.143) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Thu, 2 Aug 2018 20:17:06 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Thu, 2 Aug 2018 13:17:00 -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 w72KGxOH007954; Thu, 2 Aug 2018 13:16:59 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w72KGxOR007953; Thu, 2 Aug 2018 13:16:59 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 04/16] qla2xxx: Add longer window for Chip reset Date: Thu, 2 Aug 2018 13:16:46 -0700 Message-ID: <20180802201658.7903-5-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180802201658.7903-1-himanshu.madhani@cavium.com> References: <20180802201658.7903-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)(396003)(136003)(2980300002)(438002)(199004)(189003)(356003)(81156014)(81166006)(8676002)(6666003)(47776003)(2906002)(4326008)(5660300001)(478600001)(87636003)(1076002)(106466001)(186003)(72206003)(575784001)(86362001)(316002)(44832011)(126002)(476003)(446003)(486006)(2616005)(50226002)(69596002)(80596001)(11346002)(305945005)(8936002)(106002)(14444005)(51416003)(110136005)(50466002)(36756003)(48376002)(336012)(42186006)(26005)(54906003)(16586007)(76176011)(148743002);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR0701MB1378;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BY2NAM05FT006;1:VQo8woFtHY1c8k2Q06TlpSGFrqcvE3aizQ31g0F8wSYehsNlvlyRpUgiJX37eIgzGL346An3R9S99wC6FTe57r17ku4LTK/qc9snZdLg4lcRYON5xfqHGrDIkU93u35U X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ef338df1-6af9-4d57-efd4-08d5f8b4eb04 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BN3PR0701MB1378; X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;3:fm89FatU82AcTWiHkgkwAllA9H9Ih+XocfsYJHh1XHz/mvUzRTw156i2Jg0a2z+tIkwaG/kZIUTCD3k59TTothesQgs76BSsU6BulLTdu9WOX8fGVKCKFaJDz0Dvi1ERxqu51l4q80LHruuWRgRPwFND5zcN9YyFcDGOc3dtXGFtgM/aPJpV1VmYjsQ8+98ptByDS4Eq8pF6k9HpUqIpFt8HRDHFrERbQcMdeUg+OhCrK1EGw5304lCXqBIsTizXN+l0fT+5KxxQrDjmHhwVjZr0JHkxv1Z0gdx7zmicTA2zuKsVCaOZtuhNdHiNtpc6I/7JDAfnAh5PkkZWfBurIcway7KPW1YTBDtt0H/l5pA=;25:2lgOEkSPZDL53mcrTYSuUjGvu5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oMFozVeVC0QfQgD7BMyXauT0R53v/vTq9rzoH68aOSLPTD6MaEjtWZRPXrjXvM 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)(3002001)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:BN3PR0701MB1378;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1378; X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;4:/AxdWywA7pmhwbNeu/2jQwbZTpLQF/sTaPlDZt1EQ+k2Bf9hH2h0huH35nzvMrxwGacKTpP2w3VkPBB0++dqdVSJ3ARiTvOEMkJz7CiILpmnp0cU2r35y/zBtTz/lZsF3ie08jBmLikXY8v34EdX/kVOoq6/5bM2K7xy4LK60Htvhy7VqSuIuDhIerITNutvl98m0zz1dprPAJjpI1Mn57cR+smDyTYQWaZyGzSigCUPT77GI1Ua+98b6CdZgJkPc+xTxnl9byd9/O0XY8g4KA== X-Forefront-PRVS: 07521929C1 X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;23:6cMvsK0AQJwIliLLXpDRgFLOKfDYfJjjH6lNY1wkkE7E0go2nwie+fNuPbdtBPpDK+YvEfYfepIcKaTrRAP8czpNQV7ZHLxdpOiKYMU0gonZfDOUQZR/BbKI5P7bC6vdEchEZtKGUBjsc/XsKfz34TU67VgFjReD6qEY15TsW4iKfFQu9B+APoR1NgdLKEhwocVo7oA8llFddOozMy/TAHGWmYDOpZLb6Uipbh1KLXvUHHmocweeqpXc9DiQhA+cafUZz+TmDVhTRQlMQpma9OpaY5pECrceBIWssp7TgZbn/py+uYcPj5aavI9QW15Hv9Zw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6fydGkTK2P/V3k1GIo3XGABsdZRJFL+VNrBa9PEFVPCPEC2JBBZ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 20:17:06.1376 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ef338df1-6af9-4d57-efd4-08d5f8b4eb04 X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1378 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Quinn Tran 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 Thu Aug 2 20:16:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10554157 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 5A23A157D for ; Thu, 2 Aug 2018 20:17:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44A5A2C444 for ; Thu, 2 Aug 2018 20:17:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 38B162C459; Thu, 2 Aug 2018 20:17:11 +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 9785D2C444 for ; Thu, 2 Aug 2018 20:17:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727684AbeHBWJv (ORCPT ); Thu, 2 Aug 2018 18:09:51 -0400 Received: from mail-eopbgr720055.outbound.protection.outlook.com ([40.107.72.55]:35712 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727362AbeHBWJv (ORCPT ); Thu, 2 Aug 2018 18:09:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0GzZZEWAfoMBsSn5tPeOC6b6Wngai9gQdolOe52O0xM=; b=QXRF30q5KUjmfP56BW+/4l5HcIJDKF0FIBEUDe4BwHnbBKRB823qthL1j5W40XQ9X7Qq9H793kETH51FH+8Yxa3A5n9B4TLUbOyk0XeStZg6/KWMbgoDjLYbZMm9WIICaMW3fRgDTX+cuoYPPl+TE/l6J35tYByjnONv0GaV+2E= Received: from BYAPR07CA0016.namprd07.prod.outlook.com (2603:10b6:a02:bc::29) by DM2PR0701MB1390.namprd07.prod.outlook.com (2a01:111:e400:5119::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.19; Thu, 2 Aug 2018 20:17:07 +0000 Received: from BY2NAM05FT024.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::201) by BYAPR07CA0016.outlook.office365.com (2603:10b6:a02:bc::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.15 via Frontend Transport; Thu, 2 Aug 2018 20:17:06 +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 BY2NAM05FT024.mail.protection.outlook.com (10.152.100.161) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Thu, 2 Aug 2018 20:17:06 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Thu, 2 Aug 2018 13:17:00 -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 w72KGx5a007958; Thu, 2 Aug 2018 13:16:59 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w72KGxov007957; Thu, 2 Aug 2018 13:16:59 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 05/16] qla2xxx: Prevent SysFS access when chip is down Date: Thu, 2 Aug 2018 13:16:47 -0700 Message-ID: <20180802201658.7903-6-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180802201658.7903-1-himanshu.madhani@cavium.com> References: <20180802201658.7903-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)(199004)(189003)(81166006)(316002)(305945005)(356003)(86362001)(81156014)(47776003)(72206003)(54906003)(110136005)(106002)(50226002)(16586007)(4326008)(6666003)(478600001)(106466001)(8676002)(44832011)(36756003)(8936002)(51416003)(186003)(126002)(476003)(336012)(87636003)(50466002)(5660300001)(1076002)(48376002)(14444005)(486006)(2616005)(76176011)(42186006)(26005)(2906002)(69596002)(11346002)(80596001)(446003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR0701MB1390;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;BY2NAM05FT024;1:QU6ATPAWcPEviyZ/EIjCqZ0M2yV9TQfr2qGEjZzzaNWCA4Z7rj5GddeFVK9SNesijUUNbYHVc46XTu0qJYXhtO13SltVGneV263OxyG2hRWpO/R/m21fPoOnM8YHxYHB X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6e446b0b-debf-4d44-d894-08d5f8b4eb4e X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM2PR0701MB1390; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1390;3:DNBvzY4gWMuQZ7YgHz2QfCuJnBkvcpzIeXre/JfhdYBqL8PV+O5M3PGAcdT5J0UM/fAD/g/OscKo+yvSU6ISTSm5eMvI3aC5sCLqxrJIecPShQWC60++Q7O3gVlXCOtYLYVuztsUxyQCrg5XoZS8SyEnYCC95004CzDhaqmOxtsc0tpN2WQ6wFFNUO9MelyRGB4v2gBfnHv5/64HdwvBbJ48S5vikfxt9YXLnwhnlHTtDd3zh3qRzIeA+a3ChYN5d+tlNdMD74Eb/g2yFcwEIPzI4coEr58GHiQ98fYm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3wCXmI1fHIe0tVnbYbrfRNjQ3a7yHm0O3udkCu1wivbqCDg3c5yAIRxUMmvRuRp+6/3gWFMN3dNCt+IfgT0/d6W7UFpvEM4UKPIRa0FyfW7trSVlu5YcSWtxX4yKe7pspHg/usjwCz1vygwZzWmOHK9Jqg7wMlRaYW7hw 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)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:DM2PR0701MB1390;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0701MB1390; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1390;4:AfZZ0oTKzsaDAbUPdyM73CPeBaSjt4//pkdDNfUfMtxNnbKzX8AS+2ZRPJUqynJerUKjeyfBHIJ43xOWE+zOHTD7y3Pv4PsIxH1F+ZRi1x2YvSrD7zHWy9bPDD3+aZ6y/IQIjLt6kPV0NwJY+iv8k/Ae0PZng7JA+yKW16n+mTSKq3Zk/glburz34i+hOybG+Ho/fUiXCaRofErph6PC1RJbJHlws7NHQ8mIpEBjtf/gLA5m0fyUUPs8Toe84MjPnSxyTkW0qRK6uL0gdWP12A== X-Forefront-PRVS: 07521929C1 X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1390;23:o5DJ8hOQogYvE17Y7PYm2v2p+F/DgsrzfnsqVDwzbhcHcONYliWVtGJ5X5gveNAcqZoMbxFqVVD+a4ptipis9Cp6Zpl/oEx5QSDGnl5hciu7OLl7h55etpgovJgBryizhddMxwkE4DkpDYsGUic4EDWm1Fy9idiwckRRVwiyh+cLEYVkbmizlVW5gu13pdwLUQ7FQpI3c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Lhruf2JR7rLAFP5NRM8tMuctPcf37Si5QJHf4WwBurtL3xa4ao6tcnGAq9h0qZ/4ubm/MnQCBVJ0tcS+wDoFAeH93RvRyiFezYLEggsRf1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 20:17:06.6220 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6e446b0b-debf-4d44-d894-08d5f8b4eb4e 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: DM2PR0701MB1390 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Quinn Tran Prevent user from sending commands through SysFS while FW is not running or reset is in progress. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_attr.c | 33 +++++++++++++++++++++++++++------ drivers/scsi/qla2xxx/qla_init.c | 2 +- drivers/scsi/qla2xxx/qla_inline.h | 6 ++++++ 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 89a4999fa631..cc04caf83bd3 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -518,6 +518,9 @@ qla2x00_sysfs_write_vpd(struct file *filp, struct kobject *kobj, if (unlikely(pci_channel_offline(ha->pdev))) return 0; + if (qla2x00_chip_is_down(vha)) + return 0; + if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size || !ha->isp_ops->write_nvram) return 0; @@ -570,7 +573,7 @@ qla2x00_sysfs_read_sfp(struct file *filp, struct kobject *kobj, if (!capable(CAP_SYS_ADMIN) || off != 0 || count < SFP_DEV_SIZE) return 0; - if (qla2x00_reset_active(vha)) + if (qla2x00_chip_is_down(vha)) return 0; rval = qla2x00_read_sfp_dev(vha, buf, count); @@ -733,6 +736,15 @@ qla2x00_issue_logo(struct file *filp, struct kobject *kobj, int type; port_id_t did; + if (!capable(CAP_SYS_ADMIN)) + return 0; + + if (unlikely(pci_channel_offline(vha->hw->pdev))) + return 0; + + if (qla2x00_chip_is_down(vha)) + return 0; + type = simple_strtol(buf, NULL, 10); did.b.domain = (type & 0x00ff0000) >> 16; @@ -771,6 +783,12 @@ qla2x00_sysfs_read_xgmac_stats(struct file *filp, struct kobject *kobj, if (!capable(CAP_SYS_ADMIN) || off != 0 || count > XGMAC_DATA_SIZE) return 0; + if (unlikely(pci_channel_offline(ha->pdev))) + return 0; + + if (qla2x00_chip_is_down(vha)) + return 0; + if (ha->xgmac_data) goto do_read; @@ -825,6 +843,9 @@ qla2x00_sysfs_read_dcbx_tlv(struct file *filp, struct kobject *kobj, if (ha->dcbx_tlv) goto do_read; + if (qla2x00_chip_is_down(vha)) + return 0; + ha->dcbx_tlv = dma_alloc_coherent(&ha->pdev->dev, DCBX_TLV_DATA_SIZE, &ha->dcbx_tlv_dma, GFP_KERNEL); if (!ha->dcbx_tlv) { @@ -1036,7 +1057,7 @@ qla2x00_link_state_show(struct device *dev, struct device_attribute *attr, vha->device_flags & DFLG_NO_CABLE) len = scnprintf(buf, PAGE_SIZE, "Link Down\n"); else if (atomic_read(&vha->loop_state) != LOOP_READY || - qla2x00_reset_active(vha)) + qla2x00_chip_is_down(vha)) len = scnprintf(buf, PAGE_SIZE, "Unknown Link State\n"); else { len = scnprintf(buf, PAGE_SIZE, "Link Up - "); @@ -1163,7 +1184,7 @@ qla2x00_beacon_store(struct device *dev, struct device_attribute *attr, if (IS_QLA2100(ha) || IS_QLA2200(ha)) return -EPERM; - if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags)) { + if (qla2x00_chip_is_down(vha)) { ql_log(ql_log_warn, vha, 0x707a, "Abort ISP active -- ignoring beacon request.\n"); return -EBUSY; @@ -1350,7 +1371,7 @@ qla2x00_thermal_temp_show(struct device *dev, scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); uint16_t temp = 0; - if (qla2x00_reset_active(vha)) { + if (qla2x00_chip_is_down(vha)) { ql_log(ql_log_warn, vha, 0x70dc, "ISP reset active.\n"); goto done; } @@ -1381,7 +1402,7 @@ qla2x00_fw_state_show(struct device *dev, struct device_attribute *attr, return scnprintf(buf, PAGE_SIZE, "0x%x\n", pstate); } - if (qla2x00_reset_active(vha)) + if (qla2x00_chip_is_down(vha)) ql_log(ql_log_warn, vha, 0x707c, "ISP reset active.\n"); else if (!vha->hw->flags.eeh_busy) @@ -1840,7 +1861,7 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost) if (unlikely(pci_channel_offline(ha->pdev))) goto done; - if (qla2x00_reset_active(vha)) + if (qla2x00_chip_is_down(vha)) goto done; stats = dma_zalloc_coherent(&ha->pdev->dev, sizeof(*stats), diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index aea264100673..740403510779 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -7017,7 +7017,7 @@ uint8_t qla27xx_find_valid_image(struct scsi_qla_host *vha) ha->active_image = QLA27XX_SECONDARY_IMAGE; } - ql_dbg(ql_dbg_init, vha, 0x018f, "%s image\n", + ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x018f, "%s image\n", ha->active_image == 0 ? "default bootld and fw" : ha->active_image == 1 ? "primary" : ha->active_image == 2 ? "secondary" : diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h index bcbdf28bd7b9..acf6511e8ef7 100644 --- a/drivers/scsi/qla2xxx/qla_inline.h +++ b/drivers/scsi/qla2xxx/qla_inline.h @@ -202,6 +202,12 @@ qla2x00_reset_active(scsi_qla_host_t *vha) test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags); } +static inline int +qla2x00_chip_is_down(scsi_qla_host_t *vha) +{ + return (qla2x00_reset_active(vha) || !vha->hw->flags.fw_started); +} + static inline srb_t * qla2xxx_get_qpair_sp(struct qla_qpair *qpair, fc_port_t *fcport, gfp_t flag) { From patchwork Thu Aug 2 20:16:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10554183 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 47AAE157D for ; Thu, 2 Aug 2018 20:18:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93D1F2BFCB for ; Thu, 2 Aug 2018 20:18:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 855F32BF97; Thu, 2 Aug 2018 20:18:02 +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 1F1972BF97 for ; Thu, 2 Aug 2018 20:18:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729224AbeHBWKn (ORCPT ); Thu, 2 Aug 2018 18:10:43 -0400 Received: from mail-by2nam03on0078.outbound.protection.outlook.com ([104.47.42.78]:43967 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727111AbeHBWKn (ORCPT ); Thu, 2 Aug 2018 18:10:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vRRRrV6nQQ+T0x5iGi8ui+tamwxP6yomvdPrq7XDmbs=; b=A/DJ6WhKgFAHym6FYoH9bseLWkSi7gHjxMGD03Q3Dm6AjAWcmqKKGHMCMSCPiDVTpisfyEHBrir+WGyDX4ex5lFyw5SFFSnT8nNEM60nUR0wmKgFwqK4OVudhpw9CqKKLOJwnaHKa8+eqF40HvH5uYyeaATh5HCxnGQU42l8QB8= Received: from BYAPR07CA0016.namprd07.prod.outlook.com (2603:10b6:a02:bc::29) by MW2PR07MB4076.namprd07.prod.outlook.com (2603:10b6:907:7::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Thu, 2 Aug 2018 20:17:07 +0000 Received: from BY2NAM05FT024.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::201) by BYAPR07CA0016.outlook.office365.com (2603:10b6:a02:bc::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.15 via Frontend Transport; Thu, 2 Aug 2018 20:17:07 +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 BY2NAM05FT024.mail.protection.outlook.com (10.152.100.161) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Thu, 2 Aug 2018 20:17:07 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Thu, 2 Aug 2018 13:17:00 -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 w72KGxh4007962; Thu, 2 Aug 2018 13:16:59 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w72KGx60007961; Thu, 2 Aug 2018 13:16:59 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 06/16] qla2xxx: Silent erroneous message Date: Thu, 2 Aug 2018 13:16:48 -0700 Message-ID: <20180802201658.7903-7-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180802201658.7903-1-himanshu.madhani@cavium.com> References: <20180802201658.7903-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)(39860400002)(396003)(136003)(2980300002)(438002)(189003)(199004)(81156014)(4326008)(86362001)(446003)(11346002)(336012)(1076002)(26005)(15650500001)(51416003)(80596001)(186003)(76176011)(2906002)(87636003)(478600001)(8676002)(69596002)(81166006)(72206003)(305945005)(16586007)(8936002)(106466001)(2616005)(486006)(6666003)(356003)(48376002)(106002)(42186006)(14444005)(476003)(47776003)(126002)(50226002)(50466002)(110136005)(54906003)(44832011)(36756003)(316002)(5660300001);DIR:OUT;SFP:1101;SCL:1;SRVR:MW2PR07MB4076;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;BY2NAM05FT024;1:Qa+hYN23+ULM2Kxkom0AiIE/T0Pl+7ZRm0eiCs3vMKQALL4dh/mGxFBvCiPWXhXmbE/VnrPWpfpUHq8TT80XnGFNnhuELPbErcc33NlOxWreO7XXy63M4fJ8R4vuy98v X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 404ff4b6-f5c3-4c1d-0d80-08d5f8b4ebe5 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:MW2PR07MB4076; X-Microsoft-Exchange-Diagnostics: 1;MW2PR07MB4076;3:nXUcMLs9YAqnSsGU1TTeX0+BZAbQmkd1PZFx9a5QQZHCPNEItWdWKHCzDFyVtz0mU+p3fdCBZixisrrzvz5z6TvD91rIXt3imdAwjC/wVW+BjR8KJSaVxsSulA46vYnMlEucgUtdDBHzjwA0FTvZvxkDRzjFq6u+UzKyJFs6yqdYADp/L2CN2h0QAC4ANSCZfe8oEe2Op/u+CY4cGmJkYl+UdtOUplKnTe2kgVMGs5WQze5GYYpV4d6mJIlp+gWfJqIqhPeeTsVFGzHw0uJxAl62yILAAYO7v7zG4CBoatk187gGEg7hL2OQj3WD6+LeoazWX46ayKeu7KyZ+TkBJkcOdgA7Fk3csN8EK9JTN30=;25:78kuEj80KbNR61ZEAaZCKx66uJio4xOusatH1pDk+br4Z9kV4rA4P+eENMvA2JUdozOxBVtV16jQwhtrXUTcnfzEiguZ7Ozhmr5eaDv85N/x2KpzYqcGFIuEInv4cjERZBRBS2tjgSlRhSjtsiO5CPsRuseTXY/cAUqhvS8brKKd5kNzJk3xbcMmYqaHVDyoZO5RnvITFqjffb0OFo97y9dj08M3Zp+3gkWCaaX1fqAML+l1Ix5uO2XzHjP3zKL7KQPHD7wYXSyVFl7urrSo1HFTrb5gfpIyRyyftqkJCSmEnWSbLP2s6CtDhgG1M7d+IPBf7PWnWETssy3a2MFSng== X-MS-TrafficTypeDiagnostic: MW2PR07MB4076: X-Microsoft-Exchange-Diagnostics: 1;MW2PR07MB4076;31:AwHb2UDzKJEnEi0yd6c3DFApJdw6MdKwZ3MZKlGeDTKxaADe7IA7Lu0aLv7DXACQj0RmrTgtrejV0ZJKX3tw/s60N3Z15OBaByYjuysNpBBd+6IJJ3rD71pdas67+Rk3K71b5wzCinkAGOlUedY5f2jUTDPMFkqj9R1paEr4JFJCerI+tJb+VDxwh+PF/D8RfkG6t5PZsyzpfFL1VTtlppqx1VWbZ1t8TO8FTVrw1zg=;20:SL7kOcgrUHIFNkbhBvDCeaOkjzzjiuJOaD0wbiGTpuGVJEK94ue04lO5TFhVegNIn36A58LYTd94+7KHU3YWoDJL4K4VjNSjJbPBnUFARyZU48e3L4RJ/hQv0j2rWe50/pMveE2kW2LwBIj9XJNOTby765S5LiwvnjyrOuuj5g9hzOF30As+WOfGU+FU2GH+jiHfCXcHb8ZFtoEk7JqlB4x7mFRSXCNuVBhBB2e3YN6J3puh17II8iBh4/qdpfk12dRGYCpfHWS124DnQ5oNCypwEhzDM5oKBSkK7pFktN2bxQXpfG4NTAygOut58HA5pSxp3pFf/cgMevd/izw7/xyg2u2fBlnPrwSVqgUCzKPzOakamgLDm3mF+naanvpGm2FOmUt+bhT9Q1cKohjnLbLwBLGEd81TtsruTw6c+6RW01lwEXtFFSRWWK93UauiridyOuZ+n9/8zfbgWufxPQYUUNGnmbGL+bl1RiqbMYxDdR/17xuYBVmRVjdmP1tF X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(93006095)(93004095)(3002001)(10201501046)(149027)(150027)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:MW2PR07MB4076;BCL:0;PCL:0;RULEID:;SRVR:MW2PR07MB4076; X-Microsoft-Exchange-Diagnostics: 1;MW2PR07MB4076;4:20A6SH8e3WT/7e4kCYyGOFrlTiM/RBKO6SiO5aZ6R4K2tFCjhmZqNTREaNy5PhURB4wNuy9B1fywcoYgRuZuLXqjqamTAcEAjK1atrdwEDGkixh/bNZkQ7sszRL/oi7J1DR4v4KaSvRwi43YJIr2Vxedk4kCjZmUm6xSbe58nzfqUf459AbFKdNsRofK0iLyGCdd104IENJB+H46qoIKQbbwrcUQtaiTWk8tl9fBR1GEusSsNEm5gSQ1+vMv72XPrijvi6DibWUSXV/6ENj1Gw== X-Forefront-PRVS: 07521929C1 X-Microsoft-Exchange-Diagnostics: 1;MW2PR07MB4076;23:Uava2EpVHC80IiPPtcmsrY+NU2pU2XNQmr4pfVZ3SIkun0CPJYNnPrpx5oCg81n7bAs2+y7PxxagWWdimQuH8itaCUCUo+nvgZhOOLpkJsnIUEmwEKp4mhcrmpxepbgEO3wx/Sgh6KiXiboCvjmbbhBr7XE6rDZzrG150n354GJOKD6E1CyyHcPPsOXa/Jr90Fkm0AlbdphDvWkkGWI8f6o+Ec9RK3lQHp42WES2V+1L2X/nrDiAKrZjpXUCLdNJ1D5/bVoFTW+8+hsBR66ay0CNEwV36+fo7yLBvrMFDP2gInuJojP8ub4bkvX6hvL0tRUVptT5gm/pxf18oU6IT+W5U/itZUQd2aPYnOKxYWu7G8kvm7h8oTnE3FEaeE2ahkCWG5QP0HcX+5MjL+fbIjJsB0Z8Eom0SQPkdvUIpyhP9a01vALXRAjdWTGN6O4+SlbTe3yzpf8O3I28zVhkndBk4SYdJJgLKAkP8Ua8BxFo2PGKnMFwkGk2moBdT9EflgPFg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JCbN16ZiefSC8LqRAE3bcm3ZWS8KVX1UPUPyYAFEwQDDg55fEqQatAREhv5nFTEZn5PUu2IDSgZWWR3NZaak8Fc+SySi7//TewghDjLNjzIONasbdRHKljSPx87CR80so7MPuLcXmH6ldB1bk41N+NaEj5VZHlsGCkVwaAtsqjG47WgAKhVHcW429zqFn2F7hObsmRxmlXe6m3vCZOcd9nnsmqRuoJg0FZFg21WHZLepkqPFvgUFNQum0ith8ZcE7LzTqkj0o8cnsdtBK0SHA2Y/ELjB6AhZouYo4+2kdICHioGjbjdfK3kgMcNp8/mthi73UvDSVSHrDWv4l5Nv9iC8rLhSh0gq7eD5TXaB+sBFBLuErrEq0UkJ/G7fAP8nAdxCaKU1GYmqrKVN4LFt0/XQ747FvFcoRg3tJ1mWcLCAlI3IpTXGg68aIzkXoDmf6Zx1pVk2EhTQAg==;5:UlK7i/nE3ld2Rulehn3r9+nWUNQzmGXG7RpedcXmSfQVUWxHC1M50eEPNZ0Wcl7ozCRzo9mm5XHEJ+hpqst+q9pcVcc0s9ofkhGXGzaQ4o/h4smoa54m4FsWx4VL4FOpoMhXSFE/z6jFYm8OVKaouguyxfKLG1PRu+XZ4Vp/hHY=;7:qnWSYZafo1sJWtNRl/LPqUB/NuPkvXlweGcdCAcMoEa9aU5kmlHLiWSoNMstD3sluQo03JzRRadAeV9yPjVWbfZNMCV0tRhhtNRmv6t8VJ/FcDe/nPbptgDJBElV5h3lqhD9PsEoTgdUUPVFa8GA9mfdeHFn1brZqzx8qK8S6ADPvHnSMK4rBMe0WBg1tZ64nBBFJM0qYq+LJXr0+k8PE+OkM+tl16jjz0WVsz8xz12vjv23HKh72rODtOwkOUt4 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 20:17:07.6064 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 404ff4b6-f5c3-4c1d-0d80-08d5f8b4ebe5 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: MW2PR07MB4076 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 Thu Aug 2 20:16:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10554165 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 1D4BD157D for ; Thu, 2 Aug 2018 20:17:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 091F82C444 for ; Thu, 2 Aug 2018 20:17:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F106B2C459; Thu, 2 Aug 2018 20:17:14 +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 88D852C444 for ; Thu, 2 Aug 2018 20:17:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729367AbeHBWJy (ORCPT ); Thu, 2 Aug 2018 18:09:54 -0400 Received: from mail-eopbgr720059.outbound.protection.outlook.com ([40.107.72.59]:51279 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728140AbeHBWJy (ORCPT ); Thu, 2 Aug 2018 18:09:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M6OODpXqtv2vEHehIBdwkcXa4U+Mrsy4HythgOM3PKY=; b=WMM8wjLKgVohRDWShvulstHAqmE5LZPet4nVkbW2NTT0ZPQKHa6GzrOZ7wiFi2+ZWk9PvFqD3orJ4zZbiXaYPLGSI5p77CUkq5sm03e4QnVNOSg/fCmBZR4qEFTFebSRrsInbbbeaDwuOkqADEhO64/b+bz6oIIL5gymPC8sgfk= Received: from BYAPR07CA0016.namprd07.prod.outlook.com (2603:10b6:a02:bc::29) by DM2PR07MB1467.namprd07.prod.outlook.com (2a01:111:e400:50c3::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.20; Thu, 2 Aug 2018 20:17:08 +0000 Received: from BY2NAM05FT024.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::201) by BYAPR07CA0016.outlook.office365.com (2603:10b6:a02:bc::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.15 via Frontend Transport; Thu, 2 Aug 2018 20:17:08 +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 BY2NAM05FT024.mail.protection.outlook.com (10.152.100.161) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Thu, 2 Aug 2018 20:17:08 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Thu, 2 Aug 2018 13:17:00 -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 w72KGxpQ007966; Thu, 2 Aug 2018 13:16:59 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w72KGxcU007965; Thu, 2 Aug 2018 13:16:59 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 07/16] qla2xxx: Fix redundant fc_rport registration Date: Thu, 2 Aug 2018 13:16:49 -0700 Message-ID: <20180802201658.7903-8-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180802201658.7903-1-himanshu.madhani@cavium.com> References: <20180802201658.7903-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)(136003)(346002)(39860400002)(396003)(2980300002)(438002)(199004)(189003)(54906003)(48376002)(87636003)(316002)(42186006)(486006)(110136005)(16586007)(106002)(186003)(305945005)(4326008)(44832011)(86362001)(51416003)(336012)(126002)(36756003)(72206003)(478600001)(476003)(356003)(50466002)(2616005)(26005)(50226002)(8676002)(76176011)(14444005)(446003)(106466001)(81166006)(81156014)(5660300001)(6666003)(47776003)(2906002)(69596002)(8936002)(1076002)(80596001)(11346002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR07MB1467;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BY2NAM05FT024;1:4K75ISnSkvOdm5q5BddLeQ/Fj9GJtWgDriwJ/Ep825Yrye9isrc7KnE1BRk0JGly1YvzPkFBzyWZKfnGnCq+6zyrZ2NzL4SHbXASNDLghWHOXgcVt1+ckuEDsluy9vL1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 97810ac0-ab46-4c9d-a74f-08d5f8b4ec3f X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:DM2PR07MB1467; X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB1467;3:VvC6Ikj4KqOA466tf0vGgV/QKwN6adVRV+LQ5VyS787P38MMJLndgEPUxyA4sIOLM4i/Ty8oF68uXp4DZq6JSQEpvmW5iURaFiyF3UWvtEowV/QK3S0dYk+pdrhxYTKnSoL/NLt+oUAYReZ6zUNL2X7PefDhjLzXZsCWyJNb5wUON0e/dvDrTJAHr1Gj2dShc9qHQVt3uiHMUaSYsCzcamXri8stxIskSezbYhCj8IweiicgF0RLGl5+p7RCzhCLl/rhU++C6gDaDvMEArWZTjuhN+0SBc/SqNAf8ZnhWqgm/XCbYcIpWmJA9+qVYSJ+llDYR36viA9s3MleO9vw2rdktqaI9/zxEk6Uon4yYPo=;25:+yNNOVxRWAbXlenTKXtIUCFWsiQJxBwnoaAhPkQqUhVo0lgjnjlxu8REWCiEZJ/Uoq5XLmW+TY00IhapZeMzUF3RiwvrJxu4AnxfatFTFF7XvDaE1Gx1bhTdTXU68sRnCbqUPX8Mf7bycNGUycFiYULqCUih73NI4uXF3aRCh4Ieinb0g4h4GrDluxgXX4nHR2joeGfvwqBdEEKxKhYdBTb2sedonoH1S0MOzVQ68yUtqub9P8udx4lTrjPXpmp5R5G0+Lpa7ORHxrseJafIu2W+fRhqeEGiXBpIswqGBsFAsnSiDmHa9YA0SWuyzw3rygrb2r4PnHZLL635Y/iOWQ== X-MS-TrafficTypeDiagnostic: DM2PR07MB1467: X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB1467;31:Zx5/pRkCE46IO1J7qZSDjX2Uwb8sWG4Qo/nmSDdU0tEasK696rnPZjo2BxrhCXpPrHUBIJQoY5YOBh+aZ4a7tGG1YL0PKLG17icJbHxuRzfhaOwgKsL98y7YFbIZ+z399vWpg8TQ+FoSzAXe6cnUUBTR4BOcRUcM4fTlIDVvQrs6pxeeD7wRKGbap42pVds21vXTND6opiflzVDMzm01nEaz0FVXQrPgX7Tv9JVyuqU=;20:e3RPsMcH74hN6EILshxCP0SmYJxyo5OzcJ6bHTdRtKtk7ZEDdn23m6mQhISu7SEd4gjmvN74DJg8kV79mj05xbr9z7pcBRl9WbKOOw9HHQcJ9Jkv4ubfqZ53U/Kqr2oqk9JFd4C+ZwZnnaWCbqhRnq4KUkylNZ0ADDwXtxZzwhwGOg6T+YMZAxfdVk+calz/CtADGxc33ovyC1fUD5UgYg4UhGalk3YPOTvu8zwJDVao3HC/yApBA44ZfvvbBiiwE2cjndkwydfsrrMPki0hMq+HkgJFNbXhTwu5ZGV7lfDXkzi3tIPYnZUMBLa21g+0hIEXiz2KM0WbBhFWNMFdxIRYjaV9+nsJBk5/xEw/cWAzrzCemOrEP8G9RnIy4tWdzJIkTWUj5bHf5wuBvZS3hWTwxU31ZNhQra15GKDuMuI+j9P8+w5QCYEQMBAtTat/EdsoJloQxnUql6watKT2KmEngwOkWfddY+6M85SG8YQiHOAO+Z+AWonBteLZY/z4 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)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:DM2PR07MB1467;BCL:0;PCL:0;RULEID:;SRVR:DM2PR07MB1467; X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB1467;4:MLwx9zuH3iaY7WahC6dtx90YYpo9v8jtnctVtZfyiFaqq+0ZgmqGLHK0RTfMOX+HqBt0ovW59wEQgOYUr3vCndqE26GztP9o0gc9sLxbADrH3MZEzkDIVaaoYWlmYDfuT/w1V2CrMZ5xx9GS0BE/2Hs0Ty2ei054ceGlk2fFRfO9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FMGVDCEqHI0v7N6rTycWKf17G2Cir/Yl0JpTvaCTnWnU7L+M4eSA==;5:eEWh6qD58AgIcKn4ZE71tlF9+ggOousONBf26lZHjNPT3m4v+s5mbPwCTogOTX19ew9UG5pdB04hEb7BLIZPnuP5p3g4T5UvSJdQi3YWn+iNDka8LpDA6WVteLnzxuK9DyfDg3Mmd697YiM5kdFAKibNFmW2uOqSXZpklVj3rVQ=;7:UY+L54ABH8BCZ7GElg7Pqgoi3gtSTuKZ0Vr9lNh/kmOQ8Jeb9/k/txwrk2BZUY8yg7RLFEbfNWHPFPmJ7eltLF4t3/nay+4CpIByEDvCNmYdUDVWuBGTwe/UCCR8pKpIQaeX0USzLFkEJ2qHDqNjj2wwX6xw5ZzDSO/MUvOhzX7kYzCp943gmOpd+zGMWheHGSns65sRsP2OWQPjlGleCtH0YDKYEV8sSveqe82LuoD8FoTUtlhfhjhxmDmBrGbf SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 20:17:08.2158 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97810ac0-ab46-4c9d-a74f-08d5f8b4ec3f X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR07MB1467 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Quinn Tran Prevent multiple registration with transport layer for the same remote port. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 740403510779..df55fd4e1716 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -5002,6 +5002,9 @@ qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport) struct fc_rport *rport; unsigned long flags; + if (atomic_read(&fcport->state) == FCS_ONLINE) + return; + rport_ids.node_name = wwn_to_u64(fcport->node_name); rport_ids.port_name = wwn_to_u64(fcport->port_name); rport_ids.port_id = fcport->d_id.b.domain << 16 | @@ -5057,25 +5060,18 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) if (IS_SW_RESV_ADDR(fcport->d_id)) return; - ql_dbg(ql_dbg_disc, vha, 0x20ef, "%s %8phC\n", - __func__, fcport->port_name); - - if (IS_QLAFX00(vha->hw)) { - qla2x00_set_fcport_state(fcport, FCS_ONLINE); - } else { - fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT); - fcport->disc_state = DSC_LOGIN_COMPLETE; - fcport->deleted = 0; - fcport->logout_on_delete = 1; - fcport->login_retry = vha->hw->login_retry_count; - qla2x00_set_fcport_state(fcport, FCS_ONLINE); - } + fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT); + fcport->disc_state = DSC_LOGIN_COMPLETE; + fcport->deleted = 0; + fcport->logout_on_delete = 1; + fcport->login_retry = vha->hw->login_retry_count; - qla2x00_set_fcport_state(fcport, FCS_ONLINE); qla2x00_iidma_fcport(vha, fcport); if (fcport->fc4f_nvme) { qla_nvme_register_remote(vha, fcport); + fcport->disc_state = DSC_LOGIN_COMPLETE; + qla2x00_set_fcport_state(fcport, FCS_ONLINE); return; } @@ -5116,6 +5112,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 Thu Aug 2 20:16:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10554161 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 D4CC4157D for ; Thu, 2 Aug 2018 20:17:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0EF62C444 for ; Thu, 2 Aug 2018 20:17:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4F4E2C459; Thu, 2 Aug 2018 20:17:13 +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 513872C444 for ; Thu, 2 Aug 2018 20:17:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729224AbeHBWJy (ORCPT ); Thu, 2 Aug 2018 18:09:54 -0400 Received: from mail-sn1nam01on0076.outbound.protection.outlook.com ([104.47.32.76]:39648 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727302AbeHBWJx (ORCPT ); Thu, 2 Aug 2018 18:09:53 -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=A/NVIU1D1V53iy7AKQm/v26tI8xMJqS1tlYlNtCLTpk=; b=CxtIoqt3wMc3h6Z+wkuOhebcUi9llkUanw+tqXcoVSQrnkYF/Be/uOBgKtsBSGhmTfH/NDAfI7/mWJ7jYBsQIhoWW4mMGfRd/1bceuGzGYoECvKMy0stuK3blbOIVUqkS37cBzTtwDsx4ZEAfKeCLPddm/sSr7Ctv7RfBUx1LbI= Received: from BYAPR07CA0035.namprd07.prod.outlook.com (2603:10b6:a02:bc::48) by MW2PR07MB4075.namprd07.prod.outlook.com (2603:10b6:907:7::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Thu, 2 Aug 2018 20:17:10 +0000 Received: from BY2NAM05FT024.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::209) by BYAPR07CA0035.outlook.office365.com (2603:10b6:a02:bc::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.15 via Frontend Transport; Thu, 2 Aug 2018 20:17:09 +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 BY2NAM05FT024.mail.protection.outlook.com (10.152.100.161) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Thu, 2 Aug 2018 20:17:09 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Thu, 2 Aug 2018 13:17:00 -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 w72KH011007970; Thu, 2 Aug 2018 13:17:00 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w72KH0u1007969; Thu, 2 Aug 2018 13:17:00 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 08/16] qla2xxx: Fix session state stuck in Get Port DB Date: Thu, 2 Aug 2018 13:16:50 -0700 Message-ID: <20180802201658.7903-9-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180802201658.7903-1-himanshu.madhani@cavium.com> References: <20180802201658.7903-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(376002)(346002)(396003)(39860400002)(2980300002)(438002)(199004)(189003)(316002)(5660300001)(50466002)(69596002)(110136005)(54906003)(81156014)(486006)(48376002)(81166006)(305945005)(2906002)(8676002)(106002)(80596001)(76176011)(51416003)(126002)(1076002)(2616005)(186003)(44832011)(16586007)(8936002)(476003)(26005)(356003)(42186006)(446003)(336012)(11346002)(14444005)(50226002)(4326008)(72206003)(36756003)(86362001)(87636003)(478600001)(47776003)(6666003)(106466001);DIR:OUT;SFP:1101;SCL:1;SRVR:MW2PR07MB4075;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BY2NAM05FT024;1:vgpRr/ZAii1Fep/MyM6FED9+gF4XpjaVnkeRQLnSZoy6dfFkVifkES4n6uuuadoOPRAPcM0Y9UQgrZSShLPnei4d97QPfaFUMvknhqpXMp2uXycTsZbBt97SvvfIfKtb X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 430e9674-9c9b-4505-7751-08d5f8b4ed11 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:MW2PR07MB4075; X-Microsoft-Exchange-Diagnostics: 1;MW2PR07MB4075;3:HG5pVd+SXsNYLXVYduQJMwCEomiwtMFBIDEqbGwGhhjFvZq65TTPYgILhFqMowpj5D/il/iqv4Vq5yzskpmTf7QsbHPWjB5yxUQigNKoCvpwOjAkicJr53NWw3bjFQXJE08aehzhKsKEplVkoM34NeKROuHHnCiY1ghzYeV2LU1lmi4wP6aDuT03OoyZ+yPQLDUDnIgJizoaTDunsSaB1r5y6YejVudFU1J4Eq+l4BLlb1yYn+NkrwRWHaRSBhN/u5Gc2rXzKvxE8ONP298bi2ELvq0c1kwXlUeWZFhHGzruatO1roeEAn/NaAKA+H3Iy02qs83SJzEmAzdMJP19Q6lMShOqwa51mPHeeBst/5E=;25:zp3YD6bgvFd9ZmLf5m78j2skH6PIo8yacol5nAoB1Oy7sCGUmfjqFcoJgRrsmRNN9WMmSsYuTZTrAbTZKyUf6SKujSa0sU2D9QpbOcCdzPO/hLa4OuIh62IuaD7OlDQoilRQfJzfhfIy6Y103rRHILXMlcBzOSjPpdkNau3aUZRkfP3saFeXPcJC2oWSjnmXBEAXgZrZNc/0cD/CtDfFpxn1lsg04aowV3jsFlXOG9IOwdHXtbtxzPcFxxwJBfOreVW4m0lueeSOaRUxuI8o1O6iXN7D5KFEFIb3RRvzcBgLgAPDeccDkbjbgid/nJm7mb9u4CwCB6glwafmUnYj1A== X-MS-TrafficTypeDiagnostic: MW2PR07MB4075: X-Microsoft-Exchange-Diagnostics: 1;MW2PR07MB4075;31:5Ay8iY37AbAzHvNgQd75aGn9A5jST/junV//JQsQ375lutxqhJDqJ1xaeYOYBN2oySkLpLYf+p5fXdeosKcaKCiSqGo9K4nT0Gyvvpzv7kQd03JhVUWdy8BLZ/3nl3YXJZc31uE6qcQYf2T6RIssimpyjGGy+d0qLM7xZt4npEFT+JPNGlYis2Wbb4QpFWvMGv2wCnAQmTKlyefnq5zn3FosT/BMcnJlPabrIWJO0pE=;20:rAsywr3YnoYcg3m/3nbDBr4SNrHbpcrCRSDBF2/60O/xM/cHHHQGmRKQ5xPMumvlYn1q8LV4DB+wRArwMMz0JoOeJufxaU3Pw5HcTexl7qeWmLJaMjJCMo4bQR5nS8roL/GiIlrOyD2DenkENbt9lunx+VTapp1/74iev00LjSIJEIXA4tUFTpDi5pdejg+OpCFBtEhAvgIqr2b/9EN4cEvrKuGjqNeTzrndDVFEprOClbx+EHS4Jmhe1Csy6tDm7qPZTmELCCBnnn+LiCKEXYHZQevQbr6X672XAMSFHN5MszdUfUi/amjLbdyNN09zndoV2qPE4HkitFUyEfhoHsMDI0ydKjDYeg2Ca32WpZDiMFD2nrER8en0EF3jIeLLRrb/63uatWl7PnxkbTBRTRE7waeCooZEvtsSaK86WURyltjQpW2qFIzKjEBXmwtvgf1m8GOcutafjoLjFSvax0lFYOWDBlv0+0eiF0dbA407YOIWcZQjJ33rZZM6Y2/Z X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93004095)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:MW2PR07MB4075;BCL:0;PCL:0;RULEID:;SRVR:MW2PR07MB4075; X-Microsoft-Exchange-Diagnostics: 1;MW2PR07MB4075;4:3l66iIeMmoRlv+FgRRL38eYl7UyeVO8oja2VbLaFF1cyIs1G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ti8f06G0pHqeXQecFa7gfXi6zSPahfrvO5Lg/HZfkJJpY7/mCg5TvjpXyT1Ho/8/hdYj/KUEPuN/ar1hRrH5zCKiKKhzjt4JShWr7ObrChd66rgShyWpg6GZ2sHABFIwXvnCE7tr+yDVmV0Mv2qS7+zZHmpXw1JnRufLae0PQHgwLRrtjsg4tmp4FmoDs7Q==;5:doIfbJWzR9mbXatbPXtIt8wI674Qqa66G6gC8mmhvy6uZxlS8mJG8VeeLdFrEH9aOhiVqH8SyNBWKQdnH9zN0S9X+4bsBtu69yyxugCr1Ciye+UyB55NkKDY4hQpaCAaBXThhU2pSvHZNyOakCzFPSByLl4q+QmO6td17sZSAEQ=;7:+D2VKpPd3xSnbJvWEwm22oor5POxv0BBJV1/D1AKHcmDEETzPjvUQGE5tn4bbBxtV5vf9Jlb7r37IC2ISHTodOm2c90gFxPi7BPTYaxigFU9LIBijPOUh8XTKv7ztsyxqGc48KMWEPyWTNb8q6lBLOioflM71aYxSIg0HvE8DG2B2RlFeSpKXUg05V7Xdu+xmbsyLCI2Mt4DTnzlI9WJ8dijl4x9osRzEcHYerq2MQLRH2Qr7fG/eGi6eMfi/Sqb SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 20:17:09.5752 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 430e9674-9c9b-4505-7751-08d5f8b4ed11 X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR07MB4075 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Quinn Tran This patch 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 df55fd4e1716..bb565f556c2f 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1153,9 +1153,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 Thu Aug 2 20:16:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10554163 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 9EDC69093 for ; Thu, 2 Aug 2018 20:17:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B2C82C451 for ; Thu, 2 Aug 2018 20:17:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F78E2C459; Thu, 2 Aug 2018 20:17:14 +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 02C262C444 for ; Thu, 2 Aug 2018 20:17:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729409AbeHBWJy (ORCPT ); Thu, 2 Aug 2018 18:09:54 -0400 Received: from mail-sn1nam01on0076.outbound.protection.outlook.com ([104.47.32.76]:10240 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729034AbeHBWJy (ORCPT ); Thu, 2 Aug 2018 18:09:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=q73mBtb4qToxfLr5ySc/J7IffPzGE/ckaZ8yytORsao=; b=mxsTFHC6R7jSDkGk3tojswoG9CeLCc1yINUxuOU7U762bCFb9EkfsJrQJAloHyKaWKWVX9erAC+CX9K9PR4CBC22OrYAsFzQZLfIbpElBDzRj/v15wiUH5giXIpElqFH3Z8k3ql6xlkVYKR/LROUZxmzfeUYnKM6RX8+r8N+RIA= Received: from DM5PR07CA0089.namprd07.prod.outlook.com (2603:10b6:4:ae::18) by BN3PR0701MB1378.namprd07.prod.outlook.com (2a01:111:e400:4018::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Thu, 2 Aug 2018 20:17:11 +0000 Received: from BY2NAM05FT006.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::206) by DM5PR07CA0089.outlook.office365.com (2603:10b6:4:ae::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.14 via Frontend Transport; Thu, 2 Aug 2018 20:17:10 +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 BY2NAM05FT006.mail.protection.outlook.com (10.152.100.143) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Thu, 2 Aug 2018 20:17:10 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Thu, 2 Aug 2018 13:17:01 -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 w72KH0rd007974; Thu, 2 Aug 2018 13:17:00 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w72KH0G4007973; Thu, 2 Aug 2018 13:17:00 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 09/16] qla2xxx: Fix unintended Logout Date: Thu, 2 Aug 2018 13:16:51 -0700 Message-ID: <20180802201658.7903-10-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180802201658.7903-1-himanshu.madhani@cavium.com> References: <20180802201658.7903-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)(396003)(136003)(2980300002)(438002)(199004)(189003)(356003)(81156014)(81166006)(8676002)(6666003)(47776003)(2906002)(4326008)(5660300001)(478600001)(87636003)(1076002)(106466001)(186003)(72206003)(86362001)(316002)(44832011)(126002)(476003)(446003)(486006)(2616005)(50226002)(69596002)(80596001)(11346002)(305945005)(8936002)(106002)(14444005)(51416003)(110136005)(50466002)(36756003)(48376002)(336012)(42186006)(26005)(54906003)(16586007)(76176011);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR0701MB1378;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BY2NAM05FT006;1:wouYq1oqbuk4GEBFeFbhEfy9kkIGOur0yGbRus+H6Y3GmCatOcWPwwXR3k8dSaYuiKJ0dfAsQx2zzeftx1gl6Np96gjciiIbflQQqvdln5+aB7whhr4vCKyZF7diH8vS X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4441658a-c503-4ba7-1243-08d5f8b4edaa X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BN3PR0701MB1378; X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;3:y5XYY26O5I5H/r03cCuAYsntN1f7QNfQQN6E7DIqYtGbZI5LlUFNcnmseipkhU3wXCWWmvcyImM6sa7JDe3gC3EE3kvjjoPOT6fvwJu4FKwKkJjzx1OpbO8RgAegOMvuDKXjKomV7qUYobveiZVDas+M2OKjwxCAXq+QXU52c9/1IU23FoATuLMdcMf6CkhKZHsK9eLUGhglJ2U90d4bETLvIgT5ciLULCD980PkxwCrM8zfTvVGFOgunaVeOFulw1dkgOR5J/mCWJfuqilqdFx4yxlprDKNJ0JjpOBpvgE2dzMb5g5lORET2gKfQjQzyLW1oZNsb0wlOeaSgDoKHwWiXq1E6aC5NL2pI7Zmu9Q=;25:TkqgdcgcfJReb7imnez6Uinyg58nlz+hdXDYPMvwzRGOF4JsnamnyqxKt79zIs0Z4hh2A7J25IQYWOv0wonrycqG24F7jordIENM5e9UwkNrXjB4jG+rN2k1dJryzmNpq5X9D7I8wg0sUobcVWw587JcguaGdyqxdhdhUCMhTKc1xXlfSwQbQcNEIlWe/pdg8sPQzY252YxUKxYtb2C046vi3E2kuvB4Dhsp54FeqlJHgAHLLGtlI8DDRB8EPrRTDcgTI7vTjLbltlcMfZ92yJIM+oUlk0AeHVRMxn9FZJ2eFbW2AIDAHfVwt2hBPrhPpvnZDruVD2AHNYWaW3iFZQ== X-MS-TrafficTypeDiagnostic: BN3PR0701MB1378: X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;31:TomexGifegeUqpGDLuVhtgmrzRBV9uDcnOQBR+14zqgxW/nYz9niBat4Ed8RELJ/PilNITtvfTtTwIARdCFYYiBLitkVqJgWTkQXE4iNbhrKe5FI+u18FA7K8iUnJxRyjvKAvGWLu0//8vOI0MZeABs1lnw0+fuwle5lLs4UL7w0WnCclrXgrAcKc+rSWW6ppBa0jZebOVxrhVTQ27pS/MD+ODuDD104ppC4rh2M8EE=;20:mW9mplycaGdte3ug1DhUtcsUFZ4gkKDlExwLkHQAV1RABHFytw+B4twmPuxUjGvXdAhAgniod2UQNZ84vQZJ99Yt3akRbJTkZc/hXNBkxqa7roeJCD2n//SWus2g+On17lwUJ68BOjhGTmLWr/iuwMvYhwl7gaJ9B9HzbJrlMml4RNT7MihHBSEVfeinTUWhrNSs1McWdhiPTMIs5lanJPU4uaBrdwEZuzK1onEBzTPe+vxTKUYIpNXH6LizDId5O9eQcLQgjf5IzFgkmb9UBLxL5zfagQgIZos+e9fhDeovqCGr3gR0NMRfsgbdVGhixaCVWeR6ShdQssOhsYo/YOajpR3ErmzwkLyHw8MO1rLu1jWJqyRFfqOvO5N6Ec/I9XB5iEOnYyUarldt9kkzIRjJoXfneWOy4X3nC3CrkxdpUZG6Gnr6Qe2/7bQjwJWGnO5BrXgVM0kNR1CenMwT/zHVSLpBcwvn9/v8cNHD7nNLE06kBJ9Pf1yJGsTbL2ku 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)(3002001)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:BN3PR0701MB1378;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1378; X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;4:thnNMgvqYdCeK1kVKl9CwDpST3mgW9QxL63iQN474udjypBN1QT8IHHjrqMEDRbnuZm7dlkK19pYlEhW0yOCUW3EkDI4c4GUa6XwXyINZtGe7y77QiGCwvNeLBlMWNwcR7zJlD2lsJAMbfKKHV83dza/1GXiOJnlS55dhYB/W1paStMw1k02uy2kKP2/7gT7b5BNSSUclcxQJAORWLn7UG+cYS3njg576O8FRH86jZC4W9ya34lUItRb7tqQGAg7IMpJqBEH428PEoT480PFBw== X-Forefront-PRVS: 07521929C1 X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;23:hLeAfmwClWAw596fHanOyww8Ytyf6aIGCHJ2qAc0nh9zsmMHjn/QMgRgD0O/Z22lM+IujeEYakI/tW6Qss6x956wMJbdXiimEXyHJqVijM6Cc5UEnVrCwD8EiL8tVHX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mkRpqxPwKfggSYZ1f3FjOhKlqq0F5hit2XNDqNqeRecCdfpl/UEXH+Pl556MePVc16dyM07rzlw+U/1hss6aG8zWo6PTbCmJ6VFJ/I0pt15uQxH2KOYh6CNmW6jKSVcZoy5TwM4d5RSH8DHXTc2aARvJHPzkcrJcrJlhvWWkRzct95Op5FUU89d8MkPvebJCpOXSZTZEx4xOX1Ch SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 20:17:10.5909 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4441658a-c503-4ba7-1243-08d5f8b4edaa X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1378 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Quinn Tran During normal IO, FW can return IO with 'port unavailble' status. Driver would send a LOGO to remote port for session resync. On an off chance, a PLOGI could arrive before sending the LOGO. This patch will skip sendiing LOGO, if a PLOGI just came in. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_target.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 4f9c315813df..f9036004f179 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -986,8 +986,9 @@ void qlt_free_session_done(struct work_struct *work) logo.id = sess->d_id; logo.cmd_count = 0; + if (!own) + qlt_send_first_logo(vha, &logo); sess->send_els_logo = 0; - qlt_send_first_logo(vha, &logo); } if (sess->logout_on_delete && sess->loop_id != FC_NO_LOOP_ID) { From patchwork Thu Aug 2 20:16:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10554167 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 0143C157D for ; Thu, 2 Aug 2018 20:17:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEECC2C444 for ; Thu, 2 Aug 2018 20:17:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D25ED2C459; Thu, 2 Aug 2018 20:17:18 +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 10C432C444 for ; Thu, 2 Aug 2018 20:17:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729764AbeHBWJ7 (ORCPT ); Thu, 2 Aug 2018 18:09:59 -0400 Received: from mail-eopbgr690077.outbound.protection.outlook.com ([40.107.69.77]:41683 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729623AbeHBWJ6 (ORCPT ); Thu, 2 Aug 2018 18:09:58 -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=mqRjNawpNh9pCMpeKaa1mf27P3jWoY+0xwXY+/REJr8=; b=dkc5j4MwB7q1CGm00lxLf6Z12RRjqDPei4uVrTy+QN0bARLR+aXxY8ocm8bj/CNRrral0iEv45KGD8nrM8Y79avKLqL/vAD7bCvc5pAN8bFsuayHIdstkrafHQStbFZm86EkCSph7YGZjMfvDdCYkgqlq+cHcObC2mFQC2qtBFc= Received: from BYAPR07CA0024.namprd07.prod.outlook.com (2603:10b6:a02:bc::37) by BN3PR0701MB1377.namprd07.prod.outlook.com (2a01:111:e400:4018::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Thu, 2 Aug 2018 20:17:11 +0000 Received: from BY2NAM05FT024.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::207) by BYAPR07CA0024.outlook.office365.com (2603:10b6:a02:bc::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.15 via Frontend Transport; Thu, 2 Aug 2018 20:17:11 +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 BY2NAM05FT024.mail.protection.outlook.com (10.152.100.161) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Thu, 2 Aug 2018 20:17:11 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Thu, 2 Aug 2018 13:17:01 -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 w72KH0hF007978; Thu, 2 Aug 2018 13:17:00 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w72KH0pn007977; Thu, 2 Aug 2018 13:17:00 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 10/16] qla2xxx: Flush mailbox commands on chip reset Date: Thu, 2 Aug 2018 13:16:52 -0700 Message-ID: <20180802201658.7903-11-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180802201658.7903-1-himanshu.madhani@cavium.com> References: <20180802201658.7903-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)(39860400002)(396003)(136003)(2980300002)(438002)(189003)(199004)(80596001)(336012)(8676002)(4326008)(446003)(86362001)(575784001)(51416003)(76176011)(72206003)(1076002)(8936002)(16586007)(316002)(6666003)(42186006)(186003)(48376002)(110136005)(54906003)(356003)(69596002)(305945005)(50466002)(2906002)(87636003)(478600001)(106002)(26005)(5660300001)(106466001)(14444005)(50226002)(476003)(47776003)(126002)(11346002)(2616005)(81166006)(44832011)(15650500001)(36756003)(81156014)(486006);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR0701MB1377;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;BY2NAM05FT024;1:NdsPGmW5pSeN7jal0xYPzPIPbDuDGvU2ZMnUr228FKKA+u7MPJrjNggwkSZ3UdImugv6y79YUcwr9LvwiaCq0bPYe21SY+C47Eno7LeGvPpaHrrvIMSXq4YzdqUeNxpz X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ae7f22ae-a4a6-446f-f7e6-08d5f8b4edf3 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:BN3PR0701MB1377; X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1377;3:0XShaWnecKKxK7Q0DyU28HOSaByOZjQpWW3zzRCjF0h+Wy9xXv4dVkWrQYaKoTX1VN4nq5llb/4tVS1FppZDB6K93Rl0JD2MF3dP/IWBKnfHBpcuOdrjMj4RXBOAL5r1cga0WPJHIy6HwMPuQms16DwOlrs8cooj9HipPNT29ra8txb8IOVx0vKFaU3Xc0JMJ/MFAxs1Tm3jX/+Z49lIXoTywtT4XvTFG4D6bPGhaBoJnIniFEV7Iw50IptathsvzO0hRnTmbDR4h0/vtXL110DQMf0xAjeE+uvGHCI20SidZSks/dS9aA/T3/5tnv/6NyJJalR1qMKuRkYmq1DZlSE+xbim1pSvoBfbjflMOTU=;25:AgY/U99INm016cvuV+mUxLIIPfF1nvXYHQysSdRJTb0w/vvR/wsp0NMUWlsEwTGzH718h2NN0YYMLikqhSjt/CBaD4vcUZ3APyGs7sIxF/ZgQD9CRUx4L4SuibufPRaV9yw9xPdA0viikA97pyDX7P4gcT1v3E9K3kUck9NjQx0TWO7xBJwex1fEAIK/axale5W1vf0Q2AS6AoT932T1rXTc8eNz1W6cByaxSLjUq3iK2uWFqcc7i5SUiHD8NzbeKxCn8ZHxCQbtJUcQgyre0+7YM/iPkSP1X8bU+PBRDZoZ86bI1/NKp/7gpYwwDzemT7ylKl8uKNjrhpL70zOVSg== X-MS-TrafficTypeDiagnostic: BN3PR0701MB1377: X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1377;31:YK8oQgrr/v1J+7Kb+zSNdMlxxXxv3FqrgX601Ta7z6qirdMNCrBKrNYPrYX12s5vppRWFlPYKzdrHlBcGgnc7geBBK8p+BFN9n7dCtuqiYBnUazxuvkj6axn9OONPw/Mqa/LfRdpbF6hILjG0Xmg2yyZhJa58xaxco1hzK/AygMweYI3KtGrd9TSlnqWL7d3i1CKSyvBk4OozbGmqa1U4Wa2d2Fh6zTrft90wEgJjf0=;20:UjIVkXBErb4FGQZ9IfK6NxyQ+6oovrSQ70WkywR3bX0sHhkQQU3wd/VECXlJTVuKSqLKcO1wl+Wc12hacd059oWlB9i+dW7JVghPXZxjj6gt6AN4rVXiAURvAa+XZpw32+nJMr3ernrL7z6G3eGQOS7TF/HVm8kkKai3KdhVtTEioFOTIxw9X4eOODScL1ro+LrqyvyNoCV0tUWIqJOc6m5+EakkIeIVOp7v68+O//0i/4anwLjNP0Iu7+r6Ykk3u2we9RXOAgX3YfnlPoFJkOO0N2lyDmQJmy0gkOSomOPDBXZ3b3xEwpjyYMsbLM0sdNklmQeY5/bq596WvhLqVGmu8USmnvpYxaacDfNwqXFRVCM0zfjZfogmLuYoy3DS0ftjLClAiYCjBAVSp1GJeWdhyPjX/YIbnGJm4LANDwJwjxCyoiXzAVOIprU27+u1UixikXtjxM7GhlWVy/NtYdq+C7+U8nedtpzie5XsrmesExZsiyvOZCq77Zxod5TG 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)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:BN3PR0701MB1377;BCL:0;PCL:0;RULEID:;SRVR:B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vlGt1EHZaI2VyUIJfzDsSud4Ha1FgPnONKQG2QUPMzfiNcxAFYcSCI9+8F/R6Xd2JmbuM21UV0z0ICSS1FBjNGQ0OSh1yODO6jm2dX9Ucy2uigp96hGmAQM1Jy2Bmx7K0uF4pnbusktJpn7DwM9exLWu3TPI6mppEgU1iTUrqRPyLXDfg6zzf5rwhR6967XyiTCyrd2/ryJIeSxl5OHNuYmPd8MRfAAcYrYA1oQX+FETLbD7AfESdUbyEBW3VNXqNP9XX1OeA09q626HqAAHQPjN5+4AQfh8BKhGcSkh0HVGpP8UWb5dgIooCNvoZWamAvOA==;5:ALdjQnekU76FGeitTMBnLv7hvTNrtGSsbkNXxsjPESLiTW3XRSfc3J/GxYfc7j7t+N7Z2nxaKRr5Zj4NAw8uN9eppRTunIcpCQY+NG4RUDPLUi+nqltu8ZVt+D+yGIkFVk+1jUdCZsIk8tQwoPLfNZLy8u9FPzzf87J/GkJ7AqU=;7:B0laWLN0LEXqEpP7ixsLAWF7b7f0m053L2nLMNkwU9pqQQumuroJBN3bT0NLEXvEzg8Hluf7h+LzOw8jgiYS6n4pyfgow9CEJmsEEeU/fDr9ZzLCZ9pMFvZvykqNW8a1l29yPvpMtDUzUx750OIpXVLr1ohRsuUBb8KT+chP3gkwnoBhGhGSxU+70JNB76EAZbvesgUzWook0ciIEfq4wKaqk3bQBVvT5lQKdtClH5++DQwytdkJL5QkEXgyjtOj SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 20:17:11.0752 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ae7f22ae-a4a6-446f-f7e6-08d5f8b4edf3 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: BN3PR0701MB1377 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Quinn Tran Flush pending mailbox commands on chip reset. Wake up command that's waiting for an interrupt and wait for mailbox counters to go to zero. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 5 +++++ drivers/scsi/qla2xxx/qla_init.c | 21 ++++++++++++++++- drivers/scsi/qla2xxx/qla_mbx.c | 50 +++++++++++++++++++++++++++++++++++++---- drivers/scsi/qla2xxx/qla_os.c | 3 +++ 4 files changed, 74 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index ee4d1f4fdf95..40bcf938cf4f 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -3598,6 +3598,7 @@ struct qla_hw_data { uint32_t detected_lr_sfp:1; uint32_t using_lr_setting:1; uint32_t rida_fmt2:1; + uint32_t purge_mbox:1; } flags; uint16_t max_exchg; @@ -3843,6 +3844,9 @@ struct qla_hw_data { int port_down_retry_count; uint8_t mbx_count; uint8_t aen_mbx_count; + atomic_t num_pend_mbx_stage1; + atomic_t num_pend_mbx_stage2; + atomic_t num_pend_mbx_stage3; uint32_t login_retry_count; /* SNS command interfaces. */ @@ -4156,6 +4160,7 @@ struct qla_hw_data { struct work_struct board_disable; struct mr_data_fx00 mr; + uint32_t chip_reset; struct qlt_hw_data tgt; int allow_cna_fw_dump; diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index bb565f556c2f..a10a8bb895e9 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -6283,6 +6283,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. @@ -6297,13 +6298,31 @@ qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha) ha->current_topology = 0; ha->flags.fw_started = 0; ha->flags.fw_init_done = 0; - ha->base_qpair->chip_reset++; + ha->chip_reset++; + ha->base_qpair->chip_reset = ha->chip_reset; for (i = 0; i < ha->max_qpairs; i++) { if (ha->queue_pair_map[i]) ha->queue_pair_map[i]->chip_reset = ha->base_qpair->chip_reset; } + /* purge MBox commands */ + if (atomic_read(&ha->num_pend_mbx_stage3)) { + clear_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags); + complete(&ha->mbx_intr_comp); + } + + i = 0; + while (atomic_read(&ha->num_pend_mbx_stage3) || + atomic_read(&ha->num_pend_mbx_stage2) || + atomic_read(&ha->num_pend_mbx_stage1)) { + msleep(20); + i++; + if (i > 50) + break; + } + ha->flags.purge_mbox = 0; + atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); if (atomic_read(&vha->loop_state) != LOOP_DOWN) { atomic_set(&vha->loop_state, LOOP_DOWN); diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 17537f0b3b54..10847cdca093 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -110,6 +110,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) unsigned long wait_time; struct qla_hw_data *ha = vha->hw; scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev); + u32 chip_reset; ql_dbg(ql_dbg_mbx, vha, 0x1000, "Entered %s.\n", __func__); @@ -140,7 +141,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) rval = QLA_SUCCESS; abort_active = test_bit(ABORT_ISP_ACTIVE, &base_vha->dpc_flags); - + chip_reset = ha->chip_reset; if (ha->flags.pci_channel_io_perm_failure) { ql_log(ql_log_warn, vha, 0x1003, @@ -167,6 +168,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) return QLA_FUNCTION_TIMEOUT; } + atomic_inc(&ha->num_pend_mbx_stage1); /* * Wait for active mailbox commands to finish by waiting at most tov * seconds. This is to serialize actual issuing of mailbox cmds during @@ -177,8 +179,14 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) ql_log(ql_log_warn, vha, 0xd035, "Cmd access timeout, cmd=0x%x, Exiting.\n", mcp->mb[0]); + atomic_dec(&ha->num_pend_mbx_stage1); return QLA_FUNCTION_TIMEOUT; } + atomic_dec(&ha->num_pend_mbx_stage1); + if (ha->flags.purge_mbox || chip_reset != ha->chip_reset) { + rval = QLA_ABORTED; + goto premature_exit; + } ha->flags.mbox_busy = 1; /* Save mailbox command for debug */ @@ -189,6 +197,13 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) spin_lock_irqsave(&ha->hardware_lock, flags); + if (ha->flags.purge_mbox || chip_reset != ha->chip_reset) { + rval = QLA_ABORTED; + ha->flags.mbox_busy = 0; + spin_unlock_irqrestore(&ha->hardware_lock, flags); + goto premature_exit; + } + /* Load mailbox registers. */ if (IS_P3P_TYPE(ha)) optr = (uint16_t __iomem *)®->isp82.mailbox_in[0]; @@ -231,7 +246,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) "jiffies=%lx.\n", jiffies); /* Wait for mbx cmd completion until timeout */ - + atomic_inc(&ha->num_pend_mbx_stage2); if ((!abort_active && io_lock_on) || IS_NOPOLLING_TYPE(ha)) { set_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags); @@ -241,6 +256,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) spin_unlock_irqrestore(&ha->hardware_lock, flags); ha->flags.mbox_busy = 0; + atomic_dec(&ha->num_pend_mbx_stage2); ql_dbg(ql_dbg_mbx, vha, 0x1010, "Pending mailbox timeout, exiting.\n"); rval = QLA_FUNCTION_TIMEOUT; @@ -254,6 +270,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) spin_unlock_irqrestore(&ha->hardware_lock, flags); wait_time = jiffies; + atomic_inc(&ha->num_pend_mbx_stage3); if (!wait_for_completion_timeout(&ha->mbx_intr_comp, mcp->tov * HZ)) { ql_dbg(ql_dbg_mbx, vha, 0x117a, @@ -261,7 +278,17 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) spin_lock_irqsave(&ha->hardware_lock, flags); clear_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags); spin_unlock_irqrestore(&ha->hardware_lock, flags); + + } else if (ha->flags.purge_mbox || + chip_reset != ha->chip_reset) { + ha->flags.mbox_busy = 0; + atomic_dec(&ha->num_pend_mbx_stage2); + atomic_dec(&ha->num_pend_mbx_stage3); + rval = QLA_ABORTED; + goto premature_exit; } + atomic_dec(&ha->num_pend_mbx_stage3); + if (time_after(jiffies, wait_time + 5 * HZ)) ql_log(ql_log_warn, vha, 0x1015, "cmd=0x%x, waited %d msecs\n", command, jiffies_to_msecs(jiffies - wait_time)); @@ -275,6 +302,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) spin_unlock_irqrestore(&ha->hardware_lock, flags); ha->flags.mbox_busy = 0; + atomic_dec(&ha->num_pend_mbx_stage2); ql_dbg(ql_dbg_mbx, vha, 0x1012, "Pending mailbox timeout, exiting.\n"); rval = QLA_FUNCTION_TIMEOUT; @@ -289,6 +317,14 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) wait_time = jiffies + mcp->tov * HZ; /* wait at most tov secs */ while (!ha->flags.mbox_int) { + if (ha->flags.purge_mbox || + chip_reset != ha->chip_reset) { + ha->flags.mbox_busy = 0; + atomic_dec(&ha->num_pend_mbx_stage2); + rval = QLA_ABORTED; + goto premature_exit; + } + if (time_after(jiffies, wait_time)) break; @@ -312,6 +348,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) "Waited %d sec.\n", (uint)((jiffies - (wait_time - (mcp->tov * HZ)))/HZ)); } + atomic_dec(&ha->num_pend_mbx_stage2); /* Check whether we timed out */ if (ha->flags.mbox_int) { @@ -390,7 +427,8 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) /* Capture FW dump only, if PCI device active */ if (!pci_channel_offline(vha->hw->pdev)) { pci_read_config_word(ha->pdev, PCI_VENDOR_ID, &w); - if (w == 0xffff || ictrl == 0xffffffff) { + if (w == 0xffff || ictrl == 0xffffffff || + (chip_reset != ha->chip_reset)) { /* This is special case if there is unload * of driver happening and if PCI device go * into bad state due to PCI error condition @@ -497,7 +535,11 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) complete(&ha->mbx_cmd_comp); mbx_done: - if (rval) { + if (rval == QLA_ABORTED) { + ql_log(ql_log_info, vha, 0xd035, + "Chip Reset in progress. Purging Mbox cmd=0x%x.\n", + mcp->mb[0]); + } else if (rval) { if (ql2xextended_error_logging & (ql_dbg_disc|ql_dbg_mbx)) { pr_warn("%s [%s]-%04x:%ld: **** Failed", QL_MSGHDR, dev_name(&ha->pdev->dev), 0x1020+0x800, diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index e218d68de532..04e0c7f51e68 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -2815,6 +2815,9 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ha->link_data_rate = PORT_SPEED_UNKNOWN; ha->optrom_size = OPTROM_SIZE_2300; ha->max_exchg = FW_MAX_EXCHANGES_CNT; + atomic_set(&ha->num_pend_mbx_stage1, 0); + atomic_set(&ha->num_pend_mbx_stage2, 0); + atomic_set(&ha->num_pend_mbx_stage3, 0); /* Assign ISP specific operations. */ if (IS_QLA2100(ha)) { From patchwork Thu Aug 2 20:16:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10554173 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 02EB89093 for ; Thu, 2 Aug 2018 20:17:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E40482C444 for ; Thu, 2 Aug 2018 20:17:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8A002C461; Thu, 2 Aug 2018 20:17:22 +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 E62502C459 for ; Thu, 2 Aug 2018 20:17:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730730AbeHBWKC (ORCPT ); Thu, 2 Aug 2018 18:10:02 -0400 Received: from mail-eopbgr700071.outbound.protection.outlook.com ([40.107.70.71]:56928 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729639AbeHBWKC (ORCPT ); Thu, 2 Aug 2018 18:10:02 -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=VrPrgjSFUQHNZH3AxbyjOuIvxPISsrwbZrq8TuFB5s0=; b=TRGZxGAjkhjNvpq3UTr/rWskDxDR6MJaTfc4nJOMDz5k9VJzz3viMszAkdSB5Y2HB40xPEmxSlRmCywOy+uZXkdWV8aUhv4igDwSUh5oFYvQDkTZuaPJv4Jz3px8EwDuZyVmZpKxen4nh2tSYUdnaAi3bZHFgb9gdScJ9VNBstI= Received: from DM5PR07CA0089.namprd07.prod.outlook.com (2603:10b6:4:ae::18) 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.995.19; Thu, 2 Aug 2018 20:17:13 +0000 Received: from BY2NAM05FT006.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::206) by DM5PR07CA0089.outlook.office365.com (2603:10b6:4:ae::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.14 via Frontend Transport; Thu, 2 Aug 2018 20:17:12 +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 BY2NAM05FT006.mail.protection.outlook.com (10.152.100.143) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Thu, 2 Aug 2018 20:17:12 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Thu, 2 Aug 2018 13:17:01 -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 w72KH0xj007982; Thu, 2 Aug 2018 13:17:00 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w72KH08p007981; Thu, 2 Aug 2018 13:17:00 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 11/16] qla2xxx: Fix Management Server NPort handle reservation logic Date: Thu, 2 Aug 2018 13:16:53 -0700 Message-ID: <20180802201658.7903-12-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180802201658.7903-1-himanshu.madhani@cavium.com> References: <20180802201658.7903-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)(356003)(47776003)(14444005)(4326008)(87636003)(80596001)(44832011)(2906002)(106466001)(36756003)(6666003)(316002)(486006)(446003)(478600001)(2616005)(69596002)(50226002)(5660300001)(50466002)(48376002)(81156014)(42186006)(575784001)(11346002)(86362001)(8676002)(81166006)(305945005)(186003)(72206003)(76176011)(16586007)(110136005)(26005)(126002)(54906003)(476003)(336012)(1076002)(51416003)(106002)(8936002);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;BY2NAM05FT006;1:JAnDwpYoItmkxZLHsznpnuhIThJmQY+kOlCImK0eXRK9/0J22PLv4M84WOgjSxg2shuHsdggPZPPq2cm69O5cn9p5c0ZUD6gWhum3mvH6aM4Trx0ADNic9s5jRc4YaFR X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e58dda44-0974-483d-f554-08d5f8b4eead X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BY2PR07MB1459; X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB1459;3:349B4jj8MQGPmCHezTZekoCVF9ITwEqq5t11sTzWt5Y3SfioXYnnDGDfMAX7F9RtCCNYGq6QDt1iHLDy23Q4FDwwTjYW1PRafmFqT38JOOWGG89ogcGISst6+0jFG08ebambzRjkrYsg0cHv1rGXKW2sHVcncTByGs6A3KaHqfEgYmW+zbSj5Wijizg6sfjldYyf4CHWQnyJjk0p9r/LwbS14RNGmB5wGeAt68x5mf8HT6Trag+aJ4L/S4rmms/RnBTfmz/Tlit5540mz7a1NEo8jJbgcDVC4nd04rETnk6OfFWa72hfyXaa8ypjab/nr2Foj2+mNSTl8qMQt2dNHthSEX6imukcbp1HgslQ+J0=;25:T+TF/BRV7JmHUlF5E1I1RrcBapNgGmYz4vMgiGUfG4YeHqloUi93YfARuV2LdSGi6F3XUrbnDvIDz3wIQ8Yx+fqYp/CfC1nVKA7GmQ4Si+8AuUZqBdqFxduVyFi5P/OhbsVzSFUf7W7e8ND4nRpY1VXAx/sHW9kBjFeJt8rm4lXE21q6wSwp3894c98fXWbSlm1EdFzkCD1CbVdghDe2pqWf46ER6d34JeZs6u76f9DhiOWwYMP6H+cvNYz2G6pNhrStOJjYxwePnfupGBqSUh5Cnmtzn0zPt6QmkkodXPcB8fqg/yBlspDIweqkCk3j0Q/UxOu672uwxLnrQEP4sg== X-MS-TrafficTypeDiagnostic: BY2PR07MB1459: X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB1459;31:Z38iJYifC0gg+WOaEnJrBPVhD60X5GtmzFGbsaZ+wfo7ymdxvF+AXQsRtv1WxsI0W969d6Oy5if3WBXCNtVw35BnEDuwXB/Wh0l8A7zfxSJ9Qxq3L86a5jbw+U2kPNzqBYQ6uPb05JQAyH8Zto8DE5XfHDUAX+pyP7UJAkMVVixPscoqRBVBomV8777MvACzdGUGRQdNHwMyh7UqUU31EiHc1G+a7xh6wNldRp8KMTQ=;20:mAFanuiotgxWHIOLOkXeRackWDpLhTOiJDNFd9DWEajZxDTfKErEyRovo+Q3U2lAjuq4fK7aKAQ15MZKmkxCW5H1BTLhMAHArNKHx/O1X9YNUW1XkqWlJeU3SKcKio3eUSLUdy/fO3O+H0db61qGfN+rQsTdHH5FxymB/e46fwhUHpN9RyE+e1S2dY3pvAOVPVTKEV+kmLQgyPTgCZj6bzz4BBHyhDtHktg6SoDIK1QCG0O7x6fHOgQdrGfEw/GGskE9B8gbjlobFNrrRAqoSpBDODkmJ0ISxgwCVMQHki63FOuRTz1pHkZximsSE4lkjJFmvZc7e67jboSpcg7+hXyy3oD2HLEJSlM78tMnf1dnX2AjXQTqQKjWvzTN2TRJSpqIw5BJx0Jsc4wpxfkL7urjIu+Z2yBsiq8WCm17J7StYjhEfaPYZj6ujoqrRJAIQuTHOuwrUT2KfmFBQz4pXdF+yeWGHDz7V0WanD5Zh7abMzx380PargmX7gfvFIsj 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)(8121501046)(5005006)(3231311)(944501410)(52105095)(93006095)(93004095)(10201501046)(3002001)(149027)(150027)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(6072148)(201708071742011)(7699016);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vt1Qgi767vmMT52g3F0qkOVeg/AeJNimWpIWM63nhcxzaELZ964KZFWfgxHovZe6GH9v/eVjQCvhSdZsr2VbIZ0PTn3n3LqGHsahSxkTrWn+TCMuo7QPyh1SBHdkXBtyBgHv+bKGETlMkhW0OBXs08ToFAtKN66RFBORuDmVj1dTz89fwf/9rPiurCPVePRl5rrnOP2+X+iHvoB1+8eCi7vMOMISA4Hni4g8yysMgTqa2kfzVF1GGitHAggYhtFKlXKhtSssiGP5qGy7mjmtz1EgTAN7ziB5Odwi8s1FkD3vRxEEAJXt7cMN16CHdH1w9wX3OMkvvbXV7qh7IAg3JCQyv7JX4gSzd0RwyXr9sm5lVt+AnHMMyzdfMc60nKDfriFBGVbrIAA==;5:YQ9pfgGpLDCOJLm6ekOoz8e7kY0Pe8CL7kSQfH2oZ5IeefYmkNzjtzAhdqpbILXZKkHrcY9tBdGmAsO7/D1fMS2oA72mIdXLZrGB+qV22s8nf6FKI5nfP5MzSCTt0TGtgzLOHu+cjgFPBbV6WzkFl2qqqsYNwmyBUTz3Lk2V1Yg=;7:UfIUxOTjJFgVdNcNUHbWjF9udRW5WeW3iPblmG4UCJ2i7313m9z9xece2rOmYn/nmM1QimhIX9QymCXNd3bjmFxOe+inye9Ep9rKYYI595w3wVoQvNd1YDZEam3USzlX0LjnhnPuXYQhEeGQoEsKHimdj7bgfOVfqyvaKKVOWvMsLPrlIbolH1xcGQ01behxEC3StpP8foc+RqTiGI3XZuK+UsTgaasVZTgvgwgsuO0swa7TqnF2v/0VR+5tR6lJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 20:17:12.2941 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e58dda44-0974-483d-f554-08d5f8b4eead 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 After selecting the NPort handle/loop_id, set a bit in the loop_id_map to prevent others from selecting the same NPort handle. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_gbl.h | 1 + drivers/scsi/qla2xxx/qla_init.c | 28 ++++++++++++++++++++++++++++ drivers/scsi/qla2xxx/qla_mid.c | 2 +- drivers/scsi/qla2xxx/qla_os.c | 3 ++- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index f68eb6096559..00fbd49a9a7a 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -118,6 +118,7 @@ extern int qla2x00_post_async_prlo_done_work(struct scsi_qla_host *, fc_port_t *, uint16_t *); int qla_post_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport); void qla_do_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport); +int qla2x00_reserve_mgmt_server_loop_id(scsi_qla_host_t *); /* * Global Data in qla_os.c source file. */ diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index a10a8bb895e9..9d1a8b2c41a9 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -5616,6 +5616,34 @@ qla2x00_find_new_loop_id(scsi_qla_host_t *vha, fc_port_t *dev) } +/* FW does not set aside Loop id for MGMT Server/FFFFFAh */ +int +qla2x00_reserve_mgmt_server_loop_id(scsi_qla_host_t *vha) +{ + int loop_id = FC_NO_LOOP_ID; + int lid = NPH_MGMT_SERVER - vha->vp_idx; + unsigned long flags; + struct qla_hw_data *ha = vha->hw; + + if (vha->vp_idx == 0) { + set_bit(NPH_MGMT_SERVER, ha->loop_id_map); + return NPH_MGMT_SERVER; + } + + /* pick id from high and work down to low */ + spin_lock_irqsave(&ha->vport_slock, flags); + for (; lid > 0; lid--) { + if (!test_bit(lid, vha->hw->loop_id_map)) { + set_bit(lid, vha->hw->loop_id_map); + loop_id = lid; + break; + } + } + spin_unlock_irqrestore(&ha->vport_slock, flags); + + return loop_id; +} + /* * qla2x00_fabric_login * Issue fabric login command. diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index f6f0a759a7c2..14bc88bc4a5a 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c @@ -485,7 +485,7 @@ qla24xx_create_vhost(struct fc_vport *fc_vport) "Couldn't allocate vp_id.\n"); goto create_vhost_failed; } - vha->mgmt_svr_loop_id = NPH_MGMT_SERVER; + vha->mgmt_svr_loop_id = qla2x00_reserve_mgmt_server_loop_id(vha); vha->dpc_flags = 0L; diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 04e0c7f51e68..48d1003c8178 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -3048,7 +3048,8 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) host = base_vha->host; base_vha->req = req; if (IS_QLA2XXX_MIDTYPE(ha)) - base_vha->mgmt_svr_loop_id = NPH_MGMT_SERVER; + base_vha->mgmt_svr_loop_id = + qla2x00_reserve_mgmt_server_loop_id(base_vha); else base_vha->mgmt_svr_loop_id = MANAGEMENT_SERVER + base_vha->vp_idx; From patchwork Thu Aug 2 20:16:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10554181 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 A8B011708 for ; Thu, 2 Aug 2018 20:17:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 937992C451 for ; Thu, 2 Aug 2018 20:17:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87C9B2C48D; Thu, 2 Aug 2018 20:17: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 BF4F52C451 for ; Thu, 2 Aug 2018 20:17:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729034AbeHBWKP (ORCPT ); Thu, 2 Aug 2018 18:10:15 -0400 Received: from mail-co1nam03on0048.outbound.protection.outlook.com ([104.47.40.48]:16060 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727355AbeHBWKP (ORCPT ); Thu, 2 Aug 2018 18:10: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=trG9i0XC2SGxq9w7DQzGVg7LkAhOg5wW9nt01/O8+do=; b=UeNuBPcG3pG7IVENCcNKKVGmHYeYxLllgwLPh8kv3y89WZoFuJ0BPa5Dl4kN6ll0AglinIn9ymYnDrCfpj7TKqHyaODgB0htnhk+eq3GGDj1waH0VdR0rm7k3EvpEjIDu+45vF3W+AYLQap/05MdWOKpxJqb/3i+muKMBm0vaRE= Received: from DM5PR07CA0089.namprd07.prod.outlook.com (2603:10b6:4:ae::18) by BY1PR0701MB1381.namprd07.prod.outlook.com (2a01:111:e400:4810::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.14; Thu, 2 Aug 2018 20:17:14 +0000 Received: from BY2NAM05FT006.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::206) by DM5PR07CA0089.outlook.office365.com (2603:10b6:4:ae::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.14 via Frontend Transport; Thu, 2 Aug 2018 20:17:13 +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 BY2NAM05FT006.mail.protection.outlook.com (10.152.100.143) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Thu, 2 Aug 2018 20:17:13 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Thu, 2 Aug 2018 13:17:01 -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 w72KH0HO007986; Thu, 2 Aug 2018 13:17:00 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w72KH0x3007985; Thu, 2 Aug 2018 13:17:00 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 12/16] qla2xxx: Fix race between switch cmd completion and timeout Date: Thu, 2 Aug 2018 13:16:54 -0700 Message-ID: <20180802201658.7903-13-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180802201658.7903-1-himanshu.madhani@cavium.com> References: <20180802201658.7903-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(39860400002)(396003)(376002)(346002)(2980300002)(438002)(199004)(189003)(72206003)(336012)(51416003)(44832011)(54906003)(26005)(110136005)(16586007)(81156014)(478600001)(81166006)(126002)(42186006)(446003)(106002)(11346002)(87636003)(36756003)(186003)(48376002)(486006)(2616005)(50466002)(476003)(76176011)(316002)(8676002)(5660300001)(4326008)(8936002)(2906002)(106466001)(47776003)(50226002)(86362001)(6666003)(356003)(14444005)(69596002)(80596001)(1076002)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:BY1PR0701MB1381;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;BY2NAM05FT006;1:SPJU9vr8Yss/h8E0PeCblkG3xiFfaBY3wORdebHXWgfE3xxsVlL5V4Sm2hKAUHqXaBZ2npuNvQNsFFZLw1MbQVBaU0AT2oeEW1VRLILds80oTJ0qSEhVCjZ06nXdJ+rd X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 52ea8b14-c0d1-4727-29c0-08d5f8b4ef63 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:BY1PR0701MB1381; X-Microsoft-Exchange-Diagnostics: 1;BY1PR0701MB1381;3:w/D9ALQnBpSAHNDFp8xx6bKRqgabyt1Q/7GR6zCLeYqKk0BzcyS8yOvdvY2vN7Wupl/ljtjRLaKr3arWjl476fN7LmzTZo4yzHQiHXMifldMt2AZeEfe2oShNzHs77RXmdmQAh+9KoYdLXZ21JoFV/Cyj/zyOO7lSpAo0Sl4AgIU+pLaPTiEsEeFlAx6iqYw6ggvF4OGQS0bcmBrIu78LMn3P0ClHxmbg5XyROKdZ8cPyAeIZ2LH8VaHJTp1qxq97pQbDXeLBJaSFZ4+4KFEdIY6GX3Ec115GQEdQXCS7A5irkkOj+4TjPVNPccoNqxLGH2wn1GKlz0LJRyjVBjb9iavX58uspa2JQmy9D/c76A=;25:p6pqKCqpLddKb9Quj3pmOdSeL7/v+6xRyfP3r++gxI2ukxirSmYNcpJCEh48JG2V9BDkwvW6RgfGHtRpjmzBXTM1YUEIF3lhzKv+is9OKYklqL7RDyMxOnrxHCmCOIxev//530pzjyr10O+S1KgR/dd5G9LAgdz3vo2zxs3W15t4hhANiwgHd+tnrX8qQzVPVUQb5XXx8/nDksKCNhGjmk4E9YjLwD64zFsc4oKyzTOj93+P2pjYbLtgCEAP7fMt6o6t4FNm7kMZ8wP6PvVaa0DqPCe7KSSCd/BuFMQIDpUvdI/3FzTLpRECPlU9wya3t+KRqRDnf99tKj9AGiLwjw== X-MS-TrafficTypeDiagnostic: BY1PR0701MB1381: X-Microsoft-Exchange-Diagnostics: 1;BY1PR0701MB1381;31:gIFrO0rrk6mDPYGCXEu3ncQ6ZBWzB+CM30MaIjxl0bGOMOANY36kHdk6NP3uyAcNEnoTjFDCMKmrTES+nfSHOBoH/4J2wjE0M9E8Uot+fJQ6hkcL1Tx/exiEktDlRqDiXwxz76yaJg/l4+s7b2sag3FOJqxod3QXn+7evwx8/PAQ5oWnFWG7tHrvVGpR4t8Rm994s5lcDKYjFj+JPLjCrGirPSPamWMw69XcvgYkF3E=;20:ZRnDDwOn/+9r3evO6bSNmzEdTV3OtlC7z59/eW+pJmqF+IyJyhyAD5Q9aMfi4HU3pneeJrj5Pbbd945R4u9g3OdZXCrlx+cD9urJrOWggjJ9ws/ZtTYTydcseWCEGIp8t7h+Hf262x3RuPvCc/PrpLcHn0STxy8fn3jdsms2OZop9Bx2kobwcCWn1+zMM0el2aSOf2NiYGmeteenN7Igss0ffMqYWd9sPCXDv9w3kr1NFlABuw/lhd5C3gQfw21ZaEjAo3sbiamdl4GrP+6c/vfCuFs5uDAq+JBC7S2qc8UXrOlANTyqzY+HLKsb4BxHiwLTCmw2Ss+yrJqc7QEkjIeJGX9eP2uAtdkCEAVmNYVIqTeLPia6AK0q/Y7KDh2YfEx/JeMzwfC6d/kxJpfjy9nsUSVhXawOLtAso/Psyxit6CnOjRobLJN7i3i0FsplWxmf8e+qtucXpvhxzvVix1Y0AJE5x9sxIjLiYOeF5kX8v890xi+VIfe1J94piLPT 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)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:BY1PR0701MB1381;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1381; X-Microsoft-Exchange-Diagnostics: 1;BY1PR0701MB1381;4:wFmRdck10EiVyWk3KMNAHpl5EZNSDXGW98Z08+xrY5oYX5G62YcpkW0VLbB+G+dWVCTHhFo1nUwiP65AWaM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uTqNK1wcdsp1S4WVEMeYUjDiaBD1ZfTqNf2FuLB32WCi8dxCNZ/j3gsdTqUG1g5IvW6yhZXVev2RCpn3s/zLgM9EJSvve+6AHGndflxlKeUmSF4w8Ht+Hmd02xaA==;5:9C9a2id+0tz7OHHYvIsoWUbrpfxEKqwGrUXL6YA4vpfQkS0pZzO2Yuj8MYOBouG8s2j7K0Jz5yEKMEcAzRzSXCcwX/hUbhREBvOd0arv1hq1rwOhhQDllekKPS8sBZyFLgHOTGeSzJw6UFaw4bO/5yyXXIKzIPveDO6Pu+Bn0Hw=;7:9MuifNPaWmNwtng/EnXL4GihGUNX2W+CdCaCLA2YI/YS/0ahSdT0xmoPg3XwwL5YcMACzdN6jv64a3Dcl3gmwb1IDrprpbl1gAAMjSRXZnHxRh1ucvNjPdjBdJq4pt0HRDATHNo+ht40Lg3eyni3sBzYPim+EOFi7aLhj0T7Z1YEpV11DQYInG619LL9kE2wkf2z1OzJExx04bviPI9RyIHLxpjFGJ5pZNxNI5hUyMmARaXF49abAQSxhbkOEKiN SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 20:17:13.4816 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 52ea8b14-c0d1-4727-29c0-08d5f8b4ef63 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: BY1PR0701MB1381 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Quinn Tran Fix race condition between switch cmd completion and timeout timer. Timer has popped triggers command free. On IOCB completion, stale sp point was reused. Instead, an abort will be sent to FW to nudge the command out of FW, where the normal completion will take place. RIP: 0010:qla2x00_chk_ms_status+0xf3/0x1b0 [qla2xxx] Call Trace: qla24xx_els_ct_entry.isra.15+0x1d4/0x2b0 [qla2xxx] qla24xx_msix_rsp_q+0x39/0xf0 [qla2xxx] qla24xx_process_response_queue+0xbc/0x2b0 [qla2xxx] qla24xx_msix_rsp_q+0x8a/0xf0 [qla2xxx] __handle_irq_event_percpu+0xa0/0x1f0 Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 1 + drivers/scsi/qla2xxx/qla_gbl.h | 2 +- drivers/scsi/qla2xxx/qla_init.c | 75 ++++++++++++++++++++++++++++++----------- 3 files changed, 58 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 40bcf938cf4f..0fc563572fad 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -313,6 +313,7 @@ struct srb_cmd { #define SRB_CRC_CTX_DMA_VALID BIT_2 /* DIF: context DMA valid */ #define SRB_CRC_PROT_DMA_VALID BIT_4 /* DIF: prot DMA valid */ #define SRB_CRC_CTX_DSD_VALID BIT_5 /* DIF: dsd_list valid */ +#define SRB_WAKEUP_ON_COMP BIT_6 /* To identify if a srb is of T10-CRC type. @sp => srb_t pointer */ #define IS_PROT_IO(sp) (sp->flags & SRB_CRC_CTX_DSD_VALID) diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 00fbd49a9a7a..6f2a37220a55 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -213,7 +213,7 @@ extern int qla24xx_post_upd_fcport_work(struct scsi_qla_host *, fc_port_t *); void qla2x00_handle_login_done_event(struct scsi_qla_host *, fc_port_t *, uint16_t *); int qla24xx_post_gnl_work(struct scsi_qla_host *, fc_port_t *); -int qla24xx_async_abort_cmd(srb_t *); +int qla24xx_async_abort_cmd(srb_t *, bool); int qla24xx_post_relogin_work(struct scsi_qla_host *vha); /* diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 9d1a8b2c41a9..75538383de5b 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; } } @@ -1594,7 +1624,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 @@ -1603,12 +1633,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; @@ -1623,6 +1657,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); @@ -1646,10 +1682,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); @@ -1685,7 +1722,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 Thu Aug 2 20:16:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10554169 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 882279093 for ; Thu, 2 Aug 2018 20:17:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74B2A2C444 for ; Thu, 2 Aug 2018 20:17:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68F742C459; Thu, 2 Aug 2018 20:17:19 +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 052102C451 for ; Thu, 2 Aug 2018 20:17:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729774AbeHBWKA (ORCPT ); Thu, 2 Aug 2018 18:10:00 -0400 Received: from mail-bl2nam02on0081.outbound.protection.outlook.com ([104.47.38.81]:12096 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729034AbeHBWJ7 (ORCPT ); Thu, 2 Aug 2018 18:09:59 -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=uDhF1kfPFQD3BJ5KmWU8dQTXhgM5YPsEcysmYhctHGY=; b=m8iGdcvCOzOdUoI0ke042ip9AqBUns4eB1B6YHj5Fh8KxXwav12J1SWsmrqmBFeJ7AL/0G3grI/ncWzVBwdkRy/AQxmqY5BOpl0vfMHwjIFJ7hkJFwkRUuod4ZoR6/CigW+AdlTPEZk/Osnv+OjGTdIknTVWWrJoixpR6t5+cwQ= Received: from BYAPR07CA0024.namprd07.prod.outlook.com (2603:10b6:a02:bc::37) by DM2PR07MB1466.namprd07.prod.outlook.com (2a01:111:e400:50c3::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Thu, 2 Aug 2018 20:17:14 +0000 Received: from BY2NAM05FT024.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::207) by BYAPR07CA0024.outlook.office365.com (2603:10b6:a02:bc::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.15 via Frontend Transport; Thu, 2 Aug 2018 20:17:14 +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 BY2NAM05FT024.mail.protection.outlook.com (10.152.100.161) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Thu, 2 Aug 2018 20:17:13 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Thu, 2 Aug 2018 13:17:01 -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 w72KH10M007990; Thu, 2 Aug 2018 13:17:01 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w72KH1nq007989; Thu, 2 Aug 2018 13:17:01 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 13/16] qla2xxx: Fix stalled relogin Date: Thu, 2 Aug 2018 13:16:55 -0700 Message-ID: <20180802201658.7903-14-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180802201658.7903-1-himanshu.madhani@cavium.com> References: <20180802201658.7903-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)(376002)(346002)(136003)(396003)(2980300002)(438002)(199004)(189003)(81166006)(48376002)(81156014)(5660300001)(50226002)(106002)(69596002)(16586007)(8676002)(186003)(4326008)(54906003)(2906002)(80596001)(110136005)(6666003)(47776003)(50466002)(87636003)(478600001)(42186006)(44832011)(316002)(8936002)(2616005)(11346002)(336012)(26005)(126002)(486006)(51416003)(476003)(106466001)(76176011)(72206003)(356003)(1076002)(36756003)(86362001)(575784001)(305945005)(14444005)(446003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR07MB1466;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;BY2NAM05FT024;1:gfn2Ck+XT+izzEwfi2qZFTHtCzpsNzasyqv3YtGHUB48ro0mM6dkQMbbi+0we4Z+pOQZgkQzdzMrFtYzVqjxW+UaEJkSRduA0KXXk6xKnKWpkMKReTCmHNZdNqghP0bS X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 35ec7527-84f8-495f-2128-08d5f8b4efa1 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:DM2PR07MB1466; X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB1466;3:NwowvD7LjTZQ2/eKQGMTYbxIrg4q/N8cvRxLE+AGqWq8mkVMmqnRi6b4sLxd3UHwS/muz1UjZH+ZDG5oSfBs3I+1wk3CPIVjzKe8YtgpxQVn7IA8o18kOpA6n/MPPSVG7ea4zg8RVCoZwYZvOyfbotBp9ujaRCBJZj3JUgP2dzEZEmCCWQIB0pe87pVLGNnySroYY+ciUtBE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+2s5UlkXpssqnoX97BGBNt2V6aRbX6/05Wgj6jqAkYeeQxjRSpKVRtTOPkJaJ8vn96920j4mc5TJ+60T118mXHWDbGUQ8JWLrvKureH1pKrolMiAL131f/RSlJU2pE0QoTNAeQIyJ7KV024hgFIPDVSThJMVMBTAHQ6PrKiwECZwhTxngdD1vkdSQ1BL/4lPgGaWi3bKm5jxt6lT01siWVDLINqQ57MhQNXYwV3UaxjtJSuYtGOL4lNGf 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)(5005006)(8121501046)(93006095)(93004095)(3002001)(10201501046)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:DM2PR07MB1466;BCL:0;PCL:0;RULEID:;SRVR:DM2PR07MB1466; X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB1466;4:86mPZG8VrDFvJcCXKQ47mekLUDk3IIeAuGzJmbmHySNdCQrQXNal2uRXDhiVCsAjQ98AgQyC2dHNmu1x1wi9xFQvpzZQXo3KGxam+uz2NC4lXf403CZshPLN+JtYCwYZdg0I+2CAIaf80vtKjAMXRoyHbKVnkmfHqBwV/Oa7raNAsPSLtjnVPFenPeuhPzHchg58kiN9oQOpyIY6pGewfTWqpR97fRfbsy1FPL1Y4hHb2TfD8s0fZGYTsGYnJwmq+fWSRFAA6gYncgCqRo6sMyuS1mUplq+NWNpWQ4LcRVmYkB2c1IbxSJC1nqwWohIL X-Forefront-PRVS: 07521929C1 X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB1466;23:N503SAhVI4rmILtFlYoAkoKjzmXI1vJOK+F3IRopdRIjj5iBxd4HqMJwVH59VVDYj+BiETYEQV98zDU+j3dk+qs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/8bb5HJ35Ho4cy8mw+KLiG8HQrni/jrWlMasX5h+CouAN/HvFWNKZJgrBfSYLVQxA5rdLPknBehvOunZgx1cQiYo/lUkkB137ShM2IWTrr9PBpY0ZHmsuVAY0AZGFGMJq2e6fhOtBNeqWPwB497TwJzLDMNZ647gK0y6/h3k3WUeMEohcSC7/fll6/Q0VjQJ9+SezfavVteKODK1vrNcwNonqvqG0YiL+NzIfFRwQCmAF9kzw+/6yXw3KjO SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 20:17:13.8878 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 35ec7527-84f8-495f-2128-08d5f8b4efa1 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: DM2PR07MB1466 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 75538383de5b..c3c7aa1cb86e 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 Thu Aug 2 20:16:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10554175 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 42B50157D for ; Thu, 2 Aug 2018 20:17:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FA382C444 for ; Thu, 2 Aug 2018 20:17:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 243612C461; Thu, 2 Aug 2018 20:17:23 +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 97A242C48F for ; Thu, 2 Aug 2018 20:17:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729639AbeHBWKD (ORCPT ); Thu, 2 Aug 2018 18:10:03 -0400 Received: from mail-eopbgr730071.outbound.protection.outlook.com ([40.107.73.71]:60886 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729660AbeHBWKD (ORCPT ); Thu, 2 Aug 2018 18:10:03 -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=ZJySAM+d5s1agJzpRQyv4z1+zKUd3gvdQf4CGnE7GsU=; b=Hbv8X6myE37vdzh+Cxnywzd/v0eK7ITzUOJK/VIg7TJVtlUZwgLqLJkXNmEnzSxzMZFuOgUTszyiOUWheLGJFBX/Obwrw4cV8t0ReLDSoJR94RW4zG+9AAmeGvgavED3JRbr5quMAGdLRlpq2mM8VmeflosQX/xfpoeVgzZP4tc= Received: from DM5PR07CA0100.namprd07.prod.outlook.com (2603:10b6:4:ae::29) by DM2PR0701MB1392.namprd07.prod.outlook.com (2a01:111:e400:511c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.21; Thu, 2 Aug 2018 20:17:15 +0000 Received: from BY2NAM05FT006.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::208) by DM5PR07CA0100.outlook.office365.com (2603:10b6:4:ae::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.15 via Frontend Transport; Thu, 2 Aug 2018 20:17:15 +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 BY2NAM05FT006.mail.protection.outlook.com (10.152.100.143) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Thu, 2 Aug 2018 20:17:14 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Thu, 2 Aug 2018 13:17:02 -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 w72KH19r007994; Thu, 2 Aug 2018 13:17:01 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w72KH1J5007993; Thu, 2 Aug 2018 13:17:01 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 14/16] qla2xxx: Save frame payload size from ICB Date: Thu, 2 Aug 2018 13:16:56 -0700 Message-ID: <20180802201658.7903-15-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180802201658.7903-1-himanshu.madhani@cavium.com> References: <20180802201658.7903-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)(336012)(51416003)(4326008)(478600001)(446003)(126002)(72206003)(86362001)(48376002)(476003)(87636003)(80596001)(1076002)(44832011)(69596002)(50466002)(2616005)(186003)(76176011)(8676002)(8936002)(486006)(11346002)(316002)(81166006)(81156014)(2906002)(16586007)(26005)(50226002)(5660300001)(47776003)(106466001)(6666003)(36756003)(110136005)(305945005)(42186006)(356003)(106002)(54906003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR0701MB1392;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BY2NAM05FT006;1:m1pv8LxnmFX19TJv9EGGO5W2oyiSiYY3q/40Yhtqmqtd1cIgszgj/B6R108u3YC9PR/k+6Khk3U1AOrrgJiBVXDXku+jGV9eH6l7ikDaXmScu1xM+j+01Nl0aDkU1lIg X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e3e76d9d-5c8e-4d7f-0dcd-08d5f8b4f048 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM2PR0701MB1392; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1392;3:wuDtc+n3m5vktTwMy15qGBsuZ+ozOrRHLW4oIAiNmgW/VSiqc9PzWtu4KDFUNCD9UoHCv2+Yz59dUUagN7E4A3yUtGDQtqqXdAzehVyjqikzu/bc6IyiqphBQyIvr6ONHkz8Wzzbn+oWXex+gjCmmnN0yjpq6UxKhDTp+e5VLoIgMx8ZXUw7w39sh3JFoPA8QSFiw7UNTtDQ4SD1+mgvla05JfDDfa3+d+bvgjxtut0rmh1sJzOmeDGddC2bDUJSgeueQMuiJOpM6K7seP7LdKXLZrkQx+j7sHrX5dpzAcunxjd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iXcH34ERRm+His0/ZGvTxUxBxQ+q7ukuno54LMXsioN7dd7AOJ/Mj56Pg25ZdxADR6wh3zkPwQEeNax3C+dpflNhdQhokuh/jfqwU83Cy1cGGPud737O/2fOWrFNbAjcpOvMERY5ZuzBRLO7alIkNAxUIT9Xf X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93004095)(3231311)(944501410)(52105095)(3002001)(10201501046)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:DM2PR0701MB1392;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0701MB1392; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1392;4:wj6hCDt8t9Qjzw9WcTxVOYT7EsyNgHcYWdL43487LsHE/25j+0g6ntxR5k3BHBhcKqUarPsKqnSkCHBZdvD5OEDe6yk+YbCJx/EJwYCtYC5oN18ru2epGjOFnUq1D418uLnVB1UZpmR2hJG55TgoUggvMesAr9UNDPZrYoNWwZKrpAWGooqXkw6i9GvcCYVyxoTLPZy21T7QKlOnXJ/s22CQKWHfdjWcjq/OuVEBMDyMty3ePrWZ8NUvR/Ry6rm3/rgg8s/XmJLJ3JvA5Zsgfg== X-Forefront-PRVS: 07521929C1 X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1392;23:b73sxD2JaGNs385SM/KbT/upyw7pOrN3M1NRnKypweMz9WDpupF+KXm2pDfDu+8+ffUFBeEMvk6QXgJwQV5hH0NxLswg56gK40g6/XoPdl5U3RwhdlSOxtTK/qefUX92F9NuKXDsardPP8HS2J93af+NFs4WsmUbNJN1FZog/vntwes92IN5y2LOhLZXu9I5PKAFNhXlyDmoLgbwqQL2XjTXEZhvVAvv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7GFPn7sPVzNSsylCiPV67ADjmZTTkox8+hy/T9T/YoBJS4RFKlVvjzWSV4DguXs SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 20:17:14.9661 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e3e76d9d-5c8e-4d7f-0dcd-08d5f8b4f048 X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0701MB1392 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Quinn Tran Save frame payload size from init control block. This field/data is used to register with switch data base. This allow the init control block temp buf to be reuse Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 1 + drivers/scsi/qla2xxx/qla_gs.c | 4 +--- drivers/scsi/qla2xxx/qla_init.c | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 0fc563572fad..d1ff1b8f1ae5 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -3848,6 +3848,7 @@ struct qla_hw_data { atomic_t num_pend_mbx_stage1; atomic_t num_pend_mbx_stage2; atomic_t num_pend_mbx_stage3; + uint16_t frame_payload_size; uint32_t login_retry_count; /* SNS command interfaces. */ diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 5139a3577bb3..af9a75df6700 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -2134,9 +2134,7 @@ qla2x00_fdmiv2_rhba(scsi_qla_host_t *vha) /* MAX CT Payload Length */ eiter = entries + size; eiter->type = cpu_to_be16(FDMI_HBA_MAXIMUM_CT_PAYLOAD_LENGTH); - eiter->a.max_ct_len = IS_FWI2_CAPABLE(ha) ? - le16_to_cpu(icb24->frame_payload_size) : - le16_to_cpu(ha->init_cb->frame_payload_size); + eiter->a.max_ct_len = cpu_to_be32(ha->frame_payload_size); eiter->a.max_ct_len = cpu_to_be32(eiter->a.max_ct_len); eiter->len = cpu_to_be16(4 + 4); size += 4 + 4; diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index c3c7aa1cb86e..471322c29db6 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -4418,7 +4418,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); @@ -6893,7 +6893,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. */ @@ -7949,7 +7949,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 Thu Aug 2 20:16:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10554179 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 244FC1708 for ; Thu, 2 Aug 2018 20:17:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CB3A2C444 for ; Thu, 2 Aug 2018 20:17:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 010B22C459; Thu, 2 Aug 2018 20:17:26 +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 150562C444 for ; Thu, 2 Aug 2018 20:17:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730957AbeHBWKG (ORCPT ); Thu, 2 Aug 2018 18:10:06 -0400 Received: from mail-sn1nam01on0086.outbound.protection.outlook.com ([104.47.32.86]:20304 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729034AbeHBWKF (ORCPT ); Thu, 2 Aug 2018 18:10:05 -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=5EouYHrOxSut1PogoGbLsxVKzrdYXwwH4jYvvZK0xdg=; b=PyHkHLwYPOCVeBDFaX3Rwaq6qz7BmbbhA7POtoM998isppNBtHKMRgvUQeXgUH4BdRccKvGnQf3zROBDtjQydMnkyu8fjR9so0rStCUMaE5xN6ZQ/SKuygXw3aP72+UcKG449dxZrce+FsI/pAkzjVtQV4iKyGbmXB6qCB6P5fI= Received: from DM5PR07CA0106.namprd07.prod.outlook.com (2603:10b6:4:ae::35) by SN1PR07MB1470.namprd07.prod.outlook.com (2a01:111:e400:5838::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.14; Thu, 2 Aug 2018 20:17:16 +0000 Received: from BY2NAM05FT006.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by DM5PR07CA0106.outlook.office365.com (2603:10b6:4:ae::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.15 via Frontend Transport; Thu, 2 Aug 2018 20:17:15 +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 BY2NAM05FT006.mail.protection.outlook.com (10.152.100.143) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Thu, 2 Aug 2018 20:17:15 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Thu, 2 Aug 2018 13:17:02 -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 w72KH1dM007998; Thu, 2 Aug 2018 13:17:01 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w72KH1uc007997; Thu, 2 Aug 2018 13:17:01 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 15/16] qla2xxx: Migrate NVME N2N handling into state machine Date: Thu, 2 Aug 2018 13:16:57 -0700 Message-ID: <20180802201658.7903-16-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180802201658.7903-1-himanshu.madhani@cavium.com> References: <20180802201658.7903-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)(199004)(189003)(8676002)(316002)(305945005)(86362001)(6666003)(87636003)(356003)(2616005)(575784001)(76176011)(14444005)(42186006)(48376002)(69596002)(11346002)(80596001)(47776003)(44832011)(126002)(72206003)(478600001)(8936002)(51416003)(16586007)(50466002)(1076002)(81156014)(81166006)(476003)(486006)(110136005)(106002)(4326008)(446003)(53946003)(2906002)(106466001)(186003)(36756003)(5660300001)(26005)(54906003)(50226002)(336012);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR07MB1470;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BY2NAM05FT006;1:JSc7vO8RW+yDYDZCAtiq8bDM7B0/WAfy4r3PSum3r7qgcw7Cm8OwD73IQ/hTq+xuvkWhZMeiVZj+A3YiA/fNc8BrqtgQUK8fT9vNtAMueWtmfxskZ5u9SsPIA2I5CLkB X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1d9f90cb-4eb2-4aa1-44b5-08d5f8b4f0bf X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:SN1PR07MB1470; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1470;3:yLsewpg6st5s8+ZBE2TULkIYoKXJ9UnSrL6xUm7iFIGz8mxLmvQxDKBMmZnJow8cGvybmkT59WIY+x0sRiad0qZhh//wrBXdr44FReRX4/MVG9CgxtBiScfQrkygr/vV4ci+/yaLv44nyWtqkd5E+vHmkq5J7yg+U3SVtxgz/09eokH3shGYWnIO8bTFnRpRU72d13f5UtR1jfl4ZwSgbtv9hClUpcts+HOleEwIXiQdBtxfgAM3OqpmBQwy9GJdZvPL8XRpeinlr80oP8XsZ6WJu8ST0rOYcDkYTO+8FRlgbM7Oiuy6zPyb8hW0SPE9YEXx4LGxZ2blgYRKngFHPf74YoDoxlwRo95ppnv5QNY=;25:qXyt3M6nOZnpciX0pk5Mc+IvWSwigivHekpYB8Nl+txjjb0J4JjRyjmbK5OuKxdjHFBgMYfoY8KIpWY9HASyZBjx1Rvog8rvIFMFIQ4F1BBqtL5rz26qeGnC6vbV4R6r2eqnjJb4le90i3v/yOYEaBCQQ1fM1hlSIg53wrR3FJH7iK67MJ1mtXjN0RW8j4hQHWvUsMnEOgff9Qc/9o07yK0xhWz5OCNE7G6MdxvQXX/eZkw81Z5aNpIct70nVu1+vGGDfdNIBxFdNmlfbJjgMvrGMXYVhQZZVWakM3HpmdBhZopmkRwzQrJ3sO7/eu102A1UbYMoOgZyfTtx2uzv/w== X-MS-TrafficTypeDiagnostic: SN1PR07MB1470: X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1470;31:1ORGwlnjENUdv63yVqfJjcTEq7cV6F8wgkWLtRrZzgiBsDBEjhdqVZeSltgydJg+BK5unMnC5soXvHppJ1ALafjbsptfKx3I+iG2g6EIjIyOqhfj7Q6u4Pa9Z1QzEa8h7ymTTRjWLa8Nd3vvEHbi6Po9VXIcdYpJycjB1VObGtylypxf+Hfg/BqX4BiIjHQLUUs1llPex+Rb6lPUI6Z1e/3EkPnBCDpLmYh5/UyrNSA=;20:WZnP8Ob1RzzSNPW6ABvMKA3lMoPGZwDvv53sd92UPyBaSLak2NB/+lO1Zrerx4yKqj2n/Q1IpVpAzdYl4a+qpGzjQJonIi1u4sd/Ke4IeiP05NWwr8yjfHPLTF2I9+7WnNZkRYLZ/uCECm2OBCQ+y4qgZSwe1VvSrDtuHW5oRgtmrwFsZqQrar+CtY0tlAIlZWzk3UeGZNpfZwzaP2gI5dStm0rfkbnLYr6Y17dQ8+vJ9V7O3yjokE2JrIFI7DoEsObow37e47w53iQipLYrL/4qPMRlgoaOGbJNEY2tndhQFvvi+LjdyDDRJIh+cpuEAFXuX0LCnlPjr7oTfuyjaLfQdGyqDTinMHSRqKseejN2NojWNgPmHURy0bSykWtedcVQ1aKSdR3AfHV/ZywC2v1URtQJxsXQ4qvMpjqlrV81aUoqdd8C1cnRP7L9UmDgSTDbDa+C03zJ1OlfQ1+kO3RbrKY/uMjeiBYYu1mKM8z9ywgWsPFnYhjIXhPEB55n 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)(3002001)(93006095)(93004095)(10201501046)(149027)(150027)(6041310)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:SN1PR07MB1470;BCL:0;PCL:0;RULEID:;SRVR:SN1PR07MB1470; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1470;4:9gSRsKhSUNHvPew1uOglXn8Mv5YSMg7SlsKhISpMsguf91BVhY2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ysWu1qzpNb7pFZ9T18OIegqkVDuQ/ARLCfuzRvhS3I9yjUlAQZXp4886npO1H7nPptqEqJvPgBSwuTjVvXO/W0aP8l1OLdiH3aqeSW6Z/cMC8uQ/vF5TE+AJAJtsaORxqPzlKo70PwlU+jot+O/nehdxCq0zHKE6YnlN2gAhmATACKmBLW52cwTtk3G8u5JLz5jBe1W211+sLxkB7QMxuvvcipvIzOugFN8O2OAggyTA28PRj3Je8ZAnU4nla9I4daMOBX+6E9v0oPF61ztYCmDVZybJSUijvw==;5:2GbmI1Yetq2px/3bSTWhB0n6Pd0Bu8OeHGLg0hB5KJZFw7HvAbV6GKLpTIeFy6TaOzWsUWOZ7DNRIVw5UE+QvjOMKWqFxZrIdBd09HgNmBAX8rYMJKZ9FibQs8ZkNtCY0poSULNglKAjWfw2hPZ0hrM8jX8HqOlyBt6HZyNwIpk=;7:b5oclLdJT8qPM13KrDrlWFSB8Kzn7geuSYhS14v/GY07OWPAHhXPxztvZaeSaO6H4LY4MY1oECq4SgsZu2WCq5PAvbrRe+CCr2F+99uSBk2qZ83zotv/Rq53JpbJPuunq+xEY/DGjeb0FkRtkKvxV4jgkA8SXWouzAppyEv4DlouTQCKWeSjRpeiz2gtQ3AxF6QLS5ZbbKWeK5m56ExCh4c2/Bowjxpkcc+Pi+YDB8d56mGULA2RBKUBLxsIJoJ+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 20:17:15.7630 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1d9f90cb-4eb2-4aa1-44b5-08d5f8b4f0bf X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB1470 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Quinn Tran This patch fixes regression introduced for the N2N support for FC-NVMe. For FC-NVMe with N2N connection, instead of FW initiating the Login, Driver starts Login process. This patch migrate that new process from a standalone path into existing session management state machine. With this state change now driver will not wait for pull NPort ID from FW. Fixes: edd05de197592 ("scsi: qla2xxx: Changes to support N2N logins") Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 12 +- drivers/scsi/qla2xxx/qla_fw.h | 5 + drivers/scsi/qla2xxx/qla_gbl.h | 3 +- drivers/scsi/qla2xxx/qla_gs.c | 47 +++++--- drivers/scsi/qla2xxx/qla_init.c | 229 ++++++++++++++++++++++++++++++------- drivers/scsi/qla2xxx/qla_inline.h | 2 - drivers/scsi/qla2xxx/qla_iocb.c | 112 +++++++++++++----- drivers/scsi/qla2xxx/qla_mbx.c | 77 ++++++++++--- drivers/scsi/qla2xxx/qla_nvme.c | 15 ++- drivers/scsi/qla2xxx/qla_nvme.h | 2 +- drivers/scsi/qla2xxx/qla_os.c | 32 ++++-- drivers/scsi/qla2xxx/tcm_qla2xxx.c | 3 - 12 files changed, 413 insertions(+), 126 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index d1ff1b8f1ae5..a03e12797f30 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -398,6 +398,8 @@ struct srb_iocb { struct completion comp; struct els_plogi_payload *els_plogi_pyld; struct els_plogi_payload *els_resp_pyld; + u32 tx_size; + u32 rx_size; dma_addr_t els_plogi_pyld_dma; dma_addr_t els_resp_pyld_dma; uint32_t fw_status[3]; @@ -2312,6 +2314,7 @@ enum fcport_mgt_event { FCME_ADISC_DONE, FCME_GNNID_DONE, FCME_GFPNID_DONE, + FCME_ELS_PLOGI_DONE, }; enum rscn_addr_format { @@ -2408,6 +2411,7 @@ typedef struct fc_port { struct ct_sns_desc ct_desc; enum discovery_state disc_state; enum login_state fw_login_state; + unsigned long dm_login_expire; unsigned long plogi_nack_done_deadline; u32 login_gen, last_login_gen; @@ -2418,7 +2422,8 @@ typedef struct fc_port { u8 iocb[IOCB_SIZE]; u8 current_login_state; u8 last_login_state; - struct completion n2n_done; + u16 n2n_link_reset_cnt; + u16 n2n_chip_reset; } fc_port_t; #define QLA_FCPORT_SCAN 1 @@ -3228,6 +3233,7 @@ enum qla_work_type { QLA_EVT_GFPNID, QLA_EVT_SP_RETRY, QLA_EVT_IIDMA, + QLA_EVT_ELS_PLOGI, }; @@ -3600,6 +3606,7 @@ struct qla_hw_data { uint32_t using_lr_setting:1; uint32_t rida_fmt2:1; uint32_t purge_mbox:1; + uint32_t n2n_bigger:1; } flags; uint16_t max_exchg; @@ -3908,6 +3915,9 @@ struct qla_hw_data { int exchoffld_size; int exchoffld_count; + /* n2n */ + struct els_plogi_payload plogi_els_payld; + void *swl; /* These are used by mailbox operations. */ diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h index 5d8688e5bc7c..50c1e6c62e31 100644 --- a/drivers/scsi/qla2xxx/qla_fw.h +++ b/drivers/scsi/qla2xxx/qla_fw.h @@ -1366,6 +1366,11 @@ struct vp_rpt_id_entry_24xx { /* format 1 fabric */ uint8_t vpstat1_subcode; /* vp_status=1 subcode */ uint8_t flags; +#define TOPO_MASK 0xE +#define TOPO_FL 0x2 +#define TOPO_N2N 0x4 +#define TOPO_F 0x6 + uint16_t fip_flags; uint8_t rsv2[12]; diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 6f2a37220a55..035ab18bd534 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -45,8 +45,7 @@ extern int qla2x00_fabric_login(scsi_qla_host_t *, fc_port_t *, uint16_t *); extern int qla2x00_local_device_login(scsi_qla_host_t *, fc_port_t *); extern int qla24xx_els_dcmd_iocb(scsi_qla_host_t *, int, port_id_t); -extern int qla24xx_els_dcmd2_iocb(scsi_qla_host_t *, int, fc_port_t *, - port_id_t); +extern int qla24xx_els_dcmd2_iocb(scsi_qla_host_t *, int, fc_port_t *, bool); extern void qla2x00_update_fcports(scsi_qla_host_t *); diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index af9a75df6700..3a93a9389a49 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -3384,19 +3384,40 @@ int qla24xx_post_gpnid_work(struct scsi_qla_host *vha, port_id_t *id) void qla24xx_sp_unmap(scsi_qla_host_t *vha, srb_t *sp) { - if (sp->u.iocb_cmd.u.ctarg.req) { - dma_free_coherent(&vha->hw->pdev->dev, - sizeof(struct ct_sns_pkt), - sp->u.iocb_cmd.u.ctarg.req, - sp->u.iocb_cmd.u.ctarg.req_dma); - sp->u.iocb_cmd.u.ctarg.req = NULL; - } - if (sp->u.iocb_cmd.u.ctarg.rsp) { - dma_free_coherent(&vha->hw->pdev->dev, - sizeof(struct ct_sns_pkt), - sp->u.iocb_cmd.u.ctarg.rsp, - sp->u.iocb_cmd.u.ctarg.rsp_dma); - sp->u.iocb_cmd.u.ctarg.rsp = NULL; + struct srb_iocb *c = &sp->u.iocb_cmd; + + switch (sp->type) { + case SRB_ELS_DCMD: + if (c->u.els_plogi.els_plogi_pyld) + dma_free_coherent(&vha->hw->pdev->dev, + c->u.els_plogi.tx_size, + c->u.els_plogi.els_plogi_pyld, + c->u.els_plogi.els_plogi_pyld_dma); + + if (c->u.els_plogi.els_resp_pyld) + dma_free_coherent(&vha->hw->pdev->dev, + c->u.els_plogi.rx_size, + c->u.els_plogi.els_resp_pyld, + c->u.els_plogi.els_resp_pyld_dma); + break; + case SRB_CT_PTHRU_CMD: + default: + if (sp->u.iocb_cmd.u.ctarg.req) { + dma_free_coherent(&vha->hw->pdev->dev, + sizeof(struct ct_sns_pkt), + sp->u.iocb_cmd.u.ctarg.req, + sp->u.iocb_cmd.u.ctarg.req_dma); + sp->u.iocb_cmd.u.ctarg.req = NULL; + } + + if (sp->u.iocb_cmd.u.ctarg.rsp) { + dma_free_coherent(&vha->hw->pdev->dev, + sizeof(struct ct_sns_pkt), + sp->u.iocb_cmd.u.ctarg.rsp, + sp->u.iocb_cmd.u.ctarg.rsp_dma); + sp->u.iocb_cmd.u.ctarg.rsp = NULL; + } + break; } sp->free(sp); diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 471322c29db6..f52c68b4da44 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -419,6 +419,19 @@ void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea) __qla24xx_handle_gpdb_event(vha, ea); } +int qla_post_els_plogi_work(struct scsi_qla_host *vha, fc_port_t *fcport) +{ + struct qla_work_evt *e; + + e = qla2x00_alloc_work(vha, QLA_EVT_ELS_PLOGI); + if (!e) + return QLA_FUNCTION_FAILED; + + e->u.fcport.fcport = fcport; + fcport->flags |= FCF_ASYNC_ACTIVE; + return qla2x00_post_work(vha, e); +} + static void qla2x00_async_adisc_sp_done(void *ptr, int res) { @@ -467,6 +480,8 @@ qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport, lio = &sp->u.iocb_cmd; lio->timeout = qla2x00_async_iocb_timeout; + sp->gen1 = fcport->rscn_gen; + sp->gen2 = fcport->login_gen; qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); sp->done = qla2x00_async_adisc_sp_done; @@ -560,12 +575,17 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, loop_id = le16_to_cpu(e->nport_handle); loop_id = (loop_id & 0x7fff); + if (fcport->fc4f_nvme) + current_login_state = e->current_login_state >> 4; + else + current_login_state = e->current_login_state & 0xf; + ql_dbg(ql_dbg_disc, vha, 0x20e2, - "%s found %8phC CLS [%d|%d] ID[%02x%02x%02x|%02x%02x%02x] lid[%d|%d]\n", + "%s found %8phC CLS [%x|%x] nvme %d ID[%02x%02x%02x|%02x%02x%02x] lid[%d|%d]\n", __func__, fcport->port_name, e->current_login_state, fcport->fw_login_state, - id.b.domain, id.b.area, id.b.al_pa, + fcport->fc4f_nvme, id.b.domain, id.b.area, id.b.al_pa, fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa, loop_id, fcport->loop_id); @@ -574,9 +594,13 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, case DSC_DELETED: break; default: - if ((id.b24 != fcport->d_id.b24) || - ((fcport->loop_id != FC_NO_LOOP_ID) && - (fcport->loop_id != loop_id))) { + if ((id.b24 != fcport->d_id.b24 && + fcport->d_id.b24) || + (fcport->loop_id != FC_NO_LOOP_ID && + fcport->loop_id != loop_id)) { + ql_dbg(ql_dbg_disc, vha, 0x20e3, + "%s %d %8phC post del sess\n", + __func__, __LINE__, fcport->port_name); qlt_schedule_sess_for_deletion(fcport); return; } @@ -599,11 +623,6 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, fcport->login_pause = 1; } - if (fcport->fc4f_nvme) - current_login_state = e->current_login_state >> 4; - else - current_login_state = e->current_login_state & 0xf; - switch (vha->hw->current_topology) { default: switch (current_login_state) { @@ -632,6 +651,8 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, } break; case ISP_CFG_N: + fcport->fw_login_state = current_login_state; + fcport->d_id = id; switch (current_login_state) { case DSC_LS_PRLI_COMP: if ((e->prli_svc_param_word_3[0] & BIT_4) == 0) @@ -705,12 +726,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; @@ -1020,9 +1068,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; @@ -1164,8 +1212,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; @@ -1286,36 +1335,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: @@ -1429,6 +1518,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; @@ -1530,6 +1628,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; @@ -4160,7 +4261,8 @@ qla2x00_configure_hba(scsi_qla_host_t *vha) id.b.al_pa = al_pa; id.b.rsvd_1 = 0; spin_lock_irqsave(&ha->hardware_lock, flags); - qlt_update_host_map(vha, id); + if (!(topo == 2 && ha->flags.n2n_bigger)) + qlt_update_host_map(vha, id); spin_unlock_irqrestore(&ha->hardware_lock, flags); if (!vha->flags.init_done) @@ -4813,6 +4915,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; @@ -5105,9 +5232,19 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) fcport->deleted = 0; fcport->logout_on_delete = 1; fcport->login_retry = vha->hw->login_retry_count; + fcport->n2n_chip_reset = fcport->n2n_link_reset_cnt = 0; qla2x00_iidma_fcport(vha, fcport); + switch (vha->hw->current_topology) { + case ISP_CFG_N: + case ISP_CFG_NL: + fcport->keep_nport_handle = 1; + break; + default: + break; + } + if (fcport->fc4f_nvme) { qla_nvme_register_remote(vha, fcport); fcport->disc_state = DSC_LOGIN_COMPLETE; @@ -6992,6 +7129,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) & @@ -8076,6 +8216,9 @@ qla81xx_nvram_config(scsi_qla_host_t *vha) /* enable RIDA Format2 */ icb->firmware_options_3 |= BIT_0; + /* N2N: driver will initiate Login instead of FW */ + icb->firmware_options_3 |= BIT_8; + if (IS_QLA27XX(ha)) { icb->firmware_options_3 |= BIT_8; ql_dbg(ql_log_info, vha, 0x0075, diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h index acf6511e8ef7..a29f8898c687 100644 --- a/drivers/scsi/qla2xxx/qla_inline.h +++ b/drivers/scsi/qla2xxx/qla_inline.h @@ -280,8 +280,6 @@ qla2x00_init_timer(srb_t *sp, unsigned long tmo) init_completion(&sp->comp); if (IS_QLAFX00(sp->vha->hw) && (sp->type == SRB_FXIOCB_DCMD)) init_completion(&sp->u.iocb_cmd.u.fxiocb.fxiocb_comp); - if (sp->type == SRB_ELS_DCMD) - init_completion(&sp->u.iocb_cmd.u.els_logo.comp); add_timer(&sp->u.iocb_cmd.timer); } diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index ba14db8d0b8d..059f2c9dc192 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -2465,6 +2465,7 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *vha, int els_opcode, sp->fcport = fcport; elsio->timeout = qla2x00_els_dcmd_iocb_timeout; qla2x00_init_timer(sp, ELS_DCMD_TIMEOUT); + init_completion(&sp->u.iocb_cmd.u.els_logo.comp); sp->done = qla2x00_els_dcmd_sp_done; sp->free = qla2x00_els_dcmd_sp_free; @@ -2512,7 +2513,6 @@ qla24xx_els_logo_iocb(srb_t *sp, struct els_entry_24xx *els_iocb) { scsi_qla_host_t *vha = sp->vha; struct srb_iocb *elsio = &sp->u.iocb_cmd; - uint32_t dsd_len = 24; els_iocb->entry_type = ELS_IOCB_TYPE; els_iocb->entry_count = 1; @@ -2535,20 +2535,21 @@ qla24xx_els_logo_iocb(srb_t *sp, struct els_entry_24xx *els_iocb) els_iocb->control_flags = 0; if (elsio->u.els_logo.els_cmd == ELS_DCMD_PLOGI) { - els_iocb->tx_byte_count = sizeof(struct els_plogi_payload); + els_iocb->tx_byte_count = els_iocb->tx_len = + sizeof(struct els_plogi_payload); els_iocb->tx_address[0] = cpu_to_le32(LSD(elsio->u.els_plogi.els_plogi_pyld_dma)); els_iocb->tx_address[1] = cpu_to_le32(MSD(elsio->u.els_plogi.els_plogi_pyld_dma)); - els_iocb->tx_len = dsd_len; els_iocb->rx_dsd_count = 1; - els_iocb->rx_byte_count = sizeof(struct els_plogi_payload); + els_iocb->rx_byte_count = els_iocb->rx_len = + sizeof(struct els_plogi_payload); els_iocb->rx_address[0] = cpu_to_le32(LSD(elsio->u.els_plogi.els_resp_pyld_dma)); els_iocb->rx_address[1] = cpu_to_le32(MSD(elsio->u.els_plogi.els_resp_pyld_dma)); - els_iocb->rx_len = dsd_len; + ql_dbg(ql_dbg_io + ql_dbg_buffer, vha, 0x3073, "PLOGI ELS IOCB:\n"); ql_dump_buffer(ql_log_info, vha, 0x0109, @@ -2577,7 +2578,6 @@ qla2x00_els_dcmd2_iocb_timeout(void *data) fc_port_t *fcport = sp->fcport; struct scsi_qla_host *vha = sp->vha; struct qla_hw_data *ha = vha->hw; - struct srb_iocb *lio = &sp->u.iocb_cmd; unsigned long flags = 0; int res; @@ -2593,7 +2593,7 @@ qla2x00_els_dcmd2_iocb_timeout(void *data) (res == QLA_SUCCESS) ? "successful" : "failed"); spin_unlock_irqrestore(&ha->hardware_lock, flags); - complete(&lio->u.els_plogi.comp); + sp->done(sp, QLA_FUNCTION_TIMEOUT); } static void @@ -2603,17 +2603,54 @@ qla2x00_els_dcmd2_sp_done(void *ptr, int res) fc_port_t *fcport = sp->fcport; struct srb_iocb *lio = &sp->u.iocb_cmd; struct scsi_qla_host *vha = sp->vha; + struct event_arg ea; + struct qla_work_evt *e; + + ql_dbg(ql_dbg_disc, vha, 0x3072, + "%s ELS done rc %d hdl=%x, portid=%06x %8phC\n", + sp->name, res, sp->handle, fcport->d_id.b24, fcport->port_name); - ql_dbg(ql_dbg_io + ql_dbg_disc, vha, 0x3072, - "%s ELS hdl=%x, portid=%06x done %8phC\n", - sp->name, sp->handle, fcport->d_id.b24, fcport->port_name); + fcport->flags &= ~(FCF_ASYNC_SENT|FCF_ASYNC_ACTIVE); + del_timer(&sp->u.iocb_cmd.timer); - complete(&lio->u.els_plogi.comp); + if (sp->flags & SRB_WAKEUP_ON_COMP) + complete(&lio->u.els_plogi.comp); + else { + if (res) { + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + } else { + memset(&ea, 0, sizeof(ea)); + ea.fcport = fcport; + ea.rc = res; + ea.event = FCME_ELS_PLOGI_DONE; + qla2x00_fcport_event_handler(vha, &ea); + } + + e = qla2x00_alloc_work(vha, QLA_EVT_UNMAP); + if (!e) { + struct srb_iocb *elsio = &sp->u.iocb_cmd; + + if (elsio->u.els_plogi.els_plogi_pyld) + dma_free_coherent(&sp->vha->hw->pdev->dev, + elsio->u.els_plogi.tx_size, + elsio->u.els_plogi.els_plogi_pyld, + elsio->u.els_plogi.els_plogi_pyld_dma); + + if (elsio->u.els_plogi.els_resp_pyld) + dma_free_coherent(&sp->vha->hw->pdev->dev, + elsio->u.els_plogi.rx_size, + elsio->u.els_plogi.els_resp_pyld, + elsio->u.els_plogi.els_resp_pyld_dma); + sp->free(sp); + } + e->u.iosb.sp = sp; + qla2x00_post_work(vha, e); + } } int qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, - fc_port_t *fcport, port_id_t remote_did) + fc_port_t *fcport, bool wait) { srb_t *sp; struct srb_iocb *elsio = NULL; @@ -2641,9 +2678,13 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, elsio->timeout = qla2x00_els_dcmd2_iocb_timeout; init_completion(&elsio->u.els_plogi.comp); - qla2x00_init_timer(sp, ELS_DCMD_TIMEOUT); + if (wait) + sp->flags = SRB_WAKEUP_ON_COMP; + + qla2x00_init_timer(sp, ELS_DCMD_TIMEOUT + 2); sp->done = qla2x00_els_dcmd2_sp_done; + elsio->u.els_plogi.tx_size = elsio->u.els_plogi.rx_size = DMA_POOL_SIZE; ptr = elsio->u.els_plogi.els_plogi_pyld = dma_alloc_coherent(&ha->pdev->dev, DMA_POOL_SIZE, @@ -2668,33 +2709,52 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, memset(ptr, 0, sizeof(struct els_plogi_payload)); memset(resp_ptr, 0, sizeof(struct els_plogi_payload)); + memcpy(elsio->u.els_plogi.els_plogi_pyld->data, + &ha->plogi_els_payld.data, + sizeof(elsio->u.els_plogi.els_plogi_pyld->data)); + elsio->u.els_plogi.els_cmd = els_opcode; elsio->u.els_plogi.els_plogi_pyld->opcode = els_opcode; - qla24xx_get_port_login_templ(vha, ptr_dma + 4, - &elsio->u.els_plogi.els_plogi_pyld->data[0], - sizeof(struct els_plogi_payload)); - ql_dbg(ql_dbg_io + ql_dbg_buffer, vha, 0x3073, "PLOGI buffer:\n"); - ql_dump_buffer(ql_dbg_io + ql_dbg_buffer, vha, 0x0109, + ql_dbg(ql_dbg_disc + ql_dbg_buffer, vha, 0x3073, "PLOGI buffer:\n"); + ql_dump_buffer(ql_dbg_disc + ql_dbg_buffer, vha, 0x0109, (uint8_t *)elsio->u.els_plogi.els_plogi_pyld, 0x70); rval = qla2x00_start_sp(sp); if (rval != QLA_SUCCESS) { rval = QLA_FUNCTION_FAILED; - goto out; + } else { + ql_dbg(ql_dbg_disc, vha, 0x3074, + "%s PLOGI sent, hdl=%x, loopid=%x, to port_id %06x from port_id %06x\n", + sp->name, sp->handle, fcport->loop_id, + fcport->d_id.b24, vha->d_id.b24); } - ql_dbg(ql_dbg_io, vha, 0x3074, - "%s PLOGI sent, hdl=%x, loopid=%x, portid=%06x\n", - sp->name, sp->handle, fcport->loop_id, fcport->d_id.b24); - - wait_for_completion(&elsio->u.els_plogi.comp); + if (wait) { + wait_for_completion(&elsio->u.els_plogi.comp); - if (elsio->u.els_plogi.comp_status != CS_COMPLETE) - rval = QLA_FUNCTION_FAILED; + if (elsio->u.els_plogi.comp_status != CS_COMPLETE) + rval = QLA_FUNCTION_FAILED; + } else { + goto done; + } out: + fcport->flags &= ~(FCF_ASYNC_SENT); + if (elsio->u.els_plogi.els_plogi_pyld) + dma_free_coherent(&sp->vha->hw->pdev->dev, + elsio->u.els_plogi.tx_size, + elsio->u.els_plogi.els_plogi_pyld, + elsio->u.els_plogi.els_plogi_pyld_dma); + + if (elsio->u.els_plogi.els_resp_pyld) + dma_free_coherent(&sp->vha->hw->pdev->dev, + elsio->u.els_plogi.rx_size, + elsio->u.els_plogi.els_resp_pyld, + elsio->u.els_plogi.els_resp_pyld_dma); + sp->free(sp); +done: return rval; } diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 10847cdca093..7c07a939cf15 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -59,6 +59,7 @@ static struct rom_cmd { { MBC_IOCB_COMMAND_A64 }, { MBC_GET_ADAPTER_LOOP_ID }, { MBC_READ_SFP }, + { MBC_GET_RNID_PARAMS }, }; static int is_rom_cmd(uint16_t cmd) @@ -3842,30 +3843,68 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, "Format 1: WWPN %8phC.\n", vha->port_name); - /* N2N. direct connect */ - if (IS_QLA27XX(ha) && - ((rptid_entry->u.f1.flags>>1) & 0x7) == 2) { - /* if our portname is higher then initiate N2N login */ - if (wwn_to_u64(vha->port_name) > - wwn_to_u64(rptid_entry->u.f1.port_name)) { - // ??? qlt_update_host_map(vha, id); - vha->n2n_id = 0x1; - ql_dbg(ql_dbg_async, vha, 0x5075, - "Format 1: Setting n2n_update_needed for id %d\n", - vha->n2n_id); + switch (rptid_entry->u.f1.flags & TOPO_MASK) { + case TOPO_N2N: + ha->current_topology = ISP_CFG_N; + spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); + fcport = qla2x00_find_fcport_by_wwpn(vha, + rptid_entry->u.f1.port_name, 1); + spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); + + if (fcport) { + fcport->plogi_nack_done_deadline = jiffies + HZ; + fcport->dm_login_expire = jiffies + 3*HZ; + fcport->scan_state = QLA_FCPORT_FOUND; + switch (fcport->disc_state) { + case DSC_DELETED: + set_bit(RELOGIN_NEEDED, + &vha->dpc_flags); + break; + case DSC_DELETE_PEND: + break; + default: + qlt_schedule_sess_for_deletion(fcport); + break; + } } else { - ql_dbg(ql_dbg_async, vha, 0x5075, - "Format 1: Remote login - Waiting for WWPN %8phC.\n", - rptid_entry->u.f1.port_name); + id.b24 = 0; + if (wwn_to_u64(vha->port_name) > + wwn_to_u64(rptid_entry->u.f1.port_name)) { + vha->d_id.b24 = 0; + vha->d_id.b.al_pa = 1; + ha->flags.n2n_bigger = 1; + + id.b.al_pa = 2; + ql_dbg(ql_dbg_async, vha, 0x5075, + "Format 1: assign local id %x remote id %x\n", + vha->d_id.b24, id.b24); + } else { + ql_dbg(ql_dbg_async, vha, 0x5075, + "Format 1: Remote login - Waiting for WWPN %8phC.\n", + rptid_entry->u.f1.port_name); + ha->flags.n2n_bigger = 0; + } + qla24xx_post_newsess_work(vha, &id, + rptid_entry->u.f1.port_name, + rptid_entry->u.f1.node_name, + NULL, + FC4_TYPE_UNKNOWN); } - memcpy(vha->n2n_port_name, rptid_entry->u.f1.port_name, - WWN_SIZE); + /* if our portname is higher then initiate N2N login */ + set_bit(N2N_LOGIN_NEEDED, &vha->dpc_flags); - set_bit(REGISTER_FC4_NEEDED, &vha->dpc_flags); - set_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags); ha->flags.n2n_ae = 1; return; + break; + case TOPO_FL: + ha->current_topology = ISP_CFG_FL; + break; + case TOPO_F: + ha->current_topology = ISP_CFG_F; + break; + default: + break; } ha->flags.gpsc_supported = 1; @@ -4681,7 +4720,7 @@ qla24xx_get_port_login_templ(scsi_qla_host_t *vha, dma_addr_t buf_dma, "Done %s.\n", __func__); bp = (uint32_t *) buf; for (i = 0; i < (bufsiz-4)/4; i++, bp++) - *bp = cpu_to_be32(*bp); + *bp = le32_to_cpu(*bp); } return rval; diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index c5a963c2c86e..20d9dc39f0fb 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -30,6 +30,9 @@ int qla_nvme_register_remote(struct scsi_qla_host *vha, struct fc_port *fcport) return 0; } + if (!vha->nvme_local_port && qla_nvme_register_hba(vha)) + return 0; + if (!(fcport->nvme_prli_service_param & (NVME_PRLI_SP_TARGET | NVME_PRLI_SP_DISCOVERY)) || (fcport->nvme_flag & NVME_FLAG_REGISTERED)) @@ -676,15 +679,15 @@ void qla_nvme_delete(struct scsi_qla_host *vha) } } -void qla_nvme_register_hba(struct scsi_qla_host *vha) +int qla_nvme_register_hba(struct scsi_qla_host *vha) { struct nvme_fc_port_template *tmpl; struct qla_hw_data *ha; struct nvme_fc_port_info pinfo; - int ret; + int ret = EINVAL; if (!IS_ENABLED(CONFIG_NVME_FC)) - return; + return ret; ha = vha->hw; tmpl = &qla_nvme_fc_transport; @@ -711,7 +714,9 @@ void qla_nvme_register_hba(struct scsi_qla_host *vha) if (ret) { ql_log(ql_log_warn, vha, 0xffff, "register_localport failed: ret=%x\n", ret); - return; + } else { + vha->nvme_local_port->private = vha; } - vha->nvme_local_port->private = vha; + + return ret; } diff --git a/drivers/scsi/qla2xxx/qla_nvme.h b/drivers/scsi/qla2xxx/qla_nvme.h index 816854ada654..4941d107fb1c 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.h +++ b/drivers/scsi/qla2xxx/qla_nvme.h @@ -142,7 +142,7 @@ struct pt_ls4_rx_unsol { /* * Global functions prototype in qla_nvme.c source file. */ -void qla_nvme_register_hba(struct scsi_qla_host *); +int qla_nvme_register_hba(struct scsi_qla_host *); int qla_nvme_register_remote(struct scsi_qla_host *, struct fc_port *); void qla_nvme_delete(struct scsi_qla_host *); void qla_nvme_abort(struct qla_hw_data *, struct srb *sp, int res); diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 48d1003c8178..15b63136961c 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -4789,7 +4789,6 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) struct qlt_plogi_ack_t *pla = (struct qlt_plogi_ack_t *)e->u.new_sess.pla; uint8_t free_fcport = 0; - u64 wwn; ql_dbg(ql_dbg_disc, vha, 0xffff, "%s %d %8phC enter\n", @@ -4817,10 +4816,10 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) fcport->d_id = e->u.new_sess.id; fcport->flags |= FCF_FABRIC_DEVICE; fcport->fw_login_state = DSC_LS_PLOGI_PEND; - if (e->u.new_sess.fc4_type & FS_FC4TYPE_FCP) + if (e->u.new_sess.fc4_type == FS_FC4TYPE_FCP) fcport->fc4_type = FC4_TYPE_FCP_SCSI; - if (e->u.new_sess.fc4_type & FS_FC4TYPE_NVME) { + if (e->u.new_sess.fc4_type == FS_FC4TYPE_NVME) { fcport->fc4_type = FC4_TYPE_OTHER; fcport->fc4f_nvme = FC4_TYPE_NVME; } @@ -4862,9 +4861,6 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); if (fcport) { - if (N2N_TOPO(vha->hw)) - fcport->flags &= ~FCF_FABRIC_DEVICE; - fcport->id_changed = 1; fcport->scan_state = QLA_FCPORT_FOUND; memcpy(fcport->node_name, e->u.new_sess.node_name, WWN_SIZE); @@ -4925,12 +4921,22 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) if (dfcp) qlt_schedule_sess_for_deletion(tfcp); - wwn = wwn_to_u64(fcport->node_name); - if (!wwn) - qla24xx_async_gnnid(vha, fcport); - else - qla24xx_async_gnl(vha, fcport); + if (N2N_TOPO(vha->hw)) + fcport->flags &= ~FCF_FABRIC_DEVICE; + + if (N2N_TOPO(vha->hw)) { + if (vha->flags.nvme_enabled) { + fcport->fc4f_nvme = 1; + fcport->n2n_flag = 1; + } + fcport->fw_login_state = 0; + /* + * wait link init done before sending login + */ + } else { + qla24xx_fcport_handle_login(vha, fcport); + } } } @@ -5065,6 +5071,10 @@ qla2x00_do_work(struct scsi_qla_host *vha) case QLA_EVT_IIDMA: qla_do_iidma_work(vha, e->u.fcport.fcport); break; + case QLA_EVT_ELS_PLOGI: + qla24xx_els_dcmd2_iocb(vha, ELS_DCMD_PLOGI, + e->u.fcport.fcport, false); + break; } if (e->flags & QLA_EVT_FLAG_FREE) kfree(e); diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index cfb5d6067f9f..5daa8832e389 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c @@ -1620,9 +1620,6 @@ static void tcm_qla2xxx_update_sess(struct fc_port *sess, port_id_t s_id, sess->conf_compl_supported = conf_compl_supported; - /* Reset logout parameters to default */ - sess->logout_on_delete = 1; - sess->keep_nport_handle = 0; } /* From patchwork Thu Aug 2 20:16:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10554177 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 053511708 for ; Thu, 2 Aug 2018 20:17:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E584C2C444 for ; Thu, 2 Aug 2018 20:17:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9E522C459; Thu, 2 Aug 2018 20:17:23 +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 3F01F2C451 for ; Thu, 2 Aug 2018 20:17:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730431AbeHBWKC (ORCPT ); Thu, 2 Aug 2018 18:10:02 -0400 Received: from mail-bn3nam01on0058.outbound.protection.outlook.com ([104.47.33.58]:43776 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729623AbeHBWKB (ORCPT ); Thu, 2 Aug 2018 18:10: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=UBZ/XzhE85PT5vXiJ68SSPjTSlXrnopp4jPhQ1U0XQU=; b=F+fJjvt3pHA41w9AvU8sRfRgc6t0qrMz5BjZfWTqVog7m1Hp1RMf8OkYQhMRDVbOsZESToQUlzOmv5NMgs0T/zXKQakw9esl5gtNaPjp58ZT/l1D3IPTzmVR99ShaR1gl4kvDKUtAxIc/aaMCPHnrlPlmnrsC9XlgOslm25Qn6U= Received: from BYAPR07CA0004.namprd07.prod.outlook.com (2603:10b6:a02:bc::17) 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.995.21; Thu, 2 Aug 2018 20:17:16 +0000 Received: from BY2NAM05FT024.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::209) by BYAPR07CA0004.outlook.office365.com (2603:10b6:a02:bc::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.14 via Frontend Transport; Thu, 2 Aug 2018 20:17:16 +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 BY2NAM05FT024.mail.protection.outlook.com (10.152.100.161) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Thu, 2 Aug 2018 20:17:16 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Thu, 2 Aug 2018 13:17:02 -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 w72KH1Vm008002; Thu, 2 Aug 2018 13:17:01 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w72KH1NO008001; Thu, 2 Aug 2018 13:17:01 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 16/16] qla2xxx: Update driver version to 10.00.00.08-k Date: Thu, 2 Aug 2018 13:16:58 -0700 Message-ID: <20180802201658.7903-17-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180802201658.7903-1-himanshu.madhani@cavium.com> References: <20180802201658.7903-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)(199004)(189003)(16586007)(2906002)(476003)(5660300001)(51416003)(1076002)(4326008)(106466001)(356003)(478600001)(87636003)(14444005)(72206003)(76176011)(110136005)(81156014)(86362001)(50226002)(106002)(50466002)(305945005)(47776003)(446003)(6666003)(2616005)(80596001)(54906003)(486006)(336012)(126002)(48376002)(8676002)(81166006)(8936002)(42186006)(26005)(186003)(44832011)(36756003)(69596002)(316002)(11346002);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;BY2NAM05FT024;1:4Dl3hFfuGZiERtNawl6gwCUHxnW2Znoi9N9CGUxQsZRSRdYOLr1BwI2f4cl1mpC2FXmZter7uXD6rKOtPZIdAXohb/vl+3q7XdvfYrNGofFSov1R2peHfqURgpfhvQ/S X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e0c3553e-bf38-43b1-c3eb-08d5f8b4f106 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM2PR0701MB1391; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1391;3:f7njLq8Ej/K7varw0f1lDgu3NEaTvQU9nD3z7ifJX1fTvMSIai5jhNQhCepLQ6rjPipwF2yXJMj8xmNlE1O27AyOX/CFr26ayc0o5g4yaXWnIxgimbGq2WbbJYX3sJwubXYxQUjUGZ0nXT77X2PmB0seP1KKbkvRQEozGusc+zYT7XK4pSESuaj+GTfGlMlr4SAE9QlBEq8zHG7uqb+boqUGYbXOu19bx/bdLtMfeZ6ClvpHxByZ6WetrJdJEEt6z3E74axfQ9PDOL6FXpiAl/mlZJrFu2QL1fGMlk0pVq2zMA9poeCbzESsInKYZssZdf7dBO7re4VApPz3oZ6Pvlib5LMfpoEAgqSNkRpqBlM=;25:MpA1fIJdSAq/vcoWz/fcZmLHytExxnysaIDspQJUT55P0chTziyuENM2x3oDLZKv2CR5BJ4xxmVScb9Dc4zEh75tvAfQLhc+lXq9JOjnogGmMwZSNi3D8KmlVPOV1rySRv6NIx2Ka7C0knOUqaWQH5fwiYK42ZBrY6gsc9hGlQp5mkdh2PAVokWxWCUe1HtQcmCOaGjh5QI+XOSBHbVetubVkUw4D27yUOOYRqBeXH7YCs4O2IlvUp9oI2MFRjm8u+py58GKx2jgLv0dpIpmA+u2CdxMFbgRviV915PfdG9xhmDxzZMGprGFLwnU8VkpRJBjfA5sVd98l1ynGSGb+w== X-MS-TrafficTypeDiagnostic: DM2PR0701MB1391: X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1391;31:Ijp4m27A7fLqHYlIoLXQUFi2UKO7VtXSh4jTO2vneI7mfIBNeBzs2nE9J8yt21kyZcG/VG0G+bobdSZcFbhW4JrNKG2b13qJ+yzpr4eVfIpxjXbDj4jPgFVGRxvia8F2obJewgj1AH9NOTuEKZU3A8AkWSpAOhvE5qXlWC7IdQDuP5FLT9c18iDpcP/tFBFezxr7aqOc0vmdzDIRKBMcLo20R1cO/w13eT5ll63B+jc=;20:zft89VgxFzFAVOCmqPSTRjmt9nrlmBXBZBJyKVWzGVwvRLwewNRCCYUHievpXoOyUrl/49i2wfeWCDCt2miFR65C/zBJ/Qjc+Pq7Y28wP8TbObKQAWIUo6CJqxaOyMfeSrsIXzYbDKTwp78O2JJpZOYuHD2nrEicWausxljtCdewO9MsjDiNPIewJ69OyzaK3uXsuV8tgZ4I3tbZpqtpElTjkV8Wk6QFhKL57LxGdkxZi+CWFcu4yBCgABj0MVngwEXi4JI/DtZtw58wYkMa8s2vXqw2o4Y99Sr3aupQtPiY58y22VYGLutdLk0Pm27i64S0aHqeA5s2sjOCxrM9ER6KutJZ8ZuBnra+ElHx78clJ4aO7xrgyaIwaddCWnPEWR0EKPdrvPJTMsCDZ3EiT8vYVyjRqjirdSOyo2Gi5kmzmIsy7jWeQVoYc7G8Y+1X/87I3wLylVGDOjGXVLIT1ZnB5BKjS/Qbd1FLrNo64+IYCsqjyHeRrgxiuvOucOf2 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)(3002001)(93006095)(93004095)(10201501046)(149027)(150027)(6041310)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:DM2PR0701MB1391;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0701MB1391; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1391;4:rwsZFD+DSWOdpJkShTkufNzGhByKzc/P8u/wqmQGcvOivUBZtp17gcE7xzCPGVZ7IYtq2qHrnjYLxU5MVv17He2DYO0MbiWKW6n5LYuWqHFd0SfRfgQf7oDqG0uPUblOd8SqTRSXAO+E6cwA7S9jEQs2LlsjOaxdMRw3iDnRZZW7i1NfITa6mTc/jP3Fnc/hjh70zhkRZAS9iFddpku/bcQ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WGBw==;5:aLLzEhPdxAI0bCCmFf7lgyy7rSKWMdHkyvV+3DZHrAEvtmZukkhLehM35OufCM9Vtl7G2mYg2Z7yy3BwMZgf7YTcgJ+CxtTPLvz6eCrVOPC6p+3QHC3rZlptoWeFkwx0xYh38BFrcfrQguIW0gQpWE9h+rl7SpaJDus5nbCf9GI=;7:8xb/RGXEyQGJi88U8JgmDxp1LRJDE6foYLQPEriABQCtfhfM7fF+2ZpRXgrKPTAmLW2D8tuqliuNjRNEa9rIntaFVouJEjpTcWmQ09QIoeIpu5W0Mb6Nk6ME1fiNhdto7qpjMSxaMTuEQ5cKqdwkZQpqSdZ/VM4rR3+6p9ojjKSFpyAApJGiMECL2ggPEa80oNd7HcRb9QvSIVElRiNeuuNJ6D6MmJIoiJNrOTMwcUQAfOptLVq7p8OrZ92IyAF6 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 20:17:16.2159 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e0c3553e-bf38-43b1-c3eb-08d5f8b4f106 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 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