Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751698AbdH2W44 (ORCPT ); Tue, 29 Aug 2017 18:56:56 -0400 Received: from mail-dm3nam03on0131.outbound.protection.outlook.com ([104.47.41.131]:36054 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751240AbdH2W4x (ORCPT ); Tue, 29 Aug 2017 18:56:53 -0400 From: Long Li To: Pavel Shilovsky CC: Steve French , linux-cifs , samba-technical , Kernel Mailing List , "linux-rdma@vger.kernel.org" , Christoph Hellwig , "Tom Talpey" , Matthew Wilcox Subject: RE: [Patch v3 01/19] CIFS: Add rdma mount option Thread-Topic: [Patch v3 01/19] CIFS: Add rdma mount option Thread-Index: AQHTIP1PMjw3Dczs90GUmJpH55VNI6Kb7McAgAAFDKA= Date: Tue, 29 Aug 2017 22:56:50 +0000 Message-ID: References: <20170829192915.26251-1-longli@exchange.microsoft.com> <20170829192915.26251-2-longli@exchange.microsoft.com> In-Reply-To: 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_Ref=https://api.informationprotection.azure.com/api/72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=longli@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2017-08-29T15:56:48.6293326-07:00; 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:c::735] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MWHPR21MB0173;6:EI3tUxGi8dcoTPzMtIlpp6OqJ6x/8cuofjV5iofVnF/8zAgy8mST9RN35joCurHNNwpwTqUS4jHqJ8BzE/CF0mDx7E8Co9ApTjrK4X66vmmWdiJX2B85w8LINr/qfSwl9MnO1Ht62z6ML694pPB5ChUCpEdTVwP0RRpzXtOlOdeEYHaEZd1q3SmOMCVnRPq8D600p18RyuFpZltwEqCExNjoytGbtItWSPo+QVpulENcgkvDkLveUtIunGUyfvAhFLzt+8Ibl8syo0qXilAVWAfkJs8XdA9zLOsvXlxnDVIwWphK5RFpDAsxByhuIY6jheUCYlohzoaKfwBV+u+gJw==;5:eJRCAarZk6iblfOtj/ktI5uLu7jrOuNbW+ajBf30+FOLh3TfH1MuP5lvo7GkOP0d6/cKl+4A9/tg++8y9x9jwY5w8u31jgOOKa1OIzHrBLnOEVGTLmTnkC3oA4w0qRXqsKPLiE/HMkRhE1kxH7Xqdg==;24:qBrSj4ILZwnJlKC8KrYtP8gfY5MkWed80l3BSdgKab0Gf+2TUH75uB2EwhzeYKMJWgLW3a3ZUf1BUVEKUnXZonqLcRzInC/sy6QLkIWDF9I=;7:BN43UpQfHjrNBxFl7WBYMGM+ydjYEMu0tt51XZEZqP+qZCxwsXhAVFzovideGD2WziQV5mcUgWnubLvz5A26pblCi0Al9trivileY6o07udLBEcIr+Htq+cRQNoU2ukpLwnOmvNLV1To9+LPfPefLeQU8ycboAyErlsX9rWXHTxghrljV9ea+/eqD5TJhL36XiZXmgVLah6kWLxTJj83ldBYE5xT5Lkr7vNUKM77jUc= x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: b2339b82-0203-44d9-9a7d-08d4ef313c14 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:MWHPR21MB0173; x-ms-traffictypediagnostic: MWHPR21MB0173: x-exchange-antispam-report-test: UriScan:(158342451672863)(89211679590171)(9452136761055)(189930954265078)(140211028294663)(219752817060721)(21532816269658); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(61425038)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041248)(20161123558100)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:MWHPR21MB0173;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:MWHPR21MB0173; x-forefront-prvs: 0414DF926F x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(47760400005)(13464003)(189002)(377424004)(199003)(377454003)(86612001)(6306002)(2950100002)(99286003)(9686003)(6506006)(54906002)(6436002)(53936002)(229853002)(77096006)(105586002)(106356001)(102836003)(33656002)(55016002)(6116002)(68736007)(1411001)(6916009)(8936002)(2900100001)(305945005)(7736002)(81166006)(8676002)(5660300001)(74316002)(81156014)(7696004)(53546010)(3660700001)(5005710100001)(8990500004)(3280700002)(107886003)(110136004)(14454004)(101416001)(39060400002)(10090500001)(54356999)(478600001)(25786009)(966005)(10290500003)(50986999)(76176999)(97736004)(4326008)(2906002)(575784001)(6246003)(189998001)(86362001);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR21MB0173;H:MWHPR21MB0190.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; authentication-results: spf=none (sender IP is ) smtp.mailfrom=longli@microsoft.com; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Aug 2017 22:56:50.4314 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR21MB0173 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 base64 to 8bit by nfs id v7TMv1AN022735 Content-Length: 6881 Lines: 176 > -----Original Message----- > From: Pavel Shilovsky [mailto:piastryyy@gmail.com] > Sent: Tuesday, August 29, 2017 3:37 PM > To: Long Li > Cc: Steve French ; linux-cifs cifs@vger.kernel.org>; samba-technical ; > Kernel Mailing List ; linux- > rdma@vger.kernel.org; Christoph Hellwig ; Tom Talpey > ; Matthew Wilcox ; > Long Li > Subject: Re: [Patch v3 01/19] CIFS: Add rdma mount option > > 2017-08-29 12:28 GMT-07: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 | 3 +++ > > fs/cifs/connect.c | 15 ++++++++++++++- > > 4 files changed, 21 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 fe0c8dc..a628800 100644 > > --- a/fs/cifs/cifsfs.c > > +++ b/fs/cifs/cifsfs.c > > @@ -330,6 +330,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 > > 8289f95..703c2fb 100644 > > --- a/fs/cifs/cifsglob.h > > +++ b/fs/cifs/cifsglob.h > > @@ -531,6 +531,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; > > @@ -649,6 +650,8 @@ 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; > > 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 > > 2eeaac6..19fdca8 100644 > > --- a/fs/cifs/connect.c > > +++ b/fs/cifs/connect.c > > @@ -94,7 +94,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, @@ -185,6 +185,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" }, @@ -1541,6 +1542,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: > > @@ -1931,6 +1935,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) { > > @@ -2134,6 +2143,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; > > } > > > > @@ -2234,6 +2246,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 > > > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvger.k > > ernel.org%2Fmajordomo- > info.html&data=02%7C01%7Clongli%40microsoft.com% > > > 7C4e70338e15204a407fd908d4ef2e855c%7C72f988bf86f141af91ab2d7cd011d > b47% > > > 7C1%7C0%7C636396430465385563&sdata=FX0HbkzueGC4ene2wItN6iCiIRqZk > 71OzY7 > > d%2FXX6rPM%3D&reserved=0 > > It is better to introduce a mount option after the functional changes not > before them. In this case we do not result in having the mount option that > does nothing if we break the patchset. I can move this patch to later. However it doesn’t break the build, just does nothing at all. > > -- > Best regards, > Pavel Shilovsky