From patchwork Wed Mar 21 06:09:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10298625 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 61E29600CC for ; Wed, 21 Mar 2018 06:10:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52A5A29716 for ; Wed, 21 Mar 2018 06:10:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46FEA2971E; Wed, 21 Mar 2018 06:10: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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFE4529716 for ; Wed, 21 Mar 2018 06:10:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751689AbeCUGKF (ORCPT ); Wed, 21 Mar 2018 02:10:05 -0400 Received: from mail-sn1nam01on0064.outbound.protection.outlook.com ([104.47.32.64]:53072 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751522AbeCUGJ4 (ORCPT ); Wed, 21 Mar 2018 02:09:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4zNEVWLvQIzcoWXCHYGvEMvH4tFKHXiq5In6rE6RdKw=; b=VLHyTpXNtt9yXGNrowln+AiAW3EVWP9pt3RvFC+ynBw1OjacBu+g6AoHy0iR/1/Rh9TEijc9N92s+W4FvGBQIisnp8TKJpoURnwP/5+WFdSQaqtL++yK5cJK5H51mnfuKW1k4VxzBytohJay+s+OlFqFnLPBHNxDOTCOwu6NPdU= Received: from CO2PR07CA0077.namprd07.prod.outlook.com (2603:10b6:100::45) by SN1PR0701MB2094.namprd07.prod.outlook.com (2a01:111:e400:5309::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.588.14; Wed, 21 Mar 2018 06:09:55 +0000 Received: from BL2FFO11OLC005.protection.gbl (2a01:111:f400:7c09::124) by CO2PR07CA0077.outlook.office365.com (2603:10b6:100::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.609.10 via Frontend Transport; Wed, 21 Mar 2018 06:09:55 +0000 Authentication-Results: spf=fail (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=cavium.com; Received-SPF: Fail (protection.outlook.com: domain of cavium.com does not designate 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 BL2FFO11OLC005.mail.protection.outlook.com (10.173.160.91) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.527.18 via Frontend Transport; Wed, 21 Mar 2018 06:09:55 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 20 Mar 2018 23:09:43 -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 w2L69hIe029527; Tue, 20 Mar 2018 23:09:43 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w2L69hxF029526; Tue, 20 Mar 2018 23:09:43 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v4 06/13] qla2xxx: Fix n2n_ae flag to prevent dev_loss on PDB change Date: Tue, 20 Mar 2018 23:09:34 -0700 Message-ID: <20180321060941.29468-7-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180321060941.29468-1-himanshu.madhani@cavium.com> References: <20180321060941.29468-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)(39380400002)(376002)(346002)(396003)(39860400002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(54906003)(110136005)(4326008)(575784001)(86362001)(26005)(72206003)(59450400001)(186003)(316002)(42186006)(85426001)(16586007)(336012)(87636003)(478600001)(47776003)(106466001)(48376002)(305945005)(356003)(2906002)(50466002)(80596001)(69596002)(6666003)(2950100002)(51416003)(76176011)(1076002)(36756003)(5660300001)(81166006)(81156014)(8676002)(8936002)(105606002)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0701MB2094; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Fail; PTR:50-232-66-26-static.hfc.comcastbusiness.net; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC005; 1:Ycqx0Tc0ddPomilRneWUVaQENgHNMdFQajyg8RrkMLoV5PHocxx+IvtoJPcVZMOW0E95faETTCC0ob7gmkE/FkNeDxhnwzA02Whj9RFbZRIapeJn8Zj4cadoCjRvdCPq X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 12dc97a2-b65c-43f0-64c0-08d58ef25e08 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:SN1PR0701MB2094; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0701MB2094; 3:TRNytq8lCrU680OS4CmP26EA1O92l76WTXYlO05FJdAD9s3K5G5LibVOduqUhVFbVmEfRmmy4qnfTkCK0WNYxoSIF/K9w+66wFg6vYDK7x7D4EROCSGFbnpvLAsPnI6mbhl2I/SWB9mXNHdbavmMXVtkiOBj5+Ytn93B0FC2M/7tHgVT436jPTFI4rBZ94tM4mjxeeCKxgSwJ40hY+Ew9+ZeWzg3YL393Yi6e8f0ZOltonu81db8iOCq2iIMc8MWRj8j5JDSgYNExUjhXTfu6TU6ZYQBJ7tcyvX8ETXr/1/3Msoy2V2p/1BdD4He06mSInwM0qgrqgxGgOUhbtYcZb0P8K/G9VzDRdDXw7a7xzE=; 25:ZgRYW0YByGxypUWDAL63Or60uD5qkPLohxfCOYl12Q61z9KVylNhJ6vvDA2eLUDnM5jlRHvstZwOqubjiP4FY/nybuCs4WOoSnImPhWxwtD448yj1XHCu/OqWE/7f1/636bgI4JqL0m+/pJO3+xlomHv8ygq/w96mkjBkta8f322bLsNplXL728pizhA3wbRTDfkWCNWWWkv5ClKIr+7UHptzhB6OCRr5x/HRz8lnM7Se4ouQlSwlitLE8mfucUOGRzruTjfjM1AnRz+uRjvDk404FacHMe5FB/rHcd9Ob6alkDgxb9MzLQjOdr1hvZchTYk/lEwelH6PKGF5jHiug== X-MS-TrafficTypeDiagnostic: SN1PR0701MB2094: X-Microsoft-Exchange-Diagnostics: 1; SN1PR0701MB2094; 31:42VkzcrBMc8Y7yAxdPuw/Ctfc/eG7SKZd0sLtWW0Eiz65y0ONMXt/DKv6Ye5+zonab/DCSZblFC95bOghIvHDVuHOCMmqbFsWRCifbtTBgm2lYhpEjIApaxmjjsYOX4gaJ845H29rl3Z7BpxsqfUBgrR9g5BPiwbhtUT6BvOZDesq91L0upbicXaAVYJz+aE0QbGcP3ulFEqIfcEQWx0ZLBLXRHkW1t/E55Feq8hvYs=; 20:WAngQ8m18/VElL/cOc4Wx56rlv97xSrjeVZXHPd5GQizAC687utdP2LcY0GhubLfzzdQVpak7p/HsoVpGUELJhbGBSnzb6NlXg+mEusb+K2cEGGhp/ifPnUq5QG/kihymnK4Xadr+jzCU+cqriod8EPOPKWjSJlCRxtAV+CfLnHXqXdtDg39MLt2OirTNbC75B2p6B0zHLQJrAXMk2yW6PqLWRc4Y3tOxFPsVXHxaFhbcst0nswQ3Pf49qk0B+1mP6Wd3dvPAGjwA66F4GZSLLxGoLiQHxA/VXNql9wVTnLzT0+isGImuNyQSTeES+Ir5bIc+ttBeDuMdVd1cCvVBbwQKKRXpZMegVTYEisLAMN7rp8Z63teT0glskox2qut0Mz7pkIZx9+XLr+GU7BqtujHzpTO2S2wGQDYqRLd7wSHOrLPDkg6smNNv06+1uVUUESEXg1+POuwbpX7jIdY+ypiACNsxylSARelXMqR6D+FhzkT4YeoHp3KTi+sLeLN X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501244)(52105095)(10201501046)(3002001)(6041310)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:SN1PR0701MB2094; BCL:0; PCL:0; RULEID:; SRVR:SN1PR0701MB2094; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0701MB2094; 4:S51Eoyxgxbp5xP34b+hLn66tHySDHjjL1KgMy4DkwOoHiCcTqWM9bmzITH5G3jx8o6Np7jROErmHFEF+bmUFLB1SLBCJmxCPHNkDt0nfoILF9a+imyn7lhrECW8HKKzZM1GEKdazAz1zzczdmAoOaHy5cKVytNmWNhWuT4lmJX2vd1umvOEY2xkjqrEudI8+P3goDOwOVndtJkh28T6xiGDSk97Zmk5lbn2TBvI4hAOb5tQYM4SauKCGW2q4rT3N8KF7uS7N+DmigIBA80uOPw== X-Forefront-PRVS: 0618E4E7E1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0701MB2094; 23:hXFZd3sjtaK+vEvr36zcuXyX2t27ydBMOrPuV+d?= =?us-ascii?Q?gqkA+SSg3aWMCgzNFDqhqR8BLjqOm1ClbWMvS34mBZOi6n86r/XSdd6aRvjH?= =?us-ascii?Q?XQtgMA7Vo/KAEJayRg8JgDbEIP3HCE3wbed9MhMZ8mJFAp5c7aP5S+uniFDI?= =?us-ascii?Q?jYjnU+37U1lY1kWO3ZuAjOaYlnYQoZ2D6VUAOPSAQ5RMbseY0sXBESDHE9iE?= =?us-ascii?Q?mz+GHYjFnkD5t/MrfhB1Upo3fOdkXKjSZh4+vcVw22pdzRckEG570NhCiHzb?= =?us-ascii?Q?OhDl9R6oeDI9mnyYOjIsLP8Hpx0Y8rYC3D9x0wJ2BDQyfzqiCYiggOw/KjFy?= =?us-ascii?Q?r1GwzjpvIANkJPVf43BHzCwFDyByJZdk59aG8qkbJ2gJvpKCa/CRTAQNGgAR?= =?us-ascii?Q?vHyMs6a/eF7YzKFPdMGN2HEQjxE3kZWN39yuklDC5Eprrw6kN+U7mM10vxV/?= =?us-ascii?Q?6p/vVzyepg1hDigyVbSo0TazC8+b/ylYH8yqVBUKxIjKqYAtwcfGog9sGM9R?= =?us-ascii?Q?sNw3cbgztghbQACCIPoMu0BU+YqplzZTRCuRHOA/9r6ryICXIEatoZHUe2GQ?= =?us-ascii?Q?WhicfHfrjS1H0qoNPpvjekJhL1hnXXHGJuBMHKTxb+zOKvAjCf71Xs1NLv8b?= =?us-ascii?Q?/oJkjT49u5S4EIRe+PDODX031b0EtmVtFRrNmaXzN+VUt9Zr22wGhYbHURPE?= =?us-ascii?Q?fhNf4vSLAyrDjnRI+FVts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3gnX+TZvffljgZ5WG5cmdZ80A5Q27dopaprX8sYxmhpUTj7uW2jxm+Z6baTFbU/uprwD1mqAfJ51/mAV6BBQ=; 5:9Gjm6zt6CytgI7Wy/3pLIK09wIvSMvXQ2Ait9zcBbpA5UIy2LkHqzfUmrGFIXjn5hynqLir1GgGTWW47UkhQSOSRficf7BAsPGF2TkxXEnEqFw3dON3YnBU60IcgFg39MqKWDTKhKzHdZlMPfdbY14dEGLoyqAepn7IF/KSXLSk=; 24:bIqP0F1A7oFN1gQ6052H/90XG8aJ3evuguvG2ji+afbe1mRgf+f5JIk4uIPWlyUCjEG9BKorYb6iTzXFIXamhvJKCGJUOiCwvRf/apcHPVk=; 7:0YlUDz3xL2cOSHx7iDP8K0BEBt2oBrZtUqnSwRZPQgeQSt4NbqlFqIUQE49ck4Q36VPjygZ0aIgSa+KmYO+weM+1UcGkSw4AsVV7HjE2f16TTTuMXO4FXH5l3xNTI8VftBx9/noUVOJ1fhVgeyEaVOpAbDWtGZ9ViQIvfSKeRKSEHPbcJtu3S8UXOUiF/VRSy7h8k02z/H8LBcuhNKjMA3aZrxvls+d5yyra7zAEMLPTsv9acXtW09ncfQnA61// SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2018 06:09:55.0199 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 12dc97a2-b65c-43f0-64c0-08d58ef25e08 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: SN1PR0701MB2094 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: Darren Trapp On a port db changes, this patch will set n2n_ae flag for N2N connection when requesting for Report ID Acquition MBX, instead of Loop Initialization or point to point asynchronous events. Signed-off-by: Darren Trapp Signed-off-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn --- drivers/scsi/qla2xxx/qla_def.h | 2 -- drivers/scsi/qla2xxx/qla_isr.c | 3 --- drivers/scsi/qla2xxx/qla_mbx.c | 3 +++ 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 56f78dce4d3c..cba749d27154 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -4281,8 +4281,6 @@ typedef struct scsi_qla_host { struct nvme_fc_local_port *nvme_local_port; struct completion nvme_del_done; struct list_head nvme_rport_list; - atomic_t nvme_active_aen_cnt; - uint16_t nvme_last_rptd_aen; uint16_t fcoe_vlan_id; uint16_t fcoe_fcf_idx; diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 93f2f1df7168..913cd6cf5907 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -767,7 +767,6 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) case MBA_LIP_OCCURRED: /* Loop Initialization Procedure */ ha->flags.lip_ae = 1; - ha->flags.n2n_ae = 0; ql_dbg(ql_dbg_async, vha, 0x5009, "LIP occurred (%x).\n", mb[1]); @@ -811,7 +810,6 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) case MBA_LOOP_DOWN: /* Loop Down Event */ SAVE_TOPO(ha); - ha->flags.n2n_ae = 0; ha->flags.lip_ae = 0; ha->current_topology = 0; @@ -885,7 +883,6 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) /* case MBA_DCBX_COMPLETE: */ case MBA_POINT_TO_POINT: /* Point-to-Point */ ha->flags.lip_ae = 0; - ha->flags.n2n_ae = 1; if (IS_QLA2100(ha)) break; diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 41b0ee47c6a1..735079ba691c 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -3747,6 +3747,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, id.b.area = rptid_entry->port_id[1]; id.b.al_pa = rptid_entry->port_id[0]; id.b.rsvd_1 = 0; + ha->flags.n2n_ae = 0; if (rptid_entry->format == 0) { /* loop */ @@ -3799,6 +3800,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, 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; } @@ -3875,6 +3877,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, vha->d_id.b.area = rptid_entry->port_id[1]; vha->d_id.b.al_pa = rptid_entry->port_id[0]; + ha->flags.n2n_ae = 1; spin_lock_irqsave(&ha->vport_slock, flags); qlt_update_vp_map(vha, SET_AL_PA); spin_unlock_irqrestore(&ha->vport_slock, flags);