Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753600AbdHUSTZ (ORCPT ); Mon, 21 Aug 2017 14:19:25 -0400 Received: from mail-by2nam01on0098.outbound.protection.outlook.com ([104.47.34.98]:60384 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753152AbdHUSTW (ORCPT ); Mon, 21 Aug 2017 14:19:22 -0400 From: Long Li To: Leon Romanovsky CC: 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 Subject: RE: [Patch v2 01/19] CIFS: Add RDMA mount option Thread-Topic: [Patch v2 01/19] CIFS: Add RDMA mount option Thread-Index: AQHTGedpiopCqOxXr0iTLJLllMSD3qKOOiyAgADlrBA= Date: Mon, 21 Aug 2017 18:18:59 +0000 Message-ID: References: <1503255883-3041-1-git-send-email-longli@exchange.microsoft.com> <1503255883-3041-2-git-send-email-longli@exchange.microsoft.com> <20170821043601.GD1724@mtr-leonro.local> In-Reply-To: <20170821043601.GD1724@mtr-leonro.local> 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-21T11:18:56.8750336-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:a::735] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MWHPR21MB0478;6:UndDktgCABdFWMMSm7JVGHxhPGHmwUzr2WjHLPIDk5l9Ej75AwCcoNq99/jcnC5viE6Dt9WVviINbhgK5e3rvLlSOI4XI+aTGAS2LF5PYVa1w4HNKFwai1efK59Ook6SXJRmx41E2djwkVcknK7XgtiBnIiXJ+5HBNn8sc2caD9AMdUqDeBOfNwlocc19KqXLaXmAdEBUT0EH4LOkrl9SQ1NcWqA0ewgGLsJMdDnYFYCge15qEGzT5izcEw6kApNOgz19fo8PFar9kmtuBarTpRrE2lyxWjXXS2aVIIQvzytkojioJkYxFJUQhrbPMeHO2vMMr2/TCsHtiEWsZXuzw==;5:H/oE2b21eFIrYQGfsp3AFW06x6aGLZNb/viBCrrBCq7+C4P/SApLA7uNSPlZEe4qZYIShMX24sFeMhVJkni3rl1d9tI9XtGuAYnK8SfDqQCtZ18PXV7xmtIxxWWRZfaok1Dt6DQ3wZylgPZ/3GjWbA==;24:xJG6e3TD+k8WUOKnD+k4RGMuicg7hPfLAjHPZ/Y5cUTxPE0gxzt+iImweJLHt0F5V8c0B92bQrbS59q9NqAqg4f7sG81BLJoVelzxfkN6WQ=;7:hLISvmiiTQvF3Gcx/45IlAIupA++JWOBMzCAvj0wCszXg/pp3QJD9d+PwNcs+YRkHQXXrbAGD2cAQyKPkNVQzV7Ohu88KKMeDclC9o/rDn/LALL9jRm3k/BqpHorzf45JeHtIMMiRfBwWm1/GNe3jftGyo+vh3ky4FB52nSkW7rPpkh525dh9lYoKwkm5ZFnVEUUBBNaenckdhWaGbgbf0zQcmip8UbBqs2U+FiCtVY= x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI;SCL:-1;SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(47760400005)(189002)(377454003)(24454002)(199003)(13464003)(3660700001)(9686003)(68736007)(6246003)(2906002)(14454004)(53936002)(3280700002)(81166006)(2900100001)(54356999)(81156014)(25786009)(7696004)(76176999)(50986999)(55016002)(305945005)(86362001)(54906002)(33656002)(7736002)(74316002)(99286003)(575784001)(8676002)(97736004)(6916009)(101416001)(86612001)(8936002)(2950100002)(229853002)(478600001)(6116002)(5005710100001)(8990500004)(5660300001)(102836003)(10290500003)(105586002)(77096006)(6436002)(107886003)(53546010)(110136004)(189998001)(6506006)(4326008)(10090500001)(106356001);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR21MB0478;H:MWHPR21MB0190.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-ms-office365-filtering-correlation-id: b1eaf9b5-a73b-4b15-7c4a-08d4e8c118a9 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)(2017052603157)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:MWHPR21MB0478; x-ms-traffictypediagnostic: MWHPR21MB0478: x-exchange-antispam-report-test: UriScan:(158342451672863)(89211679590171)(9452136761055)(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)(5005006)(8121501046)(93006095)(93001095)(3002001)(100000703101)(100105400095)(10201501046)(6055026)(61426038)(61427038)(6041248)(20161123555025)(20161123560025)(20161123558100)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:MWHPR21MB0478;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:MWHPR21MB0478; x-forefront-prvs: 040655413E authentication-results: spf=none (sender IP is ) smtp.mailfrom=longli@microsoft.com; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Aug 2017 18:19:00.5237 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR21MB0478 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 v7LIJWiv017479 Content-Length: 4646 Lines: 135 > -----Original Message----- > From: Leon Romanovsky [mailto:leon@kernel.org] > Sent: Sunday, August 20, 2017 9:36 PM > To: Long Li > Cc: 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 ; > Long Li > Subject: Re: [Patch v2 01/19] CIFS: Add RDMA mount option > > On Sun, Aug 20, 2017 at 12:04:25PM -0700, Long Li wrote: > > From: Long Li > > > > Add "rdma" to CIFS mount option, which tells CIFS this is for connecting to a > SMB server over SMBDirect. Add checks to validate this feature is only used > on SMB 3.X dialects. > > > > To connect to SMBDirect, use "mount.cifs -o rdma,vers=3.x". > > > > 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 | 25 ++++++++++++++++++++++++- > > 4 files changed, 31 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..d5d0ecd 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,21 @@ cifs_parse_mount_options(const char > *mountdata, const char *devname, > > goto cifs_parse_mount_err; > > } > > > > + if (vol->rdma) { > > + switch (vol->vals->protocol_id) { > > + case SMB30_PROT_ID: > > + case SMB302_PROT_ID: > > + case SMB311_PROT_ID: > > + break; > > In cover letter, you wrote that this option is relevant for 3.X versions, so why > do you write explicitly versions and don't do check if (version > > SMB30_PROT_ID) ...? Thanks for pointing it out. I will fix this. > > Thanks