From patchwork Mon Dec 10 20:36:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10722393 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 7D10A17FE for ; Mon, 10 Dec 2018 20:37:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E1642A498 for ; Mon, 10 Dec 2018 20:37:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 629292A4CD; Mon, 10 Dec 2018 20:37:42 +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,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 EAE5F2A498 for ; Mon, 10 Dec 2018 20:37:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727598AbeLJUhl (ORCPT ); Mon, 10 Dec 2018 15:37:41 -0500 Received: from mail-eopbgr730051.outbound.protection.outlook.com ([40.107.73.51]:50016 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727632AbeLJUhl (ORCPT ); Mon, 10 Dec 2018 15:37:41 -0500 Received: from BYAPR07CA0014.namprd07.prod.outlook.com (2603:10b6:a02:bc::27) by BN7PR07MB4753.namprd07.prod.outlook.com (2603:10b6:406:f0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.22; Mon, 10 Dec 2018 20:37:37 +0000 Received: from CO1NAM05FT051.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::205) by BYAPR07CA0014.outlook.office365.com (2603:10b6:a02:bc::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.22 via Frontend Transport; Mon, 10 Dec 2018 20:37:37 +0000 Authentication-Results: spf=fail (sender IP is 50.232.66.26) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.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 CO1NAM05FT051.mail.protection.outlook.com (10.152.96.166) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1446.5 via Frontend Transport; Mon, 10 Dec 2018 20:37:36 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server (TLS) id 14.2.347.0; Mon, 10 Dec 2018 12:36:32 -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 wBAKaVf2015287; Mon, 10 Dec 2018 12:36:31 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id wBAKaVXF015286; Mon, 10 Dec 2018 12:36:31 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 2/4] qla2xxx: Fix NPIV handling for FC-NVMe Date: Mon, 10 Dec 2018 12:36:23 -0800 Message-ID: <20181210203625.15244-3-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20181210203625.15244-1-hmadhani@marvell.com> References: <20181210203625.15244-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131889478568924781;(ed7a8be2-8232-4c02-72fe-08d477275f2b);(ed7a8be2-8232-4c02-72fe-08d477275f2b) X-Forefront-Antispam-Report: CIP:50.232.66.26;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(376002)(346002)(396003)(136003)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(51416003)(76176011)(48376002)(508600001)(42186006)(80596001)(87636003)(50466002)(316002)(69596002)(126002)(476003)(5660300001)(305945005)(86362001)(575784001)(486006)(6666004)(47776003)(356004)(50226002)(11346002)(81156014)(85426001)(2616005)(446003)(336012)(26005)(8936002)(36756003)(14444005)(81166006)(4326008)(1076002)(106466001)(105606002)(8676002)(2906002)(54906003)(110136005)(16586007);DIR:OUT;SFP:1101;SCL:1;SRVR:BN7PR07MB4753;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT051;1:PIVYecA54RUAc/AdMzBSARcUEPI3vO3FfCEJB7ZTfpLLo2B+a+R7Ocy3uJGwfi9jJF9kQCcvZCJj1H4WxNTWwk2k6N7+9pr9rbV9htiMXbrUrG1vkvBUxUy7p2PpPCJO X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 446c76ec-848e-4a90-2f5d-08d65edf5226 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(5600074)(711020)(2017052603328);SRVR:BN7PR07MB4753; X-Microsoft-Exchange-Diagnostics: 1;BN7PR07MB4753;3:dJhuIciImFxu+dHHDqoLwiUDnyokpHW6MzY1oA6ScQzK91DAtKFhfKhqR5C2qgXdZOPTT2oEKMQtOu8Eyu9kwoR1zcu/9SrvWfA5dx0KX2ArxpMelbCI70H4INYw6rMotuZc1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ZQoQwBZUHttulhqCaVKJLyykRB1Sdkvy82wxe54xa5aU8FBw/H4JCWiu6wfqNZs/UGjundluBtJLRIZlMF01qw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6095135)(2401047)(5005006)(8121501046)(3231455)(999002)(944501520)(52105112)(3002001)(10201501046)(93006095)(93001095)(6055026)(148016)(6096035)(20161123565025)(20161123559100)(201703131430075)(201703131448075)(201703131433075)(20161123563025)(20161123561025)(20161123556025)(201708071742011)(7699051)(76991095);SRVR:BN7PR07MB4753;BCL:0;PCL:0;RULEID:(400006);SRVR:BN7PR07MB4753; X-Forefront-PRVS: 08828D20BC X-Microsoft-Exchange-Diagnostics: 1;BN7PR07MB4753;23:vwFhFgLkxsMyZ00G03lOWC2D9xfvcRc4ZJMTMCUaHrLSqJxv/KhUzktqemshzUYa0KfRfkiXJM6+qdndSHtk0nP8R6CUhjb/9BP5anrL1x0v/Z2bxKLBcWUYTBXt4t7N6XzTNV4q+5cSGSixi3hAwgKfMB1JGezntskPeHrhTk7dntFzL6JO/QCZARCJHamL7r/Txj6dnMt48vrf708zio/y/N5hGJ4RzC4vUnrMU+G21Hk9pCNAS0Ejb59vm5Bn+yFRBb0tqFjePqIKLBSWlePIyaR+Ril6eNvxRyUHrqrOUpGJdzkuaNimZL6OoJzScV0AFQoZ6VmAnFBYp8DiXmoQOcR8GpKGrR3xh9LYyMF6jBz6G4+GHaixD6p5KT07ZCKjnpuBhIM5XUFzisoZD/VQAL4hAiBg7DWujUjJT7a0madkpFZD4j7eFAs9XUVlI36a+f3VjSi4BOcaBOiG58Tdr72NIPvpncoHXslNPd2LF1R+OBKOOLE3DTqXR/Jz3Y8Fki1FdjHQHl5ZDOer9VeP6zxO2hDJ+digJ6+LyOBE1umEBwrRk1NxRgIaPdgfqNu6Y9sSdk3P+P7yPsRRMmyzzhCnUDJRY1TcoFpnWMgyCMNRltZW3MS3nKaWxcppf2LMXZWdarcZBhbuoE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59vxIctmvsJzecuS2Zs9saK760baJA24ChATun8y6fQcOGsjMUnXfA/fLk+8kAmzR9K/U6Pyzk4hcnCyHYWo+HDtbYgmlaZPn6mOIvV2wP00WE2pZ9Rrm3GiWSY2uZPBD+r7zOE5IXIJ8LU3ApKMjgSgEPbyBt95nWEl3fHE7pqEOmi1aue7M6qUNBZL0C9RPbNp6dGdqu5wbJ7nSGTthb5ywf7SPKmmRzzvVWCt0bECh0f9QpMnAk8oVOKigFYryZc/YsyRP3QtkBn6TL1w/7o3Qc9JwI1A==;5:PPrak7OyM1MJKDXEqC3CfvKoCNLdqL2g/RVOwMdT80Z4x+ZCkzMkeXj9MGqtZSPX+9b76WEhASD2vm4S0puHTGq6rCa9QjMfVLOvacGcX/FHBHv8GSQI65wip3caF4EW8hzSD9U+JcS09BKbNiFJIcKCyO8zOq4nQKnoE+wM4AE=;7:lHvQZ6kWT9tOFPJCvCS3rxHqdphptcZfzuWQHEqsoociE2biVl7BYqaw6wvGvKv5IE4DpbYhQiofeGT9PTLe6nNzYz5XPcnPBIZnPRzdSzcdb0G+t/pI1a/JQQZrNgdHdxl86H3AdwP57LScXLqqtw== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Dec 2018 20:37:36.5799 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 446c76ec-848e-4a90-2f5d-08d65edf5226 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[50.232.66.26];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR07MB4753 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 fixes issues with NPIV port with FC-NVMe. Clean up code for remoteport delete and also call nvme_delete when deleting VPs. Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_nvme.c | 16 +++------------- drivers/scsi/qla2xxx/qla_os.c | 2 ++ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index 7e78e7eff783..34996fcfd4fc 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -474,21 +474,10 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport, int rval = -ENODEV; srb_t *sp; struct qla_qpair *qpair = hw_queue_handle; - struct nvme_private *priv; + struct nvme_private *priv = fd->private; struct qla_nvme_rport *qla_rport = rport->private; - if (!fd || !qpair) { - ql_log(ql_log_warn, NULL, 0x2134, - "NO NVMe request or Queue Handle\n"); - return rval; - } - - priv = fd->private; fcport = qla_rport->fcport; - if (!fcport) { - ql_log(ql_log_warn, NULL, 0x210e, "No fcport ptr\n"); - return rval; - } vha = fcport->vha; @@ -517,6 +506,7 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport, sp->name = "nvme_cmd"; sp->done = qla_nvme_sp_done; sp->qpair = qpair; + sp->vha = vha; nvme = &sp->u.iocb_cmd; nvme->u.nvme.desc = fd; @@ -564,7 +554,7 @@ static void qla_nvme_remoteport_delete(struct nvme_fc_remote_port *rport) schedule_work(&fcport->free_work); } - fcport->nvme_flag &= ~(NVME_FLAG_REGISTERED | NVME_FLAG_DELETING); + fcport->nvme_flag &= ~NVME_FLAG_DELETING; ql_log(ql_log_info, fcport->vha, 0x2110, "remoteport_delete of %p completed.\n", fcport); } diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index b658b9a5eb1e..f0ffb0e5c113 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -3570,6 +3570,8 @@ qla2x00_delete_all_vps(struct qla_hw_data *ha, scsi_qla_host_t *base_vha) spin_unlock_irqrestore(&ha->vport_slock, flags); mutex_unlock(&ha->vport_lock); + qla_nvme_delete(vha); + fc_vport_terminate(vha->fc_vport); scsi_host_put(vha->host);