Received: by 10.223.164.202 with SMTP id h10csp102691wrb; Tue, 7 Nov 2017 03:38:20 -0800 (PST) X-Google-Smtp-Source: ABhQp+QKiXK8FucMAWJDfXviyIT60JyVSIIwwC8h7It7YK9oYf4VbL3a/E0LI4SlLf8yRmBHLBEQ X-Received: by 10.101.83.70 with SMTP id w6mr18138701pgr.361.1510054700605; Tue, 07 Nov 2017 03:38:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510054700; cv=none; d=google.com; s=arc-20160816; b=v/z7pwPfK9U/CX9vBr+nSa9uOzo7z89OM2BA7yqizQEZVMl0VlfB8akjjveiiBvBgJ r2bYlb8B+eDC/bsxyDRiVrnC70znVRs+j8/Xma0s4jAl2yPUrem2KIGhh4oxtEtUpSZR 2k9shMHmwAmaGGZfVJ6CERIR99Kx+wzv6nJKlXfCnETmyduomU6GZQbg2OMpfniywIaw ie4/DTABa3yl0JtV+7a7E+lXpVE/bXFJRHZ9YOa5XcaUg/VRfsOikeVo7GyrBolJUOFn S+PHEtqO7RS+mnnLwI/ETsm/PLFhl6lhK+uawja2GXs2IHdExKXUJfbjgHmVGfQanpr1 ErlA== 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=IZySJ9KtbSIv5wrwmetxR6FUxTj3eRXuuYDVolbdWnU=; b=aWPe78IbdoHO07Rdkx9/pC7psok+VyuRIn35LmNVnfQgA+OCPTtQsCHo9jCAWKVRF+ USPbauN19qD0JR0HzQJXrxNKQ+65HwAUB7Jqe4JOeKVCnuybWThtUdzgkFZ3L6Q/6vy+ M0RCCIMomky8r23T7ykvU9npBiPKuavSPdZIY0EblXidPSuk4Ti2pdMx4iBH2IH/oEqH OIJDaM95fyelWFmV8rCMGXnrvtkV4Wjq7sd/lBmVji5YWINjEhBky3JHN6vw0ylKW85S RhYxX5Iz9gAjHABr8jjJLjxElRq0epI+S9oN/jV2RR6f5jucBi6pGx+WVc3PPNrdkGwu EQ9g== 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 p8si922676pls.804.2017.11.07.03.38.07; Tue, 07 Nov 2017 03:38:20 -0800 (PST) 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 S932614AbdKGJE7 (ORCPT + 91 others); Tue, 7 Nov 2017 04:04:59 -0500 Received: from a2nlsmtp01-02.prod.iad2.secureserver.net ([198.71.225.36]:34048 "EHLO a2nlsmtp01-02.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751726AbdKGI5G (ORCPT ); Tue, 7 Nov 2017 03:57:06 -0500 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id BzfpebZ8eOdJ4BzfpeYoo4; Tue, 07 Nov 2017 01:56:05 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1eBzfp-0003KZ-Mw; Tue, 07 Nov 2017 01:55:57 -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 v7 03/22] CIFS: SMBD: Add rdma mount option Date: Tue, 7 Nov 2017 01:54:55 -0700 Message-Id: <20171107085514.12693-4-longli@exchange.microsoft.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171107085514.12693-1-longli@exchange.microsoft.com> References: <20171107085514.12693-1-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfKipmAxzaSlp55LBvBksFMnxPMQdG6tce0Ixn5uJyuzfMTeqNVvXxCp76VOOd7eUlpiUEA0woNYacwMxi8UhcZzEATfMY43kHUw8iyMsctgWtqI6K7bt iIXbOSrad7KDTHKphDTODRcliR07nw9D+TGCMF7LwZIEtHkjwuy1t/xsHDfV1tPlolIN80WaeLWiCk1PrmHJWGw/IQzrDCCfVGJsl6VtpakehnKuv8BbOaW1 NtcNO2LnpTqOBYfmiNNvGRKHl0zyG+TVgFccUOWLYM8wArjceKBCB7n7P4h0aFEyLZ+P6NapJe5ZItVCMaDOquxX0DBtJ39UTOG22QvtMsw+Hvivm4CVYbrj zsVvIaQyhPV6C7XQF0AjtgDSU6st5ube6geb3ucMM688OVLC6H3+Zy81D7p3UkebyR+kT74MqbxrDt/h0naYRpVVem+FEzvaqe7UBmf8GR/1eNu5xi8sfA7W gWtlj310c04I6ulsLLMJOhK9di1fq+X1sEVbog== 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 | 5 +++++ fs/cifs/connect.c | 15 ++++++++++++++- 4 files changed, 23 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..5585516 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,10 @@ 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; + /* point to the SMBD connection if RDMA is used instead of socket */ + struct smbd_connection *smbd_conn; 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 1584564349832168049@xxx Mon Nov 20 06:12:03 +0000 2017 X-GM-THRID: 1584564349832168049 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread