From patchwork Mon Nov 12 21:40:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10679321 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 C3DA614DB for ; Mon, 12 Nov 2018 21:49:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4B992A47C for ; Mon, 12 Nov 2018 21:49:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A8D752A4ED; Mon, 12 Nov 2018 21:49:07 +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,DKIM_SIGNED, DKIM_VALID,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 EA1D52A47C for ; Mon, 12 Nov 2018 21:49:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727847AbeKMHoJ (ORCPT ); Tue, 13 Nov 2018 02:44:09 -0500 Received: from mail-eopbgr680072.outbound.protection.outlook.com ([40.107.68.72]:55320 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725817AbeKMHoJ (ORCPT ); Tue, 13 Nov 2018 02:44:09 -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:X-MS-Exchange-SenderADCheck; bh=AyflDSdGlIEsmMGXuIIhbSH3lTy44HO0jm4d7ZeXZPs=; b=bGriXZvflgvY8uiEnNr4eh3lzNeRAuffbNUVHTAu33Qct/qjKL9ys8eIOorZpZ5P0VU8+M5W5I6F8yHcLQXNyp/2pzex2Z0TR74n5FF2UYbPeXNwX88srpFkfMkwDHi0ThFwUuRrbNCr53Ms7ZHmfDnVSLugc+uvbGy8BaUat+c= Received: from SN4PR0701CA0021.namprd07.prod.outlook.com (2603:10b6:803:28::31) by DM6PR07MB4219.namprd07.prod.outlook.com (2603:10b6:5:bd::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Mon, 12 Nov 2018 21:49:02 +0000 Received: from DM3NAM05FT040.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::208) by SN4PR0701CA0021.outlook.office365.com (2603:10b6:803:28::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21 via Frontend Transport; Mon, 12 Nov 2018 21:49:01 +0000 Authentication-Results: spf=pass (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=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 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 DM3NAM05FT040.mail.protection.outlook.com (10.152.98.154) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1339.3 via Frontend Transport; Mon, 12 Nov 2018 21:49:01 +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; Mon, 12 Nov 2018 13:40:15 -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 wACLeH5A011253; Mon, 12 Nov 2018 13:40:17 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id wACLeHHd011252; Mon, 12 Nov 2018 13:40:17 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH] qla2xxx: Add SysFS hook for FC-NVMe autoconnect Date: Mon, 12 Nov 2018 13:40:17 -0800 Message-ID: <20181112214017.11218-1-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 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)(136003)(39860400002)(396003)(376002)(346002)(2980300002)(438002)(189003)(199004)(2906002)(80596001)(42186006)(86362001)(16586007)(69596002)(316002)(476003)(26005)(2616005)(356004)(106002)(48376002)(50466002)(305945005)(486006)(126002)(186003)(14444005)(36756003)(110136005)(54906003)(1076002)(8936002)(87636003)(336012)(478600001)(81156014)(81166006)(8676002)(47776003)(72206003)(50226002)(4326008)(106466001)(1857600001)(44832011)(5660300001)(51416003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR07MB4219;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM05FT040;1:wLcNVHPrYIVdk1xCOJJGT6hX4bSf2mdy3SxJdIF3eWGX66RYfi5dvYh/N8mw5LNsqWcWdNPiXG9NQP6dBToN/CEpfgJaFsBEWkO/8BUkl/TlYKorSN7NY/833XADzMMn X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 70668ee3-8128-4f7f-acde-08d648e8a888 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM6PR07MB4219; X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4219;3:l34To3501lPkxhzfWzi5v6rCYZe9plFMyV6+v74LVFNQXimIAZ1GMK2RyNuGhchWngLiwRENgzYX6G7r6LPHzTFKYZ3DHmByE/EdtfoxvvHo5BXWiax78bPOshBVBTZLeu5YFF8FhNweZIR87qJi1rHyV7EzU9ifHXOJWmIz2RqLcVfezGws7vl8n/6+TBC9qcuHQlM9wuuxFKR+SC+2P4btSV1AfoU1zIt+ioMGJ1QsZ9c2VDCeWQ62TiNj0OtE9Rm0BAevFQb3ooQrCSeZyNHRfiUq4wwQbCS7KJmFTRGZkNQve+ilNVD92fYlwuWABmLcLq4HdHhBGQaN7KBpWT6PV5bDrN1nFyfCwTQtvLk=;25:Shp52vXHCZERKcr0ZwJN8cyRXVg1gariW/dSoVh8KA196xXIEVjqWk1D8ZZpQ1iMdm4o6KfwzPeoN7t3GLlq1KeYWSrCfLvsUUbJD9YDCYOPA5ItI5GEIk0WFlARFp2B2aerve9MSj8CGuHixQ/paS3yTDNrTbjIbRhz2RrYPFgPdVTdQGxphEtkIwXh7stTRBSaOLfPKE+2zvPN3BlZt9R3hjjfj3Am/m40h7OMSyrntduha0Q9hwljfqebV/Ok3W0oSq02TQzIYGIKwAqRX0ZFHJ8/a2VlHTnQXEAhd3+l/zt+FeQOTInd6Oot1+trMIwEvLCALE/Ejpb8jMb/bQ== X-MS-TrafficTypeDiagnostic: DM6PR07MB4219: X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4219;31:Dy6uVUmo7CoInLCKC9GgwWZn3uvNZOT4Ede/xvN6Nwjm1TRYOuDbmB+eVTkpt9cUgYRm1MfQuAwsWluyPhm3oBn26yrDKujanVfL5A4L5XofmkeOZzINMFKjZ1cKdhtwHyC1+9rcGp6iquCFsDi4r6bedksYMTq9c8UJFznSmjBh/mbY3QWQP/bPsLMURVWZiX8a7IKB8yc/ac0XsjOHLtm6njBqgtaBX65Vrl62htc=;20:+OY6tQz0oOOBbpWnS1nBSWFAHv+Ie2eSzEQE7EW5t+pwORjH73CwExS0F/mb8Oayfpfg/9L24nsBuF2DwVHx3pCRmQmJUHCxj2FbTdyYpxPUWf825gsOeNGDaCmBoY8lc1Wx7TzkPzaxWAIiiX3pc9Au0Cw1BMd5717nmyTRNgJb9lIdSE3UckPzwhWxUxrnRUpAGDYQ3enLhOxIdQM/bD6hIGJ6xGNIvSrXZSFdaX7aK0fBM1quaCnvGiYvXyFCITfLb+U9aWnPVsOmL6dIk3Fq/eH34i8P0ByofJwrU6CDpaGbbVcNqcagcsYLIcf/mSx+FQMeA0T65UdSCg7WIodlfABnQ6tE/1HzJ0VTiKuzM2QzU58wON8QqIcQ+b6hDOD1zaSKA8MAxAcuxHj9hI4nma/2vwW+Mr7MxvKFJIyugyF2pBPbpp98cp9SlfLn5myvwOkikndnT7ki0LLcnCudA2hnZFSdgCWIXDFkAExD1zkdvw5miA6q/S2/T3dh X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(209352067349851)(21532816269658); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231382)(944501410)(52105112)(10201501046)(93006095)(93004095)(3002001)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:DM6PR07MB4219;BCL:0;PCL:0;RULEID:;SRVR:DM6PR07MB4219; X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4219;4:C4asIdA3tDXcPXS9LA07vvMLsrX1EW5gu0WK9Ge7AZCPvFyOCOBnLPwpI2n9NidT8FsOe7jR9aBuhdmcm1il10T8DLESOGTRlkqn8XSQMB5x37vO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ddyb4wNG0wNl96T8eH0KPQ04+auR5wZnK/m7KpJdap408XP/hqigemwFtxp1CStCXSvVozxJs9gG6EQ2nH3Qedh3D+NdocxbrnnDvKsNaJrDoJdiJEITEMfQDsOEg==;5:uotf1KOxvxlh+xZC8Jas4nJZ5pVU7oVsvZDpfO7CdFLQ7iMtw/lFlMsdvvmMc0ppBohVDPOlXClK0pBaBj4qK72F167u6dYbe50qbZzgMU41LJS0wY10pVvcxk1vrBIHdmPaKysE219xrkdLajPY1elTBJneGfox4Z4yoL/CIyQ=;7:tSFHQawsZbID6gAp62x/EN7StYL9mXNLiCiy4BdlwFfKa6ZjB8tyFjPgGAhsAgob4oVDd3OyKOr44nSqtiJi8JwNF1AH0fCq0eUCsc3wnWC88fiTSIqZPQSNFI8OklNpKo4LVoW9TRJGutVr3PxrkQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2018 21:49:01.3208 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 70668ee3-8128-4f7f-acde-08d648e8a888 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: DM6PR07MB4219 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 adds a SysFS hook for systemd service to kick off autoconnect command at the boot time. Output of the SysFS hook will provide host-traddr/traddr which will be used by NVMe CLI to kick off discovery at boot time. Signed-off-by: Himanshu Madhani --- Hi Martin, This patch provides mechanism for qla2xxx driver's boot time scripts for autodiscovery and autoconnection of NVMe LUNs. Please apply this to 4.21/scsi-queue at your earliest convenience. Thanks, Himanshu --- drivers/scsi/qla2xxx/qla_attr.c | 122 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 121 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 678aff5ca947..323a4aa35f16 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -1665,6 +1665,125 @@ qla2x00_max_speed_sup_show(struct device *dev, struct device_attribute *attr, ha->max_speed_sup ? "32Gps" : "16Gps"); } +static ssize_t +qla27xx_nvme_connect_str_show(struct device *dev, struct device_attribute *attr, + char *buf) +{ + scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); + struct nvme_fc_remote_port *rport; + struct nvme_fc_local_port *lport; + struct qla_hw_data *ha = vha->hw; + struct qla_nvme_rport *qla_rport, *trport; + fc_port_t *fcport; + char temp[150] = {0}; + char *rportstate = ""; + + if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha)) + return scnprintf(buf, PAGE_SIZE, "\n"); + + if (!vha->flags.nvme_enabled) + return scnprintf(buf, PAGE_SIZE, "%s\n", + "FC-NVMe is not enabled"); + + list_for_each_entry(fcport, &vha->vp_fcports, list) { + if (!fcport) { + scnprintf(buf, PAGE_SIZE, "No FC host\n"); + return strlen(buf); + } + + if (!vha->nvme_local_port) { + scnprintf(buf, PAGE_SIZE, + "FC-NVMe Initiator on 0x%16llx not registered.\n", + wwn_to_u64(fcport->port_name)); + return strlen(buf); + } + + list_for_each_entry_safe(qla_rport, trport, + &vha->nvme_rport_list, list) { + if (qla_rport->fcport == fcport) { + rport = fcport->nvme_remote_port; + + lport = vha->nvme_local_port; + + scnprintf(temp, sizeof(temp), + "FC-NVMe LPORT: host%ld nn-0x%16llx:pn-0x%16llx port_id %06x %s\n", + vha->host_no, lport->node_name, + lport->port_name, lport->port_id, "ONLINE"); + + if (strlcat(buf, temp, PAGE_SIZE) >= PAGE_SIZE) + goto done; + + scnprintf(temp, sizeof(temp), + "FC-NVMe RPORT: host%ld nn-0x%llx:pn-0x%llx port_id %06x ", + vha->host_no, rport->node_name, + rport->port_name, rport->port_id); + + /* Find out Rport State */ + if (rport->port_state & FC_OBJSTATE_ONLINE) + rportstate = "ONLINE"; + + if (rport->port_state & FC_OBJSTATE_UNKNOWN) + rportstate = "UNKNOWN"; + + if (rport->port_state & ~(FC_OBJSTATE_ONLINE | + FC_OBJSTATE_UNKNOWN)) + rportstate = "UNSUPPORTED"; + + if (strlcat(buf, temp, PAGE_SIZE) >= + PAGE_SIZE) + goto done; + + if (rport->port_role & + (FC_PORT_ROLE_NVME_INITIATOR | + FC_PORT_ROLE_NVME_TARGET | + FC_PORT_ROLE_NVME_DISCOVERY)) { + if (rport->port_role & + FC_PORT_ROLE_NVME_INITIATOR) + if (strlcat(buf, "INITIATOR ", + PAGE_SIZE) >= PAGE_SIZE) + goto done; + + if (rport->port_role & + FC_PORT_ROLE_NVME_TARGET) + if (strlcat(buf, "TARGET ", + PAGE_SIZE) >= PAGE_SIZE) + goto done; + + if (rport->port_role & + FC_PORT_ROLE_NVME_DISCOVERY) + if (strlcat(buf, "DISCOVERY ", + PAGE_SIZE) >= PAGE_SIZE) + goto done; + } else { + if (strlcat(buf, "UNKNOWN_ROLE ", + PAGE_SIZE) >= PAGE_SIZE) + goto done; + } + scnprintf(temp, sizeof(temp), "%s\n", rportstate); + + if (strlcat(buf, temp, PAGE_SIZE) >= PAGE_SIZE) + goto done; + + scnprintf(temp, sizeof(temp), + "NVMECLI: host-traddr=nn-0x%16llx:pn-0x%16llx traddr=nn-0x%16llx:pn-0x%16llx\n", + lport->node_name, lport->port_name, + rport->node_name, rport->port_name); + + if (strlcat(buf, temp, PAGE_SIZE) >= PAGE_SIZE) + goto done; + } + } + } + + return strlen(buf); + +done: + ql_log(ql_log_warn, vha, 0xffff, + "NVME connect string buffer size 0x%lx exceeds 0x%lx\n", + sizeof(*buf), PAGE_SIZE); + return strlen(buf); +} + /* ----- */ static ssize_t @@ -2145,7 +2264,7 @@ static DEVICE_ATTR(zio_threshold, 0644, static DEVICE_ATTR_RW(qlini_mode); static DEVICE_ATTR_RW(ql2xexchoffld); static DEVICE_ATTR_RW(ql2xiniexchg); - +static DEVICE_ATTR(nvme_connect_str, 0444, qla27xx_nvme_connect_str_show, NULL); struct device_attribute *qla2x00_host_attrs[] = { &dev_attr_driver_version, @@ -2183,6 +2302,7 @@ struct device_attribute *qla2x00_host_attrs[] = { &dev_attr_min_link_speed, &dev_attr_max_speed_sup, &dev_attr_zio_threshold, + &dev_attr_nvme_connect_str, NULL, /* reserve for qlini_mode */ NULL, /* reserve for ql2xiniexchg */ NULL, /* reserve for ql2xexchoffld */