From patchwork Tue Nov 28 19:34:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10080957 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 2CB296056F for ; Tue, 28 Nov 2017 19:35:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D94529638 for ; Tue, 28 Nov 2017 19:35:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1280129651; Tue, 28 Nov 2017 19:35:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-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 A94EA29638 for ; Tue, 28 Nov 2017 19:35:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932176AbdK1Tfj (ORCPT ); Tue, 28 Nov 2017 14:35:39 -0500 Received: from mail-cys01nam02on0062.outbound.protection.outlook.com ([104.47.37.62]:41502 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932154AbdK1Tfa (ORCPT ); Tue, 28 Nov 2017 14:35:30 -0500 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=tZIwj9QWXGFh0ZxslFMn4VUqVXddpaVtQTqCTSGRsk4=; b=hpJZrTZhFK83eT3AHB+eXHLZbhYfS7brdDaZjN6QpxTyYEsi9AzoyBgtb1niId0Dg8lY4JkKQnDPi5CwkcElO3vUBikcLwUu2HDFMWTvnitFgvvkH0ccJ85h4B3xbBgDnaa6nURZNMKHD0u9sDnGMsp/atwRavIHRq59oCTGGLo= Received: from BY2PR07CA0098.namprd07.prod.outlook.com (2a01:111:e400:7bff::51) by SN4PR0701MB3821.namprd07.prod.outlook.com (2603:10b6:803:4e::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Tue, 28 Nov 2017 19:35:29 +0000 Received: from BY2FFO11OLC011.protection.gbl (2a01:111:f400:7c0c::127) by BY2PR07CA0098.outlook.office365.com (2a01:111:e400:7bff::51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.260.4 via Frontend Transport; Tue, 28 Nov 2017 19:35:28 +0000 Authentication-Results: spf=none (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: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BY2FFO11OLC011.mail.protection.outlook.com (10.1.15.22) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.218.12 via Frontend Transport; Tue, 28 Nov 2017 19:35:28 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 28 Nov 2017 11:35:07 -0800 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 vASJZ773013798; Tue, 28 Nov 2017 11:35:07 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id vASJZ7P8013797; Tue, 28 Nov 2017 11:35:07 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 17/22] qla2xxx: Clear loop id after delete Date: Tue, 28 Nov 2017 11:34:58 -0800 Message-ID: <20171128193503.13695-18-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171128193503.13695-1-himanshu.madhani@cavium.com> References: <20171128193503.13695-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)(6009001)(376002)(346002)(2980300002)(428002)(189002)(199003)(36756003)(105586002)(72206003)(50466002)(106466001)(48376002)(33646002)(87636003)(478600001)(5660300001)(51416003)(1076002)(305945005)(54906003)(189998001)(76176999)(110136005)(50226002)(8936002)(42186006)(50986999)(69596002)(16586007)(6666003)(81156014)(2906002)(81166006)(2950100002)(86362001)(8676002)(47776003)(80596001)(316002)(101416001)(4326008)(356003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN4PR0701MB3821; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; PTR:50-232-66-26-static.hfc.comcastbusiness.net; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC011; 1:pmfaSkXknW796TL2v6QcM64F0W9XhN6i6lyLnu2ea67/MQREKlg31Wl0JdYNEGPGH901tIGPn3Y+Vo/8Qe7aUYZs6Li2t5sVcq5Ll1rjWxIzzVROkrxdHhJoo3DSSosl X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b188b17f-63a3-476f-7523-08d536972e35 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603258); SRVR:SN4PR0701MB3821; X-Microsoft-Ex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0QBufl6D88E2Ct6GzGzen2p+i3/JHWwye5MjCYAn7MOMnSPCRJybiq5sZQ7NQaPX07esbWta7iegXYPrDv/3LvAiJpQEUsaEGW5ipAwsJ4/3KWTNOhiV9xkJEWL6BP4IHIThnmNNiIr471+a8ABZsb9LYcX3Bs6Nsdfu1k/LmPlaDpF9v3KweGINAedync74EnK2wk2r/9/bZtPy3tGbxRsHGn2QC2ou+/i4v/gh9/M/UR62LYfUUj7m7lZO7TBMNCL+hlHRUlpC0t0vpJ83wZqe9K5BjbO+VgAMubnXT+NzD+d2AT2WrttFiqrGkdqTPFPxi5hFl25pw/au+g/tB+S3mceaw8Jm8VjvpLoxjhlY6NXbOti2DGQsj5LqZEmXClpbHhSl/2pmdIzeE4bG3OA79Um0/xBPQkYiVM4SHax46PHqBJbd8+A8Jsk5rDS8mqaI1fHhKYu7WFMGyOWwMkXlOxHf8SeM2vNodjBxhIZEio/4Y98bc X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231022)(6041248)(20161123564025)(20161123555025)(20161123558100)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:SN4PR0701MB3821; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SN4PR0701MB3821; X-Microsoft-Exchange-Diagnostics: 1; SN4PR0701MB3821; 4:Z7WzVxm93eqOqMay1H4fUF7qcSP3Jb+9jgRf5Mx6TPHs7FvcrFHBQGS3z4+90tctx/I4pG7TgulB8uvTMOstyh37YRteAHuGWR0ChPxwu8wLFkSanwq9GjS+arxI+CHUfuiTCKgo8b1WxCaVTd/MFIu2rgnt8oQuOBgWRM3IYwx5tNPoH17W6OhUFZQ/Jo+cDbhMAt0usqEZlm9t3CIqM34+EpmE4f1vdh2WOlhb3CRpYDjOA3eKjwXQumem30ohA3HYJokQeCGoMid1+B4w3mKsG7Z+IhPDVz0nq4ntlm1Wnx06/MERuY6WuyKI3LR4 X-Forefront-PRVS: 0505147DDB X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN4PR0701MB3821; 23:SNMB5cHrgTOIu42BNPwZsh0wTawq5kbg/6vJQnb?= =?us-ascii?Q?p0KfA4nVqg1IX22GXVgBW3lvS1C3ddz4tWPK7MjAHDrciS8DxAgHZkFayMZ4?= =?us-ascii?Q?2d2JoNnCRaozmY7uQCKzXFtCMVy6bv0otoIPTWViTMw7zNy3gY8NtQndSKmX?= =?us-ascii?Q?rV1jN+ZeZBjbq62yd8qCuKAGt6YdrXWiVjK3fm9jNqxozjeQJfJY5aWSGp+j?= =?us-ascii?Q?8RmqTzqgvV2QHOKf7+3u3u4pz9F1V5waaKlthaSoI9r607mY68KxHaNJILoI?= =?us-ascii?Q?3yGJI/bHa5guff+3yMB25otXVl+0/hjq+/w55xm3Wx+499gekm4wq3poCi6a?= =?us-ascii?Q?9T3FdT5gLFnM0Yu9v5EMvo52QeQDMzmL8KR6RUdFqncXCNCGN6DO+y5hur41?= =?us-ascii?Q?q8Gw69X79A0uKhfTBXS76+gzlcnFI14zF0Gup269DxBsFS2Bm8fFIJy3lX13?= =?us-ascii?Q?lY626WNlYZB3I/aeJHxClcYBltUjmyuYJMiJF18VMIG2B/G33IDHj4xcMC4j?= =?us-ascii?Q?potU7hrWuZuggFCjzRsVu+izO+G7WhsJK/2CslE0XxYVMSRyBIqTF8CAkUlm?= =?us-ascii?Q?6bSNT8azvTBYfftN9R+Rvv00PXqS12aufR0sudg4MmUzehQheOVCOfuGrp7h?= =?us-ascii?Q?hWJCvMcKPqYP4KEMbOl3jU176WYVDKBVtgy2jMUjywYLWHWS6X30wHipoQyL?= =?us-ascii?Q?l2RYdzEXZpcynWhM7XtDQIODnyiRAGV3jI86Ib/1HRymA1Cx9YQ5uqgLG+vb?= =?us-ascii?Q?zo4CHDVg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lV5EEdY6so6gaOEPEEq0vziISv6pMQWSbDdTIjwss6rMlzOpQasseSIx4UcXN7AcTfE4rTykwS2anMuiQSPybCaoY00NToE01IInTmFjTLr1wwMqSiJXJ3AMIVdstfBQW3p/VJqcPSHymdgJbkKwSIHO5/Be+x0FqLzJfl1ic6jWQ24jkqWKG SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2017 19:35:28.3982 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b188b17f-63a3-476f-7523-08d536972e35 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: SN4PR0701MB3821 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 clear loop id after delete to prevent session invalidation of stale session. Fixes: 726b85487067d ("qla2xxx: Add framework for async fabric discovery") Cc: # 4.10+ Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_target.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 1c219998ab60..0c0453f2ca9e 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -986,7 +986,7 @@ static void qlt_free_session_done(struct work_struct *work) sess->send_els_logo = 0; } - if (sess->logout_on_delete) { + if (sess->logout_on_delete && sess->loop_id != FC_NO_LOOP_ID) { int rc; rc = qla2x00_post_async_logout_work(vha, sess, NULL); @@ -1045,8 +1045,7 @@ static void qlt_free_session_done(struct work_struct *work) sess->login_succ = 0; } - if (sess->chip_reset != ha->base_qpair->chip_reset) - qla2x00_clear_loop_id(sess); + qla2x00_clear_loop_id(sess); if (sess->conflict) { sess->conflict->login_pause = 0; @@ -4600,9 +4599,9 @@ qlt_find_sess_invalidate_other(scsi_qla_host_t *vha, uint64_t wwn, "Invalidating sess %p loop_id %d wwn %llx.\n", other_sess, other_sess->loop_id, other_wwn); - other_sess->keep_nport_handle = 1; - *conflict_sess = other_sess; + if (other_sess->disc_state != DSC_DELETED) + *conflict_sess = other_sess; qlt_schedule_sess_for_deletion(other_sess, true); }