From patchwork Fri Dec 9 19:00:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9468941 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 6D44B602F0 for ; Fri, 9 Dec 2016 19:00:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52F8F28672 for ; Fri, 9 Dec 2016 19:00:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 465012867F; Fri, 9 Dec 2016 19:00:47 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 1D4D728672 for ; Fri, 9 Dec 2016 19:00:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752652AbcLITAn (ORCPT ); Fri, 9 Dec 2016 14:00:43 -0500 Received: from mail-cys01nam02on0041.outbound.protection.outlook.com ([104.47.37.41]:3584 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751130AbcLITAl (ORCPT ); Fri, 9 Dec 2016 14:00:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=8N/MeB9mM2Fog7czS/xrF/fRKVsRo5K1ytIrGeFQrig=; b=OvQzdkUo61hMfSiO34P5sBMbOtR8Apc5HktdCr99jWi2S7iPLPyKUg6ZTNYDjE69M1tqsU3D9FRfaWjQlQQhWAx2QMlC78Pv5vJP7P4RWUQUThk2v8fVg0fjjoYBw5atcOTIt41G0fyZFRAw9jt5xl7QcMOvm8YZiCaP5JAGecs= Received: from BN6PR02CA0033.namprd02.prod.outlook.com (10.173.146.147) by BY2PR0201MB1511.namprd02.prod.outlook.com (10.163.153.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.747.13; Fri, 9 Dec 2016 19:00:37 +0000 Received: from BN1BFFO11FD030.protection.gbl (2a01:111:f400:7c10::1:174) by BN6PR02CA0033.outlook.office365.com (2603:10b6:404:5f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.771.8 via Frontend Transport; Fri, 9 Dec 2016 19:00:37 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by BN1BFFO11FD030.mail.protection.outlook.com (10.58.144.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.734.4 via Frontend Transport; Fri, 9 Dec 2016 19:00:36 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:2858; Count:17 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 5F.AC.03811.67DFA485; Fri, 9 Dec 2016 10:52:39 -0800 (PST) Received: from milsmgip12.sandisk.com (10.177.9.6) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Fri, 9 Dec 2016 11:00:34 -0800 X-AuditID: 0ac94371-a9ee698000000ee3-bc-584afd7619ca Received: from exp-402881.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id F6.EF.03661.15FFA485; Fri, 9 Dec 2016 11:00:34 -0800 (PST) To: Doug Ledford CC: Christoph Hellwig , "Nicholas A. Bellinger" , "linux-rdma@vger.kernel.org" , target-devel From: Bart Van Assche Subject: [PATCH] IB/srpt: Accept GUIDs as port names Message-ID: <1b20f44a-0378-7b53-65bd-e079e9fa87ff@sandisk.com> Date: Fri, 9 Dec 2016 11:00:33 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFLMWRmVeSWpSXmKPExsXCddJ5kW75X68IgwsPeCxenv/AarFy9VEm i2eHelks2lafYbRoXfqWyYHV4/72I0weu282sHm833eVzePzJrkAligum5TUnMyy1CJ9uwSu jJP3jzAVfKmo2HxuF1sD4/nkLkYODgkBE4m+Z7xdjFwcQgJLmSQavh1gg3C2Mkr8PDObvYuR E6xo88HnjBCJxYwSR3fvYgRJiAioSWx6tYgdJMEssJdRYu6P/cwgCTYBI4lv72eygNjCQN0n 2s+zgdi8AnYSyydsAouzCKhI/HxyBcwWFYiQ6J/yiAWiRlDi5MwnLCDnMQtoSqzfpQ8SZhaQ l9j+dg4zyC4JgWmsEnt+H2MCSQgJqEucXDKfaQKj4Cwk7bMQ2mchaV/AyLyKUSw3M6c4Nz21 wNBErzgxLyWzOFsvOT93EyMkxAt3ML6+7X2IUYCDUYmH1+GQV4QQa2JZcWXuIUYJDmYlEd4J v4BCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeS9GfwwTEkhPLEnNTk0tSC2CyTJxcEo1MKbtsBbu tle9ty/WaL25dk6KvHHHqpd1zwq43mocUfoifWiOwOGuqrPHHjR19U48UtLqI/qpRVrn4xv9 50sjRAXWT430CN/Kzvzdyl9B6hu3WT6jklbq6e0+vFP6WfjuTrmr8etSWGcdm+hHoV8Nj8Pu veT57zW5cu6lKc8fdHjNKFgzUenWSyWW4oxEQy3mouJEAD5ntqxtAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrEJMWRmVeSWpSXmKPExsXCtZGTTTfov1eEweGJ/BYvz39gtVi5+iiT xbNDvSwWbavPMFq0Ln3L5MDqcX/7ESaP3Tcb2Dze77vK5vF5k1wASxSXTUpqTmZZapG+XQJX xsn7R5gKvlRUbD63i62B8XxyFyMnh4SAicTmg88Zuxi5OIQEFjJKXPo0nwUkISKgJrHp1SJ2 kASzwH5Gif0zzzGDJNgEjCS+vZ8JViQM1H2i/TwbiM0rYCexfMImsDiLgIrEzydXwGxRgQiJ /imPWCBqBCVOznwCZjMLqEv8mXeJGcKWl9j+dg7zBEaeWUjKZiEpm4WkbAEj8ypGsdzMnOLc 9MwCQyO94sS8lMzibL3k/NxNjJBQi9rBeH2i+SFGJg5OqQbGXG7xMP7g4CN7epfdK34zb2Jo 36F5Ez86/ahbl37Rfo5M/tn1K1KnlIpXyUWz1k6syWqUnP9wn+e9tZqT9t6XfZa5p22OpJGX VPDx+YvuT5h1JMSvaf+mVfLcL69F9Kuaz0xhme+yXShgjXwx1+ayW0ezJdbzd3vnWP1Z9yRj a+n/xzP2XjpeqcRSnJFoqMVcVJwIAGSKLTrlAQAA X-IncomingHeaderCount: 17 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39410400002)(39860400002)(39850400002)(39840400002)(39450400003)(2980300002)(438002)(199003)(189002)(69596002)(106466001)(54356999)(31686004)(68736007)(356003)(8936002)(2270400002)(626004)(50986999)(47776003)(8676002)(4001350100001)(97736004)(305945005)(2906002)(64126003)(53416004)(65826007)(189998001)(6916009)(65806001)(38730400001)(65956001)(81156014)(81166006)(5660300001)(4326007)(92566002)(50466002)(230700001)(33646002)(77096006)(86362001)(23676002)(83506001)(36756003)(110136003)(31696002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0201MB1511; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD030; 1:O8YnZJ9nfIXPHKGB2zWQ9eLrB5GJ+7CjOuHvxKhVwXOXwuzya2bVtNWZ/N0L0JSBMEoJPaZx0jL9E7G/Q3uu0v61xwj6cT/+LLccByv2xtpffy74bbK8bG5TRgWejYujkHmK3OCpRnZtCr4L7SLNzltczgSq3O4W0Cd/mL6TmpiKVn6zW6Hu6kr/8ieYNptGcRcVqtBfvs1capq1ARNmNmdAzDe0clRraZ1z2GKwiOPETg6QRJSUSK3geOUHCCIOwTGH2sEEZReQtr8O7fvOfHCIwYrJb+zvWPIbR8P+kU2xuFt2C26ePpDv3RKUsISpXEHj4qRtxqR6Ld6jofAB4CzH9k2gZodBdPaShx91csKSymCfbWsj6QA+9IdSBBXfTnOKMIARyTVt0QS2iKhUbVFhODIgJ70bHwANB9WdTRzrJgO/j4VVxkyICVtYZdei+XuBNSBcdd6VBA1O3UhGG1F4OTA57+Jhaags8S2MA65g3+T15dfJ2vFnt87mWBI/ X-MS-Office365-Filtering-Correlation-Id: 2ccd850f-0104-4443-a5ee-08d42065a953 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:BY2PR0201MB1511; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1511; 3:w8+6Bg1GuqYD80xmhnfLrDlXuFnGajg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oABTeN8QUzWfmW/zaWGcYFc+tQ8r6Ug27Y1a7s4ZWm2Y4gyaeI/iPlErq4OiNv2LbBMqV9KtvstMsLLucLvNghSYTLQFViQ+95oub1N88TszfCyVy+YEkY=; 20:VyLe24fJcB20DbMiet0yY08Kzott3Q3xHvL45ZOgpuXY+ymbLKJqQZIT4u1XHVP5DEh+JUaseu1bq6EQVI/mlI8Kc3uazur0sN1CjPqPloes+wvcJIxU79yqhfB+x3IsMNNLYKWu9MqlSzbW1OjxhWpbKHfPw/1+D4aLBlQOw/0ARhRjZpobvu6N8o+5bzexpFE0WfKvBdsXW5AjlYmeEATQz8ARKo2XWRdzry7TqkSZNE2CiwOVHBKDZn7/Y54LxrP7zRvZC90QGaV0ecU/sIVB0OtLjuOCugELP19Cdreku2Mzk8B+AxlAyyfjUSOayErL2s0HhBzJDbv3N0NQvOFBRBA0m97te9ZUx78ByFhaM+I5/2CypMErwibHyETb4RmsNZvCIXGoiHEl61+cJFr1c1YoaDU4yow+a0+g0VZTlCoUyBAREI3TvWTA5oKWwZLAMoxSEslQkbeDYltNn9JjS5/ExJOidX5cyyNweBd1RQzlZZ26doWbBlxUyr5J X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(275809806118684)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13016025)(8121501046)(5005006)(13018025)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148); SRVR:BY2PR0201MB1511; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0201MB1511; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1511; 4:gjbkZ7r/rD/9Z1cl5qrBhh+Cck2iI5Y947LdQMADauix3Z4dvMoguu750/UCSal95MUWNvxxFkfkjnC3QDfzeKB1/YHta3V0z6c0J5mW+EhIlbcUChEt7qAoYvC3nLh7ztacKe9MRWl9xkj0LuVjtJtraUHr8GNPCdaW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RQrt45meR/W7B1ahPnxzyE6g8S0h1t52mocWGEbQf03Rqb51+3CcpEnKrPKathcfFXERyHaxiG2gmjJuHF7NrAw2Mc8P4axyGNfyxMhKzxSw==; 24:mGcMst7gKjp4c7GwFT8eS1eb7+bxdff/64eVIDdvwD+8BDyo4rOTuKEEvnOJgDzUHuaB0bct6Kt39MOrnsuLrBryW7P2wVVFeSrbbnVElXE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1511; 7:CFQKXw/YLdgOGpo64YIfFZrNEsoynYBBU1cAt75i1VeW5LaEATOuy6ejt6Fsih0zK1P0syS+82uzxFb/rhY5RHUQnXCpGAJP9O/lNNBRNZk8PczRyAaeixLifnKnrEIiWKpOwALoK+PGTEd5SkyNCx9CEGNzG/XRpn+U04Mq57n0l9BpGMutacgsGKvD5O89NEv1j0764h3KE41JcmZhXntj9c4HYEgu4+XtflA9o9pR8KYGiIbwZGJPXlAacBvvZ0xOSxoIIb+egVMdv82PsyQtpWJnWWEFbNcSeglfWBONSaQzptL093vrBO4waapT9eiKPGD/alxB2DS4yxJOMDvgz62DFgthclyC0G6NoaScpVHggftopGgOO4Va5YpLa9OxLnbFVu+u2Zke1+goDZ01R1YAA0DiAu4eYQUnmUfM2E+WkQQtK6jiONkHzk3+5cY2JY4Z5NOPUb6xrHoBiw==; 20:hOD85AOKu7lZk4gH2rgjcqYBE9CQKrZwGpGvGhxAql8FWM8EDuSeGF0s+NlMypEkfh4VERC6JbCNP5TbuX1nVBusvOg7/O8V/ksFgH4J6FzZuiGUWT1CFFpzg9p7tp0zu676/FNSE/A/BUYRRKVhv8Oy75i25Xx3zZWGDnYhodRwAUMimrkWkA6hjvnCx+g0/E78C8rxYYYrRCtzEAYMM6Rg3c4tvy9Yqyo6Ltq3te86DixU6/tYZfp4poVpCB7j X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2016 19:00:36.4459 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0201MB1511 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Port and ACL information must be configured before an initiator logs in. Make it possible to configure this information before a subnet prefix has been assigned to a port by not only accepting GIDs as target port and initiator port names but by also accepting port GUIDs. Add a 'priv' member to struct se_wwn to allow target drivers to associate their own data with struct se_wwn. Reported-by: Doug Ledford References: http://www.spinics.net/lists/linux-rdma/msg39505.html Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Nicholas Bellinger --- drivers/infiniband/ulp/srpt/ib_srpt.c | 139 ++++++++++++++++++++-------------- drivers/infiniband/ulp/srpt/ib_srpt.h | 18 +++-- drivers/target/target_core_tpg.c | 1 + include/target/target_core_base.h | 1 + 4 files changed, 98 insertions(+), 61 deletions(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index b6b9a6401a2d..0474004ebad2 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -500,6 +500,7 @@ static int srpt_refresh_port(struct srpt_port *sport) struct ib_mad_reg_req reg_req; struct ib_port_modify port_modify; struct ib_port_attr port_attr; + __be16 *guid; int ret; memset(&port_modify, 0, sizeof(port_modify)); @@ -522,10 +523,17 @@ static int srpt_refresh_port(struct srpt_port *sport) if (ret) goto err_query_port; + sport->port_guid_wwn.priv = sport; + guid = (__be16 *)&sport->gid.global.interface_id; snprintf(sport->port_guid, sizeof(sport->port_guid), - "0x%016llx%016llx", - be64_to_cpu(sport->gid.global.subnet_prefix), - be64_to_cpu(sport->gid.global.interface_id)); + "%04x:%04x:%04x:%04x", + be16_to_cpu(guid[0]), be16_to_cpu(guid[1]), + be16_to_cpu(guid[2]), be16_to_cpu(guid[3])); + sport->port_gid_wwn.priv = sport; + snprintf(sport->port_gid, sizeof(sport->port_gid), + "0x%016llx%016llx", + be64_to_cpu(sport->gid.global.subnet_prefix), + be64_to_cpu(sport->gid.global.interface_id)); if (!sport->mad_agent) { memset(®_req, 0, sizeof(reg_req)); @@ -1840,6 +1848,7 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, struct srp_login_rej *rej; struct ib_cm_rep_param *rep_param; struct srpt_rdma_ch *ch, *tmp_ch; + __be16 *guid; u32 it_iu_len; int i, ret = 0; @@ -1985,26 +1994,30 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, goto destroy_ib; } - /* - * Use the initator port identifier as the session name, when - * checking against se_node_acl->initiatorname[] this can be - * with or without preceeding '0x'. - */ + guid = (__be16 *)¶m->primary_path->sgid.global.interface_id; + snprintf(ch->ini_guid, sizeof(ch->ini_guid), "%04x:%04x:%04x:%04x", + be16_to_cpu(guid[0]), be16_to_cpu(guid[1]), + be16_to_cpu(guid[2]), be16_to_cpu(guid[3])); snprintf(ch->sess_name, sizeof(ch->sess_name), "0x%016llx%016llx", be64_to_cpu(*(__be64 *)ch->i_port_id), be64_to_cpu(*(__be64 *)(ch->i_port_id + 8))); pr_debug("registering session %s\n", ch->sess_name); - ch->sess = target_alloc_session(&sport->port_tpg_1, 0, 0, + if (sport->port_guid_tpg.se_tpg_wwn) + ch->sess = target_alloc_session(&sport->port_guid_tpg, 0, 0, + TARGET_PROT_NORMAL, + ch->ini_guid, ch, NULL); + if (sport->port_gid_tpg.se_tpg_wwn && IS_ERR_OR_NULL(ch->sess)) + ch->sess = target_alloc_session(&sport->port_gid_tpg, 0, 0, TARGET_PROT_NORMAL, ch->sess_name, ch, NULL); /* Retry without leading "0x" */ - if (IS_ERR(ch->sess)) - ch->sess = target_alloc_session(&sport->port_tpg_1, 0, 0, + if (sport->port_gid_tpg.se_tpg_wwn && IS_ERR_OR_NULL(ch->sess)) + ch->sess = target_alloc_session(&sport->port_gid_tpg, 0, 0, TARGET_PROT_NORMAL, ch->sess_name + 2, ch, NULL); - if (IS_ERR(ch->sess)) { + if (IS_ERR_OR_NULL(ch->sess)) { pr_info("Rejected login because no ACL has been configured yet for initiator %s.\n", ch->sess_name); rej->reason = cpu_to_be32((PTR_ERR(ch->sess) == -ENOMEM) ? @@ -2422,7 +2435,7 @@ static int srpt_release_sdev(struct srpt_device *sdev) return 0; } -static struct srpt_port *__srpt_lookup_port(const char *name) +static struct se_wwn *__srpt_lookup_wwn(const char *name) { struct ib_device *dev; struct srpt_device *sdev; @@ -2437,23 +2450,25 @@ static struct srpt_port *__srpt_lookup_port(const char *name) for (i = 0; i < dev->phys_port_cnt; i++) { sport = &sdev->port[i]; - if (!strcmp(sport->port_guid, name)) - return sport; + if (strcmp(sport->port_guid, name) == 0) + return &sport->port_guid_wwn; + if (strcmp(sport->port_gid, name) == 0) + return &sport->port_gid_wwn; } } return NULL; } -static struct srpt_port *srpt_lookup_port(const char *name) +static struct se_wwn *srpt_lookup_wwn(const char *name) { - struct srpt_port *sport; + struct se_wwn *wwn; spin_lock(&srpt_dev_lock); - sport = __srpt_lookup_port(name); + wwn = __srpt_lookup_wwn(name); spin_unlock(&srpt_dev_lock); - return sport; + return wwn; } /** @@ -2645,11 +2660,19 @@ static char *srpt_get_fabric_name(void) return "srpt"; } +static struct srpt_port *srpt_tpg_to_sport(struct se_portal_group *tpg) +{ + return tpg->se_tpg_wwn->priv; +} + static char *srpt_get_fabric_wwn(struct se_portal_group *tpg) { - struct srpt_port *sport = container_of(tpg, struct srpt_port, port_tpg_1); + struct srpt_port *sport = srpt_tpg_to_sport(tpg); - return sport->port_guid; + WARN_ON_ONCE(tpg != &sport->port_guid_tpg && + tpg != &sport->port_gid_tpg); + return tpg == &sport->port_guid_tpg ? sport->port_guid : + sport->port_gid; } static u16 srpt_get_tag(struct se_portal_group *tpg) @@ -2739,6 +2762,19 @@ static int srpt_get_tcm_cmd_state(struct se_cmd *se_cmd) return srpt_get_cmd_state(ioctx); } +static int srpt_parse_guid(u64 *guid, const char *name) +{ + u16 w[4]; + int ret = -EINVAL; + + if (sscanf(name, "%hx:%hx:%hx:%hx", &w[0], &w[1], &w[2], &w[3]) != 4) + goto out; + *guid = get_unaligned_be64(w); + ret = 0; +out: + return ret; +} + /** * srpt_parse_i_port_id() - Parse an initiator port ID. * @name: ASCII representation of a 128-bit initiator port ID. @@ -2773,20 +2809,23 @@ static int srpt_parse_i_port_id(u8 i_port_id[16], const char *name) */ static int srpt_init_nodeacl(struct se_node_acl *se_nacl, const char *name) { + u64 guid; u8 i_port_id[16]; + int ret; - if (srpt_parse_i_port_id(i_port_id, name) < 0) { + ret = srpt_parse_guid(&guid, name); + if (ret < 0) + ret = srpt_parse_i_port_id(i_port_id, name); + if (ret < 0) pr_err("invalid initiator port ID %s\n", name); - return -EINVAL; - } - return 0; + return ret; } static ssize_t srpt_tpg_attrib_srp_max_rdma_size_show(struct config_item *item, char *page) { struct se_portal_group *se_tpg = attrib_to_tpg(item); - struct srpt_port *sport = container_of(se_tpg, struct srpt_port, port_tpg_1); + struct srpt_port *sport = srpt_tpg_to_sport(se_tpg); return sprintf(page, "%u\n", sport->port_attrib.srp_max_rdma_size); } @@ -2795,7 +2834,7 @@ static ssize_t srpt_tpg_attrib_srp_max_rdma_size_store(struct config_item *item, const char *page, size_t count) { struct se_portal_group *se_tpg = attrib_to_tpg(item); - struct srpt_port *sport = container_of(se_tpg, struct srpt_port, port_tpg_1); + struct srpt_port *sport = srpt_tpg_to_sport(se_tpg); unsigned long val; int ret; @@ -2823,7 +2862,7 @@ static ssize_t srpt_tpg_attrib_srp_max_rsp_size_show(struct config_item *item, char *page) { struct se_portal_group *se_tpg = attrib_to_tpg(item); - struct srpt_port *sport = container_of(se_tpg, struct srpt_port, port_tpg_1); + struct srpt_port *sport = srpt_tpg_to_sport(se_tpg); return sprintf(page, "%u\n", sport->port_attrib.srp_max_rsp_size); } @@ -2832,7 +2871,7 @@ static ssize_t srpt_tpg_attrib_srp_max_rsp_size_store(struct config_item *item, const char *page, size_t count) { struct se_portal_group *se_tpg = attrib_to_tpg(item); - struct srpt_port *sport = container_of(se_tpg, struct srpt_port, port_tpg_1); + struct srpt_port *sport = srpt_tpg_to_sport(se_tpg); unsigned long val; int ret; @@ -2860,7 +2899,7 @@ static ssize_t srpt_tpg_attrib_srp_sq_size_show(struct config_item *item, char *page) { struct se_portal_group *se_tpg = attrib_to_tpg(item); - struct srpt_port *sport = container_of(se_tpg, struct srpt_port, port_tpg_1); + struct srpt_port *sport = srpt_tpg_to_sport(se_tpg); return sprintf(page, "%u\n", sport->port_attrib.srp_sq_size); } @@ -2869,7 +2908,7 @@ static ssize_t srpt_tpg_attrib_srp_sq_size_store(struct config_item *item, const char *page, size_t count) { struct se_portal_group *se_tpg = attrib_to_tpg(item); - struct srpt_port *sport = container_of(se_tpg, struct srpt_port, port_tpg_1); + struct srpt_port *sport = srpt_tpg_to_sport(se_tpg); unsigned long val; int ret; @@ -2907,7 +2946,7 @@ static struct configfs_attribute *srpt_tpg_attrib_attrs[] = { static ssize_t srpt_tpg_enable_show(struct config_item *item, char *page) { struct se_portal_group *se_tpg = to_tpg(item); - struct srpt_port *sport = container_of(se_tpg, struct srpt_port, port_tpg_1); + struct srpt_port *sport = srpt_tpg_to_sport(se_tpg); return snprintf(page, PAGE_SIZE, "%d\n", (sport->enabled) ? 1: 0); } @@ -2916,7 +2955,7 @@ static ssize_t srpt_tpg_enable_store(struct config_item *item, const char *page, size_t count) { struct se_portal_group *se_tpg = to_tpg(item); - struct srpt_port *sport = container_of(se_tpg, struct srpt_port, port_tpg_1); + struct srpt_port *sport = srpt_tpg_to_sport(se_tpg); struct srpt_device *sdev = sport->sdev; struct srpt_rdma_ch *ch; unsigned long tmp; @@ -2968,15 +3007,19 @@ static struct se_portal_group *srpt_make_tpg(struct se_wwn *wwn, struct config_group *group, const char *name) { - struct srpt_port *sport = container_of(wwn, struct srpt_port, port_wwn); + struct srpt_port *sport = wwn->priv; + static struct se_portal_group *tpg; int res; - /* Initialize sport->port_wwn and sport->port_tpg_1 */ - res = core_tpg_register(&sport->port_wwn, &sport->port_tpg_1, SCSI_PROTOCOL_SRP); + WARN_ON_ONCE(wwn != &sport->port_guid_wwn && + wwn != &sport->port_gid_wwn); + tpg = wwn == &sport->port_guid_wwn ? &sport->port_guid_tpg : + &sport->port_gid_tpg; + res = core_tpg_register(wwn, tpg, SCSI_PROTOCOL_SRP); if (res) return ERR_PTR(res); - return &sport->port_tpg_1; + return tpg; } /** @@ -2985,11 +3028,10 @@ static struct se_portal_group *srpt_make_tpg(struct se_wwn *wwn, */ static void srpt_drop_tpg(struct se_portal_group *tpg) { - struct srpt_port *sport = container_of(tpg, - struct srpt_port, port_tpg_1); + struct srpt_port *sport = srpt_tpg_to_sport(tpg); sport->enabled = false; - core_tpg_deregister(&sport->port_tpg_1); + core_tpg_deregister(tpg); } /** @@ -3000,19 +3042,7 @@ static struct se_wwn *srpt_make_tport(struct target_fabric_configfs *tf, struct config_group *group, const char *name) { - struct srpt_port *sport; - int ret; - - sport = srpt_lookup_port(name); - pr_debug("make_tport(%s)\n", name); - ret = -EINVAL; - if (!sport) - goto err; - - return &sport->port_wwn; - -err: - return ERR_PTR(ret); + return srpt_lookup_wwn(name) ? : ERR_PTR(-EINVAL); } /** @@ -3021,9 +3051,6 @@ static struct se_wwn *srpt_make_tport(struct target_fabric_configfs *tf, */ static void srpt_drop_tport(struct se_wwn *wwn) { - struct srpt_port *sport = container_of(wwn, struct srpt_port, port_wwn); - - pr_debug("drop_tport(%s\n", config_item_name(&sport->port_wwn.wwn_group.cg_item)); } static ssize_t srpt_wwn_version_show(struct config_item *item, char *buf) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.h b/drivers/infiniband/ulp/srpt/ib_srpt.h index 581878782854..cc1183851af5 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.h +++ b/drivers/infiniband/ulp/srpt/ib_srpt.h @@ -258,6 +258,7 @@ enum rdma_ch_state { * against concurrent modification by the cm_id spinlock. * @sess: Session information associated with this SRP channel. * @sess_name: Session name. + * @ini_guid: Initiator port GUID. * @release_work: Allows scheduling of srpt_release_channel(). * @release_done: Enables waiting for srpt_release_channel() completion. */ @@ -284,6 +285,7 @@ struct srpt_rdma_ch { struct list_head cmd_wait_list; struct se_session *sess; u8 sess_name[36]; + u8 ini_guid[24]; struct work_struct release_work; struct completion *release_done; }; @@ -306,28 +308,34 @@ struct srpt_port_attrib { * @mad_agent: per-port management datagram processing information. * @enabled: Whether or not this target port is enabled. * @port_guid: ASCII representation of Port GUID + * @port_gid: ASCII representation of Port GID * @port: one-based port number. * @sm_lid: cached value of the port's sm_lid. * @lid: cached value of the port's lid. * @gid: cached value of the port's gid. * @port_acl_lock spinlock for port_acl_list: * @work: work structure for refreshing the aforementioned cached values. - * @port_tpg_1 Target portal group = 1 data. - * @port_wwn: Target core WWN data. + * @port_guid_tpg: TPG associated with target port GUID. + * @port_guid_wwn: WWN associated with target port GUID. + * @port_gid_tpg: TPG associated with target port GID. + * @port_gid_wwn: WWN associated with target port GID. * @port_acl_list: Head of the list with all node ACLs for this port. */ struct srpt_port { struct srpt_device *sdev; struct ib_mad_agent *mad_agent; bool enabled; - u8 port_guid[64]; + u8 port_guid[24]; + u8 port_gid[64]; u8 port; u16 sm_lid; u16 lid; union ib_gid gid; struct work_struct work; - struct se_portal_group port_tpg_1; - struct se_wwn port_wwn; + struct se_portal_group port_guid_tpg; + struct se_wwn port_guid_wwn; + struct se_portal_group port_gid_tpg; + struct se_wwn port_gid_wwn; struct srpt_port_attrib port_attrib; }; diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c index d99752c6cd60..4a8b180c478b 100644 --- a/drivers/target/target_core_tpg.c +++ b/drivers/target/target_core_tpg.c @@ -448,6 +448,7 @@ static void core_tpg_lun_ref_release(struct percpu_ref *ref) complete(&lun->lun_ref_comp); } +/* Does not change se_wwn->priv. */ int core_tpg_register( struct se_wwn *se_wwn, struct se_portal_group *se_tpg, diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index ca8ec7218f39..22c37987d937 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h @@ -909,6 +909,7 @@ static inline struct se_portal_group *param_to_tpg(struct config_item *item) struct se_wwn { struct target_fabric_configfs *wwn_tf; + void *priv; struct config_group wwn_group; struct config_group fabric_stat_group; };