Received: by 10.223.164.197 with SMTP id h5csp687551wrb; Sat, 4 Nov 2017 22:53:16 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QdUlstjwq9wUG+qfIaszXbiGbRlg2iVoAuxzZDWiydcndUzhBA2DLClfpn4jcz9wPjHr+B X-Received: by 10.84.237.9 with SMTP id s9mr11079603plk.417.1509861196505; Sat, 04 Nov 2017 22:53:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509861196; cv=none; d=google.com; s=arc-20160816; b=GQCgZkNxtmVJ8OPTD6swsQRPb/zeIU4TuCoTV3jAFhuBV96Qi6OYQfm5bCgzOPyqNz aElzzeLYAfgdiytjhBl+2eUAaTYxP/lUHJq8vM3jObMW3zi53shBzEchJGpgymz4c/Ob pDfciW2mn6soS8s0hTs7ENqGp8GLql5KiYfncw+o6Tb/BWxFkq9AsswHCOYINSVKx7Na /d14lL87C7S/g0Snk/E2j7MHsRdKP/jTfOWB0QWze4fE5Q24CbKg7ACcW/uaBzJkIN/m txVySyfjXN048UzdbB2ytlaLWtaMr7w8ASk0XmjexsDKxvdje4dsKpPjEwfgj9Diz1cJ CLAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=TM6c2zcN8PDGsp+T7r6Kds47vrL5Q+WCOTOfpvdYKnk=; b=MWGRlJ5HbwcRKRwkg4CR4FGrgdfeUqqg9Z+pm9wMnspReKxSZ1W4iAKoAoPNwvxO6G uuFDyPiqreRcDZtGMizvAab4B0TvATWmTYTrN5jx/rjbNH2fc4LlBOwKj4eT4KHp7fK5 nHCsrO6EqWneHrBhD6B93DgxUXDM8NOGVvITyVPlnkVRJJqWAKnM6qOjtlbtht9eD0f6 /FJ7hPgqexRxPNonwFcnYtH/+nz1kMhpM5GyVXAEgFnFAMISqlg3XTM5x737bbFS1pYu UYY3HXffXlPm8WmW2ayCWN0tg195WGMhhgKAAx6zopivqFk7VnRSC6ALIecmfLeohUnu L67A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=exchange.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 141si9308925pgh.414.2017.11.04.22.53.02; Sat, 04 Nov 2017 22:53:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=exchange.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752882AbdKEFu5 (ORCPT + 96 others); Sun, 5 Nov 2017 01:50:57 -0400 Received: from a2nlsmtp01-02.prod.iad2.secureserver.net ([198.71.225.36]:51992 "EHLO a2nlsmtp01-02.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750751AbdKEFpw (ORCPT ); Sun, 5 Nov 2017 01:45:52 -0400 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id BDjTeX8SkOdJ4BDjTeZkD5; Sat, 04 Nov 2017 22:44:51 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1eBDjT-0006EE-Rb; Sat, 04 Nov 2017 22:44:31 -0700 From: Long Li To: Steve French , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Christoph Hellwig , Tom Talpey , Matthew Wilcox , Stephen Hemminger Cc: Long Li Subject: [Patch v6 03/22] CIFS: SMBD: Add rdma mount option Date: Sat, 4 Nov 2017 22:43:45 -0700 Message-Id: <20171105054404.23886-4-longli@exchange.microsoft.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171105054404.23886-1-longli@exchange.microsoft.com> References: <20171105054404.23886-1-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfHInzG9HoganxEji0XFIN7xoEuqKZa4XBlKSa/qrrDpMlkjOy4Z5A7Ighy6xCM4m6M/04xKXnffq7FwVkSJPO7Lh1rXP736G8O9KiQZ/Fm6tC1TSfCbJ J5uMJrpbgS8+Ym0vO/kd2gcgqvrqmeEJWE/Pn9ryOx9WguD764fehIRX3HKtWU8p19AmC4O8wv4yBX7NCAbsrby5ocIU+/I6A3JVQsocjHCt9LDVnEz9jCwW C7kmmEcOTy/TFfG7FxFej/WG9ZoSqOQDf1duLJAGR6lUfQP/tAJSB3YotLZ/rcpsFtMiRMd+w7jBwhFwytx7MYJHH7qUtbHhDIOk0vtIXH6dy0QOnq+CBl9Z cSLai0b/G9AOynjKKJhX/kB5Vg8XAeZNDimRyLAiiqNJYCJBb6xBjoFUUNqKoIFXr1gjl3Q8QUVkNf/r6JlsMkmHxhHVkrXoEyFPaq6CPGHa00yEHI1/mrEi GomLwswJfCyTBmTu3Xn5+CwYNlnWGs9L3FTVog== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Long Li Add "rdma" to CIFS mount options to connect to SMB Direct. Add checks to validate this is used on SMB 3.X dialects. To connect to SMBDirect, use "mount.cifs -o rdma,vers=3.x". At the time of this patch, 3.x can be 3.0, 3.02 or 3.1.1. Signed-off-by: Long Li --- fs/cifs/cifs_debug.c | 2 ++ fs/cifs/cifsfs.c | 2 ++ fs/cifs/cifsglob.h | 7 +++++++ fs/cifs/connect.c | 15 ++++++++++++++- 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index 9727e1d..ba0870d 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c @@ -171,6 +171,8 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v) ses->ses_count, ses->serverOS, ses->serverNOS, ses->capabilities, ses->status); } + if (server->rdma) + seq_printf(m, "RDMA\n\t"); seq_printf(m, "TCP status: %d\n\tLocal Users To " "Server: %d SecMode: 0x%x Req On Wire: %d", server->tcpStatus, server->srv_count, diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 180b335..e15fbf1 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -327,6 +327,8 @@ cifs_show_address(struct seq_file *s, struct TCP_Server_Info *server) default: seq_puts(s, "(unknown)"); } + if (server->rdma) + seq_puts(s, ",rdma"); } static void diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 808486c..09f9a71 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -530,6 +530,7 @@ struct smb_vol { bool nopersistent:1; bool resilient:1; /* noresilient not required since not fored for CA */ bool domainauto:1; + bool rdma:1; unsigned int rsize; unsigned int wsize; bool sockopt_tcp_nodelay:1; @@ -646,6 +647,12 @@ struct TCP_Server_Info { bool sec_kerberos; /* supports plain Kerberos */ bool sec_mskerberos; /* supports legacy MS Kerberos */ bool large_buf; /* is current buffer large? */ + /* use SMBD connection instead of socket */ + bool rdma; +#ifdef CONFIG_CIFS_SMB_DIRECT + /* point to the SMBD connection if RDMA is used instead of socket */ + struct smbd_connection *smbd_conn; +#endif struct delayed_work echo; /* echo ping workqueue job */ char *smallbuf; /* pointer to current "small" buffer */ char *bigbuf; /* pointer to current "big" buffer */ diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 59647eb..b5a575f 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -92,7 +92,7 @@ enum { Opt_multiuser, Opt_sloppy, Opt_nosharesock, Opt_persistent, Opt_nopersistent, Opt_resilient, Opt_noresilient, - Opt_domainauto, + Opt_domainauto, Opt_rdma, /* Mount options which take numeric value */ Opt_backupuid, Opt_backupgid, Opt_uid, @@ -183,6 +183,7 @@ static const match_table_t cifs_mount_option_tokens = { { Opt_resilient, "resilienthandles"}, { Opt_noresilient, "noresilienthandles"}, { Opt_domainauto, "domainauto"}, + { Opt_rdma, "rdma"}, { Opt_backupuid, "backupuid=%s" }, { Opt_backupgid, "backupgid=%s" }, @@ -1538,6 +1539,9 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, case Opt_domainauto: vol->domainauto = true; break; + case Opt_rdma: + vol->rdma = true; + break; /* Numeric Values */ case Opt_backupuid: @@ -1928,6 +1932,11 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, goto cifs_parse_mount_err; } + if (vol->rdma && vol->vals->protocol_id < SMB30_PROT_ID) { + cifs_dbg(VFS, "SMB Direct requires Version >=3.0\n"); + goto cifs_parse_mount_err; + } + #ifndef CONFIG_KEYS /* Muliuser mounts require CONFIG_KEYS support */ if (vol->multiuser) { @@ -2131,6 +2140,9 @@ static int match_server(struct TCP_Server_Info *server, struct smb_vol *vol) if (server->echo_interval != vol->echo_interval * HZ) return 0; + if (server->rdma != vol->rdma) + return 0; + return 1; } @@ -2229,6 +2241,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info) tcp_ses->noblocksnd = volume_info->noblocksnd; tcp_ses->noautotune = volume_info->noautotune; tcp_ses->tcp_nodelay = volume_info->sockopt_tcp_nodelay; + tcp_ses->rdma = volume_info->rdma; tcp_ses->in_flight = 0; tcp_ses->credits = 1; init_waitqueue_head(&tcp_ses->response_q); -- 2.7.4 From 1583068490549891799@xxx Fri Nov 03 17:56:00 +0000 2017 X-GM-THRID: 1583068490549891799 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread