From patchwork Thu Mar 15 03:34: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: 10283877 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 140C460291 for ; Thu, 15 Mar 2018 03:35:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04CAD287AD for ; Thu, 15 Mar 2018 03:35:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED0A628806; Thu, 15 Mar 2018 03:35:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 914D4287AD for ; Thu, 15 Mar 2018 03:35:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752007AbeCODf0 (ORCPT ); Wed, 14 Mar 2018 23:35:26 -0400 Received: from mail-sn1nam02on0050.outbound.protection.outlook.com ([104.47.36.50]:61152 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751613AbeCODfT (ORCPT ); Wed, 14 Mar 2018 23:35:19 -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=ZKesPTTGE1X/8z71KJz6yo7WtVOFPw4b2zSeBZRAnXM=; b=WI9gHlJRaf4bmnfh6+1yBFgeX+9Vk1MK7acSjUHGcb+y+oJKIYMsoeiZxqLx54ur7wMF1tkucPBDCo6ZWGcqtetWwFB6totn/QhNKvgbhin4iMcfbhwVq6kszRhJD5k6SaLv88+cZh/fgGGGDl2T9VJv5oJXg4QPGqsXZsq0ZC4= Received: from CO2PR07CA0079.namprd07.prod.outlook.com (2603:10b6:100::47) by BLUPR0701MB2082.namprd07.prod.outlook.com (2a01:111:e400:52f4::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.567.14; Thu, 15 Mar 2018 03:35:16 +0000 Received: from BY2FFO11OLC012.protection.gbl (2a01:111:f400:7c0c::171) by CO2PR07CA0079.outlook.office365.com (2603:10b6:100::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.588.14 via Frontend Transport; Thu, 15 Mar 2018 03:35:15 +0000 Authentication-Results: spf=fail (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; HansenPartnership.com; dkim=none (message not signed) header.d=none;HansenPartnership.com; 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 BY2FFO11OLC012.mail.protection.outlook.com (10.1.15.23) 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; Thu, 15 Mar 2018 03:35: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; Wed, 14 Mar 2018 20:35:06 -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 w2F3Z6Hd012687; Wed, 14 Mar 2018 20:35:06 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w2F3Z65L012686; Wed, 14 Mar 2018 20:35:06 -0700 From: Himanshu Madhani To: , , , , CC: , Subject: [PATCH v2 06/13] qla2xxx: Fix n2n_ae flag to prevent dev_loss on PDB change Date: Wed, 14 Mar 2018 20:34:57 -0700 Message-ID: <20180315033504.12628-7-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180315033504.12628-1-himanshu.madhani@cavium.com> References: <20180315033504.12628-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39850400004)(346002)(396003)(39380400002)(376002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(8676002)(72206003)(87636003)(42186006)(50226002)(81166006)(59450400001)(69596002)(16586007)(81156014)(36756003)(316002)(105606002)(76176011)(5660300001)(54906003)(106466001)(336012)(4326008)(80596001)(8936002)(50466002)(2950100002)(86362001)(6666003)(356003)(478600001)(85426001)(47776003)(48376002)(51416003)(575784001)(186003)(2201001)(2906002)(110136005)(1076002)(26005)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB2082; 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; BY2FFO11OLC012; 1:EDgU57mOd/7X0JgQkPdcJxsUhXYFY1jKBAHL0QQxe6DU3xN0wN94a/u7ummgJuxmTBneQDZPCLUfUcIyzWcwi5khXcxF/fuCQxltd1FgV8z4uj2u9j0/7Qk5U4z4bilp X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fe898466-8655-4e19-b1d6-08d58a25c444 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:BLUPR0701MB2082; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2082; 3:PP3NkMJX6KIHAb9npxEs8Lie4DqjOrh1j4DmL2y63b6o8vi7eq9B+IBMgdrsTBFvLven5KV71aT6tzGHAj7ab2CahRiJz91okf8b4rG0+SzubefCVccevElyvEWwGPwaGOZrg9rVHPweJYs4c3H24/nGqZpDsr7jSad6vM2JVaYcMuu9xvPQyrtcLy5AeSnfdt/3Rk2LMQVsf1+B/D9pZcfvdFe7uY3IWwpOWFRN3U7TXUWMJN+U9h+ori16sMNScpbBqyk+c95lWdkG4j1avjkyx+xv6uvEvms4SC2e/Fx4k1qlqCJLhXtklF1lXGAnqV6MUARK5RieBRAKi+PouRWOH3OmgSbuNtbTXGzbuDA=; 25:9/txt5HBDoSzhGQ268E4cdGX/qkIqb3K8eCCWQ2VlMqq+TP7V8S++P2o84xkOTUdNAbgZzUt+XICca3WIChx8o9gvRVCAe7RvtOouEMdMSNnVmP5yRU2dXOKoK5KFz6KUslZuRejxk3oCN8IU2+1E5K7GYF+bai+fBb9KyKE/Hsp1LT9Fs05Re+uNdxmEknXuA/43KFqGqs+UrMOmmmAgwk/CNvW2uPXbMNfRex+2TUoi1s1M3imuxOLXM2Sc71dAa+Z1AtdhCjXsmIumrx9E2L16LERoUWQfjtAUJ/MH+/masnYR9eG/9IacTQnw2BFyteDc/X4fay1FQWZVChJ1Q== X-MS-TrafficTypeDiagnostic: BLUPR0701MB2082: X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2082; 31:pVCwjz65Tbm2Mx2hTzd0WqVKF0GXNb9WrHOzPMkniAEMu73R09KUBDFSgyR45bA3xO4Pu47TcGQxD/qiDhaXlgA5uybdeTGdOzGlL0yoamw0ILoVrhsbGiKjR3wETUmZvLNWjcXCbtnmoNcNTzBjuVIzPk8LqiEOZDtaPqtoJ+T3MKDZsIb0tQI/rBqZyV1O22SjddhRz4Mr2e9LjFUCGgBlZkKmw1FEINMozqfOQCM=; 20:IiJkzLMtlsJ0TlBp/vg0k8x6bSPJ8rwetX+BkxK4CyEmGCjSTVCnBF3rJTWLDxGIe7vsgwhj9hVbYD5qepQAoAuZq2wipCjoNsEG1OnP/c650Am6SK3kSJA49/qmWgRJeg+l5hF8DkZbgHVlnHJqdrgdJdsuZCqJvYvlHEqf7xiKapC6ahy3RcZUavZl8dJo8Aa/jBv7ecHsTF3BbLBrLD5Lv+6sqb5L6cJawLhvfQK0tC4Ut+MC43yZJwCqcKYEz/j/3WG+edpnrJCQIoxdt+X0uwnNgDHK3LpSWGwfbAIoj6v8bsOTiADK0YZVi2+EUCn/sCasApQf2wNZ4C1GHL+IZuzntjuOPSgq6EynpPmB++MVgTzubKuct3bx2Rg9eoNvFnbCgtumB6AQRIcJp9Duf/mX9UUyJEqVBdM4oFI4ef+JNvLdDG1jRsN4FljaUWcryZz33yCXbWNGeZ3cmchzpvKEwL4qB83CX5WQLe3Ygkh/zzndNmz7IvYDrD2W X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231221)(944501244)(52105095)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:BLUPR0701MB2082; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB2082; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2082; 4:93WAzDGWPRCeTslcdP1MGJ98b9gMl2xfx7A21hXNAYp/KjiHNRl9qBENcl5rd40O4Z0We8c1aH8Pd/q+V2RaPOqgfcMhyey6qwtpnZtIgLjH/jZHvV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eC4Wmes4/zDfjt6?= =?us-ascii?Q?vMb1dse9QnvlHGA8zXmxa5tjxpx+K7ALIy8UEuaQnE2ISZMumdFD9cve8Ke7?= =?us-ascii?Q?AKCuvAuY3vLs++ankuWDG5/zDKRGmhgh992LmUS43HPJOsdYq5CzOtPra1JB?= =?us-ascii?Q?dpObKbVWpfLTrt80pxThqbxVVroV4f/wKffkC1EJ7O5VgK1+X0ZFqKOnrE2B?= =?us-ascii?Q?6joTX/5/W137i5UtEvSq4X6aNaYhIEd4xMDufp1iV/JnHSzfDdz3+qreqgzz?= =?us-ascii?Q?JuhvH0VocaYbHJoCPpe3vi/Y+aD58+xohrsI7rtoHnzOqKDTotle5heAA6eq?= =?us-ascii?Q?/eGHdobHaQTTImFXBcljMkBgltKELKsYXME6WEdPY/d0BQeozCCeKlSu/P7x?= =?us-ascii?Q?yMbkzykLlVrLGjn5VPp2kz1reqRn3xLni+V1prRsLytTnthOjIMy0HlxXXHi?= =?us-ascii?Q?+lnhxjkdEIcEUavZo4PqV6ITI4IeawbGmjGhGwYwdNC1ICjnqQ5VEMw=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Antispam-Message-Info: mp56lvo3V0pAE1q1rPcj/qNoQxz0GjpdcOVCBN8aOQfoW9gHPypBEjdjxhcJ5MW27HEnivmLQcwcatR7N3U17IcBfRLCf14NvJl6FwXoeBu4jFjzsEzN6DkG4FrWJ6rFBNqCnU09OH3I3jgxHVmE//9fucUPN+Y4/dU51DZ4ush5FYoEuoZYpA2xviGOQG1B X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2082; 6:zwvu8yiKZuQqeCHoNOXaSzwDz4chQ2GVBoAjl9Br39eOEPuvoYOYwc2MFEF/99VgIHkpUie+1MszLm8VXlWm1mHYymyaqoJc9/luxevSXAUN/YTYGuoaTcLznfWYZIQxzTISmyQ6AKNJtay2kJuBRo7KBIVmS31Xvz089k+e9PJRwdbU30xh04iyPvZS9hMFP1sTumQAyXC0qMVhPVx3rU0IpvxU+JYpBST4fCVyuP8H3XFjamtXaoogKP73wR3EoOZZofmQ4SMknFRudTvCviieQsTRpddyRdZyvHnn4DtzJYrvjwT0zRtRNWuKx8lhhqRnva2SHfkMk5pTJSsoJ2CEeNN1NYBnvv22rlkUxIU=; 5:v9ROovdfdd9NWQtZW69xm0tWNrO+/RMkRWjjf1d5S5xMETa1i3s4YmpiTOi2DUcvBDHPZkokJmHipu/O+Q622eIjqFt4yjzZbX/5IiZ3NVpIDLiil+sa5Q4fozjZN7bptgp6EW3V8YoJy+2J4tKrMtq/ZfrznrG26e1VQ8DVdKs=; 24:uRiXJE5eeaz2ZK1EIrvpAbHKT/ky93Sw/SEQSWygyEUlw8qC8NnnIkTgeSwYWVNl1Ht+mecshdU+06P0ImkAEMKXDRULLyUlMxJQRycEV8s=; 7:N4v5amdW3v/77ITKTToDi7KVV+2gQcOf0kfFC4e56IhpEquz12oUfKB3bkc7/R42ekUudBAm+6SKKlquJtal3CGktydfy02uVraleorN071XJU9oNJ1R3Ag7j8TDR0QuqHkbC11aqaZqzGDQT89Ed2JlzgOiVQMeTxD5AcVwlOwsVmWnVxYwBkBynlC/2wm9h9zGUHM9vxzyJU8Ce3wsjsGawZPcyQqqcWOVVAcKzVTt5tdwdOlS9K9D5vS9TAQe SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2018 03:35:15.2024 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fe898466-8655-4e19-b1d6-08d58a25c444 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: BLUPR0701MB2082 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 737492048d8a..745e6414b496 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -4282,8 +4282,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 011261a9d585..d973d0b5d8c3 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -768,7 +768,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]); @@ -812,7 +811,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; @@ -886,7 +884,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);