From patchwork Tue Nov 28 19:34:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10080939 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 AADB3602DC for ; Tue, 28 Nov 2017 19:35:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E097292E2 for ; Tue, 28 Nov 2017 19:35:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92C0529638; Tue, 28 Nov 2017 19:35: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=-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 2AF38292E2 for ; Tue, 28 Nov 2017 19:35:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754124AbdK1TfW (ORCPT ); Tue, 28 Nov 2017 14:35:22 -0500 Received: from mail-cys01nam02on0086.outbound.protection.outlook.com ([104.47.37.86]:30249 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752410AbdK1TfU (ORCPT ); Tue, 28 Nov 2017 14:35:20 -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=Tg01WS9rzE0LK/uacEkjBshjT/hT/TSC8voABI/xW24=; b=G8Yj6dkCOssLDqecZajGdTqsufOqIJOcoRt11MdEnpPnvo+q/xXxin2GSzpWvFqTWny/Ca8s2C4122JQWXH4TULiPiLLnEk5reluVV8Mt2gYkhhsK8apaouCiorQrm5qlv+hkHlb2/zRCgCWRldQSMPTulGnwc35qI0oNukc6lI= Received: from CO2PR07CA0043.namprd07.prod.outlook.com (2603:10b6:100::11) by SN4PR0701MB3824.namprd07.prod.outlook.com (2603:10b6:803:4f::11) 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:18 +0000 Received: from BY2FFO11FD017.protection.gbl (2a01:111:f400:7c0c::194) by CO2PR07CA0043.outlook.office365.com (2603:10b6:100::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.282.5 via Frontend Transport; Tue, 28 Nov 2017 19:35:17 +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 BY2FFO11FD017.mail.protection.outlook.com (10.1.14.105) 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:17 +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:05 -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 vASJZ5iP013766; Tue, 28 Nov 2017 11:35:05 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id vASJZ5Mw013765; Tue, 28 Nov 2017 11:35:05 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 09/22] qla2xxx: Fix NPIV host cleanup in target mode Date: Tue, 28 Nov 2017 11:34:50 -0800 Message-ID: <20171128193503.13695-10-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)(346002)(376002)(2980300002)(428002)(199003)(189002)(6666003)(4326008)(106466001)(80596001)(76176999)(69596002)(48376002)(50986999)(50466002)(54906003)(16586007)(110136005)(105586002)(316002)(189998001)(2950100002)(101416001)(5660300001)(72206003)(86362001)(87636003)(305945005)(47776003)(478600001)(42186006)(1076002)(8936002)(33646002)(51416003)(356003)(50226002)(36756003)(8676002)(2906002)(81166006)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:SN4PR0701MB3824; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; PTR:50-232-66-26-static.hfc.comcastbusiness.net; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD017; 1:7CBqPiU+Q4Qj6YINGUukZ/wUBUAHsZ38Nu7pZgZ5Mq27k3w/HJ7UWvHbioXOFUhRCzn8g8gSXatfhLoEs4LgL6iESh5kNcTUVUx2rV2pzYWVt7Ei/Z5vkg18hx4dsToD X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ea261ef9-e9e0-49c3-4e6a-08d53697278d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603199); SRVR:SN4PR0701MB3824; X-Microsoft-Exchange-Diagnostics: 1; SN4PR0701MB3824; 3:GkgAhKN2f4WgejRFm5jAqtIxneGtWsgHeKV7sKKQbuSDEwzAjy2DwXkIa7DFVGOlYoBw6xvLONFPw5CDh++Dpglv7w72KL3ChcFqS3nyheByuQIAy2Mz+x7wZc4/EItScgIletGCtKgy76P3pwodPvWrYk0X5dNTfFdm3DTz3R1SOXCbROdggMkKUByFBJcqr1vfu/WdASbtrOB5kOM+P2CCGTk7KZ+aPhCpvrJgPXYOnMB8dm6PmJMJkom+lvWymd4RiBcfuT06ZOhJlUKoibQcY8UbpFhvcCj/qSy9MEFwN1clAnjM1Frdxc2FH+QNowiwMgzpAkBcZ5qmxBC9niqDzfETPuoZ0bIJDu/4sc0=; 25:e30w0FIzhUIzYzECzuAoIVX+6N2+H5IITTrDTR7ZYE5lasO8BXuFDOrHm92y26Lqb+vFTdfPymUl7ZmLQKZVmwVtkKKzVPj4KCntreZyPgHYKu0Aqpi6R/cCjGFjp72cRuIQiS6dfepVfgrhxWofrlCkKJaOusyUFeN/G6bqSyywmrGQ+YiRfyhXzzXtkXUl26mA/6tJjsNSdU2h7q1THA7ie7mmtHPbr4ERl7zA0FQxLnZ+ADREJiXAwhN3CAsNDC53zulzlU25t99mTLOhr46GcJz24780jfCfpps/um+6YUSCdPD3rJpv4ajI01R3ZALuYJbv+PpR5RQwg8C69Q== X-MS-TrafficTypeDiagnostic: SN4PR0701MB3824: X-Microsoft-Exchange-Diagnostics: 1; SN4PR0701MB3824; 31:QzOgVvT7xPlRlGT+4evccmj1u5HpjX99fd2ppUOL/bmtHbxzZ/7tarXMsCFMOe26FEyjdd/fM43OdHaTaqP/yuBnwBTHp9zXTANuVb5KcOeVcx9WJ3eON50By1LUzKW2M5nP9aV7g89Hc+Ebvmtk/gmcl6qHRAX+ZnFXEog8T0hj8OVOArfqezVCGJNkCmry6mHzn2tiJLoSNnP/vAcJVGr/CK2ZHVy58emRe/z5Rw4=; 20:Qm3vAParkibXaGJC0AmOZmbV3xsbhY4YJZLLV+UCEqLwBIQkv0wbSsZTZaN92Ug3MDp2eZRC5X8b/7eYGMRdo6xw2uXvxwV30zrZHQq24Cp4WOD/F3KYrZe39A/nqV4P5zgCPki8YC7ohQw6/pSpOmYIbGDmELzLlfYLUrCaD87s0MPHyV2bVadrtdE4QLrw/rGezhz/onJRq2a47esqcxUQ/X3gwEHLbcCZOv5fJYKWIH0qVXw6A+WBhKvki0iuDyPo+kPlhKOX4tSWc1hy9WKyEn3WOEOvnDrA4K7IkRFdbfH1p3qLzFhjANOexvOJNPytFubvg0NZ2LyXGWJLUYqOOixoYrlYii4NgpLz9sV5iXyIk1w1175vagv/cXFKcSEEeLmVU6w0qAiwaJfloRfcCTWFiil5xHaL9er0FViB7ICf3gtvArGbxAUnT+I0VzISkyPTI0D5HXRIqLFXYMC0g1DHwtDrTmIyEaQvGY90LixbwBK0sBy4ajsjNQmT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(3231022)(3002001)(10201501046)(93006095)(93001095)(6041248)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(20161123555025)(6072148)(201708071742011); SRVR:SN4PR0701MB3824; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SN4PR0701MB3824; X-Microsoft-Exchange-Diagnostics: 1; SN4PR0701MB3824; 4:GQdP/Xw3RtFkMr3Y0Y2i6q+cn9lEGPoPIWK6fmFIjYH0JZ7F/a1Ljpw5qbd00GSQlh5u2cVxylcmjdPn6eRqtVKZqbQd8qnFREtCkpK56wOprLez0qlQUjdSoRg2ytj8ujBY2gHyPzSyzMpTRyqSknpLvvuXziV6xpRQsq/A0SIdiqvQbuCOlDqRSqZtMWLHTICEV+a9P6C597EPcWDASG5Ya7e6LiSsJxfesk8/y9FWgW4sGgi9fXOUpFleTdI3YXzBtbKcoA04EQUPpgEc3eYBuKYMqajLNm3zY7OQ56DVaLRk8bVTD94BORZYT867 X-Forefront-PRVS: 0505147DDB X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN4PR0701MB3824; 23:G7LR+P9o6F8b1AWjd3m5rO/e2sJDxBWKxB+G5/k?= =?us-ascii?Q?0GNYO/N0mAVxYfelXZLmXcbY/FoCYhZ2U8NWsWEdaaIN6gmjcVHqS9ds4fVf?= =?us-ascii?Q?HwI+DZFWrxJwbbiYt38H7dTJpgZwVWc4RUa28trtj7HRtxwEmzvLUkJMlQLT?= =?us-ascii?Q?clGDviKoGvAbhGwxDWu9CYdyvLQKZePkegHsJsM1swagdYsTZumtffxU56Jf?= =?us-ascii?Q?3a+83RxSQZZk+rYC3QgsIMIfGQ8GiU64N0rOyfIThJthls1XikoMmwaPx1GE?= =?us-ascii?Q?iEohPvHrDgqeBP4x0QI8nVNT14tvG95DZp+ismbQlpfm6zln1rlMXKCGmJWU?= =?us-ascii?Q?xk2OmYOzWfTlCqO3W99BMH41z5hj5qyQXnoKaHhmMREJvWHBrfggCxxp8VWh?= =?us-ascii?Q?LduzmiIOJSHWO412WpUfv5cI3kTceOHODzyZD/bGPF5048T9tLBwobUHAZfY?= =?us-ascii?Q?FOFCVA9f84WjIA2i88y6TEsnfyvOnSySOsrP3PQq2FQzdgAVVRtVdJfrzq9c?= =?us-ascii?Q?z956tuwwkRm30WCkK0vcjgywTyllju6lkcoQbxskKTAtDhe0RJwII2nhiP6J?= =?us-ascii?Q?NvsbCz0sBwIy0m6tw4mfGMPEjgxvtUapwVLaoGD9PXa0FzDqcTAwzHmOPVjd?= =?us-ascii?Q?+cyOHJcwqFvrVqMW77e11hp+3h6XwHb4+tkoCn9jHCeGkxMBgYjJgh6mBf+A?= =?us-ascii?Q?8bh0eS1Y2D5YoC8GSHbdbsGJbxaBLKl/RJTQCzxYDxFPnsuqAVpnWdUr9XXr?= =?us-ascii?Q?LEGcMp+O3DVq/OP4sw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wTs01YitqosrKAH9/llsnljPOovQDYghEO6drjVphEVnvAwowRc2p09FxiyY6U/8mnXrxI/dBfkKWu/XJgM4cZeADxJgASmn25XYRmo9kZvceZs4h9NZWRA21JWCxHWZ1RsKYy8p2iG2pEX0lePRJKcjLzSGydpnxhUn/XDFaIzsIgNxottaIDd6y2FBlQn4WAF6 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2017 19:35:17.2142 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ea261ef9-e9e0-49c3-4e6a-08d53697278d 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: SN4PR0701MB3824 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: Sawan Chandak Add check to make sure we are cleaning up global target host list only for NPIV hosts Fixes: bdbe24de281e2 ("scsi: qla2xxx: Cleanup NPIV host in target mode during config teardown") Cc: # 4.10+ Signed-off-by: Sawan Chandak Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_target.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 924d58f5408f..1bec8aebb7b6 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -1561,8 +1561,11 @@ static void qlt_release(struct qla_tgt *tgt) btree_destroy64(&tgt->lun_qpair_map); - if (ha->tgt.tgt_ops && ha->tgt.tgt_ops->remove_target) - ha->tgt.tgt_ops->remove_target(vha); + if (vha->vp_idx) + if (ha->tgt.tgt_ops && + ha->tgt.tgt_ops->remove_target && + vha->vha_tgt.target_lport_ptr) + ha->tgt.tgt_ops->remove_target(vha); vha->vha_tgt.qla_tgt = NULL;