From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Shilovskiy Subject: RE: [Patch v7 03/22] CIFS: SMBD: Add rdma mount option Date: Thu, 16 Nov 2017 23:18:20 +0000 Message-ID: References: <20171107085514.12693-1-longli@exchange.microsoft.com> <20171107085514.12693-4-longli@exchange.microsoft.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20171107085514.12693-4-longli-Lp/cVzEoVyZiJJESP9tAQJZ3qXmFLfmx@public.gmane.org> Content-Language: en-US Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Steve French , "linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Christoph Hellwig , Tom Talpey , Matthew Wilcox , Stephen Hemminger Cc: Long Li List-Id: linux-rdma@vger.kernel.org 2017-11-07 0:54 GMT-08:00 Long Li : > 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=3D3.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->serve= rNOS, > 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_Serv= er_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 = =3D { > { Opt_resilient, "resilienthandles"}, > { Opt_noresilient, "noresilienthandles"}, > { Opt_domainauto, "domainauto"}, > + { Opt_rdma, "rdma"}, > > { Opt_backupuid, "backupuid=3D%s" }, > { Opt_backupgid, "backupgid=3D%s" }, > @@ -1538,6 +1539,9 @@ cifs_parse_mount_options(const char *mountdata, con= st char *devname, > case Opt_domainauto: > vol->domainauto =3D true; > break; > + case Opt_rdma: > + vol->rdma =3D true; > + break; > > /* Numeric Values */ > case Opt_backupuid: > @@ -1928,6 +1932,11 @@ cifs_parse_mount_options(const char *mountdata, co= nst char *devname, > goto cifs_parse_mount_err; > } > > + if (vol->rdma && vol->vals->protocol_id < SMB30_PROT_ID) { > + cifs_dbg(VFS, "SMB Direct requires Version >=3D3.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 *ser= ver, struct smb_vol *vol) > if (server->echo_interval !=3D vol->echo_interval * HZ) > return 0; > > + if (server->rdma !=3D vol->rdma) > + return 0; > + > return 1; > } > > @@ -2229,6 +2241,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info) > tcp_ses->noblocksnd =3D volume_info->noblocksnd; > tcp_ses->noautotune =3D volume_info->noautotune; > tcp_ses->tcp_nodelay =3D volume_info->sockopt_tcp_nodelay; > + tcp_ses->rdma =3D volume_info->rdma; > tcp_ses->in_flight =3D 0; > tcp_ses->credits =3D 1; > init_waitqueue_head(&tcp_ses->response_q); > -- > 2.7.4 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-cifs" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Pavel Shilovsky -- Best regards, Pavel Shilovsky From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Shilovskiy Subject: RE: [Patch v7 03/22] CIFS: SMBD: Add rdma mount option Date: Thu, 16 Nov 2017 23:18:20 +0000 Message-ID: References: <20171107085514.12693-1-longli@exchange.microsoft.com> <20171107085514.12693-4-longli@exchange.microsoft.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: Long Li To: Long Li , Steve French , "linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Christoph Hellwig , Tom Talpey , Matthew Wilcox , Stephen Hemminger Return-path: In-Reply-To: <20171107085514.12693-4-longli-Lp/cVzEoVyZiJJESP9tAQJZ3qXmFLfmx@public.gmane.org> Content-Language: en-US Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: 2017-11-07 0:54 GMT-08:00 Long Li : > 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=3D3.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->serve= rNOS, > 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_Serv= er_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 = =3D { > { Opt_resilient, "resilienthandles"}, > { Opt_noresilient, "noresilienthandles"}, > { Opt_domainauto, "domainauto"}, > + { Opt_rdma, "rdma"}, > > { Opt_backupuid, "backupuid=3D%s" }, > { Opt_backupgid, "backupgid=3D%s" }, > @@ -1538,6 +1539,9 @@ cifs_parse_mount_options(const char *mountdata, con= st char *devname, > case Opt_domainauto: > vol->domainauto =3D true; > break; > + case Opt_rdma: > + vol->rdma =3D true; > + break; > > /* Numeric Values */ > case Opt_backupuid: > @@ -1928,6 +1932,11 @@ cifs_parse_mount_options(const char *mountdata, co= nst char *devname, > goto cifs_parse_mount_err; > } > > + if (vol->rdma && vol->vals->protocol_id < SMB30_PROT_ID) { > + cifs_dbg(VFS, "SMB Direct requires Version >=3D3.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 *ser= ver, struct smb_vol *vol) > if (server->echo_interval !=3D vol->echo_interval * HZ) > return 0; > > + if (server->rdma !=3D vol->rdma) > + return 0; > + > return 1; > } > > @@ -2229,6 +2241,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info) > tcp_ses->noblocksnd =3D volume_info->noblocksnd; > tcp_ses->noautotune =3D volume_info->noautotune; > tcp_ses->tcp_nodelay =3D volume_info->sockopt_tcp_nodelay; > + tcp_ses->rdma =3D volume_info->rdma; > tcp_ses->in_flight =3D 0; > tcp_ses->credits =3D 1; > init_waitqueue_head(&tcp_ses->response_q); > -- > 2.7.4 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-cifs" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Pavel Shilovsky -- Best regards, Pavel Shilovsky From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936421AbdKPXSj (ORCPT ); Thu, 16 Nov 2017 18:18:39 -0500 Received: from mail-by2nam03on0095.outbound.protection.outlook.com ([104.47.42.95]:63808 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759531AbdKPXS3 (ORCPT ); Thu, 16 Nov 2017 18:18:29 -0500 From: Pavel Shilovskiy To: Long Li , Steve French , "linux-cifs@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-rdma@vger.kernel.org" , Christoph Hellwig , Tom Talpey , Matthew Wilcox , Stephen Hemminger CC: Long Li Subject: RE: [Patch v7 03/22] CIFS: SMBD: Add rdma mount option Thread-Topic: [Patch v7 03/22] CIFS: SMBD: Add rdma mount option Thread-Index: AQHTV6d/YqeG/4AtCk2yunaNyWGGk6MXsuWQ Date: Thu, 16 Nov 2017 23:18:20 +0000 Message-ID: References: <20171107085514.12693-1-longli@exchange.microsoft.com> <20171107085514.12693-4-longli@exchange.microsoft.com> In-Reply-To: <20171107085514.12693-4-longli@exchange.microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=pshilov@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2017-11-16T23:18:19.3888167Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic; Sensitivity=General x-originating-ip: [2001:4898:80e8:e::7a9] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY4PR21MB0823;6:MmKS2klSCmQ1HT0wazcI5PycZSuGgeI14tflbJTD4Zw6UOAu1P5hoc3L1rWsdGEadRKTpyqiaYtIJ9oNI3k0e7lunUp4OrTaHRlJxfpsHqeNuFJpM5xHlVx710At4DD41ptWr49+BagvouLu/OQPTyjwl5KisRQbZzr4N5OSlKrGD1b1fZQZbLW7O0SiGXS8QctNPGBuZjsOTprHM0qSIm6cQz34X6H5ZvYdoqiJRtcxz7LCu2GGG7u1VbIIwdQEWrW1xBfZI+4Sa5A/puUvt7zBQGVfTvBw5emKdXWG535wods+www3bv8wqt8KidQa7eMHYXLKK7qjoNc9649lSddZ+N2U3V4nRtT6HgutzcM=;5:dP8F4dh+jED8TnQouy3btqnr60QsOqakbAylhpmNJZJLRczvBB2N4y5F10b38d9kGKRbhKyvOu1yaJFtM7KxRuwtKdbzUrDeL2AXHDr2azSDQDW3UBegs28oP/kvl2oUd1CiX/hxTKklQqD4CShdJ5kfrUH4F6BDkb/cDToF0Bw=;24:X3306XW7jjZYF9dp3dNIUGarMyretsDHeRfXMCxrA7zCqpYMzlqCSJbUE4oiiDtCGAsNzLJj5BnoK3HZeUh6LfSzgaYu+SjUl3O/NSWnUwo=;7:syC+pEFR+P+gZlDHp2AYkoO/oq9VI5puyC7VFKUn6z0rEunszNvpxm2VyJKj8UN4hyOGGk6//80nrCEr7PumIrUU6GKqEFl7kwFP6ZGklfrqbZM9W5ljDH2r0PMc+P5bbMS5QZb0H8I20yAyYPkOF+LJYuJU0T8IYqPlhEl4dyGYi09AayX4qR/qBrTE4CmBTNUf/Cd1dMllYDk1EWnmWKceBLvcPPELqEPatckY26nOcngqU1+Tk/g3AFgtk4Vw x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI;SCL:-1;SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(376002)(346002)(47760400005)(189002)(199003)(3660700001)(53936002)(6246003)(3280700002)(2906002)(102836003)(229853002)(6116002)(966005)(50986999)(101416001)(54356999)(6306002)(25786009)(8936002)(9686003)(77096006)(107886003)(76176999)(14454004)(6636002)(7696004)(5660300001)(478600001)(10290500003)(2501003)(74316002)(2900100001)(2950100002)(4326008)(55016002)(8990500004)(8676002)(189998001)(110136005)(305945005)(10090500001)(99286004)(81156014)(81166006)(97736004)(22452003)(316002)(33656002)(2201001)(2561002)(105586002)(7736002)(1511001)(86612001)(2421001)(106356001)(6436002)(68736007)(6506006)(86362001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR21MB0823;H:CY4PR21MB0135.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-ms-office365-filtering-correlation-id: 10385e8b-2554-48f5-2311-08d52d4853d4 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603258);SRVR:CY4PR21MB0823; x-ms-traffictypediagnostic: CY4PR21MB0823: authentication-results: spf=none (sender IP is ) smtp.mailfrom=pshilov@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(158342451672863)(89211679590171)(9452136761055)(140211028294663)(21532816269658); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(61425038)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231022)(100000703101)(100105400095)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR21MB0823;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR21MB0823; x-forefront-prvs: 0493852DA9 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 10385e8b-2554-48f5-2311-08d52d4853d4 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Nov 2017 23:18:20.8381 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0823 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id vAGNIjps004231 2017-11-07 0:54 GMT-08:00 Long Li : > 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 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-cifs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Pavel Shilovsky -- Best regards, Pavel Shilovsky