From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932846AbdKFTAB (ORCPT ); Mon, 6 Nov 2017 14:00:01 -0500 Received: from mail-by2nam03on0118.outbound.protection.outlook.com ([104.47.42.118]:33248 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932387AbdKFS77 (ORCPT ); Mon, 6 Nov 2017 13:59:59 -0500 From: Long Li To: Matthew Wilcox , Pavel Shilovsky CC: linux-cifs , Stephen Hemminger , "linux-rdma@vger.kernel.org" , Kernel Mailing List , Steve French Subject: RE: [Patch v5 08/21] CIFS: SMBD: Upper layer reconnects to SMB Direct session Thread-Topic: [Patch v5 08/21] CIFS: SMBD: Upper layer reconnects to SMB Direct session Thread-Index: AQHTSGZh6q7TRhMBC0aFkhMQyQmHfKL/5v+AgAAb3gCABjYncIAACkPwgAGA+QCAAA21IA== Date: Mon, 6 Nov 2017 18:59:56 +0000 Message-ID: References: <20171018230920.21042-1-longli@exchange.microsoft.com> <20171018230920.21042-9-longli@exchange.microsoft.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2001:4898:80e8:a::388] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MWHPR21MB0174;6:Wrt8qGtQVH3bXQu3dpqakItDzqLhxGmuzxS0ewvWF7Lo6W0ZASJCIgs+zWJ3j6KcvKMV3DAtqTYdAu+rZR2z+mFVaYrauCKX2XyE3bWNpajB4ozxYSBQSUD7hWhMdmKc05DP4bTA7yT9g6hqX66CYthn5Q1uHMg8h/6ELiyoG3Y7giHE39dnPkc4EaDbOe6QWGs/VASH8L2vwbqE7hx7p3DHiwa2kvQ/kxIE8GpZbCLYgjqYow5jtgA7tiLASmV6Ae89LpltzEwTwiYIBaAA0L+i6w2qXb19MUm9rFAq2ACDLjVumRb8ebZJ+uN5l6iEjjDPW06j98CyU8e9/QTdG1DeGie543wnl44lowpIdm8=;5:JIToqi7LmYsftfCSo2Q5uke83W6u4zOL4jq5ShkvA0kBmINfS1SS/EChvz+bLozvtMO6L+rzP26RdbNbyEZ32/3BjFDQ3DuJN0FgIeo0DpG0UDPonVtH4WwXhz8kQJHYC+JVzRRs8n3MSt+kJAkhBk6VP/vkRCMn1foL5hw4fmo=;24:SVLQKParDSIt+P7XA72U4vpL1RAXOv+ed+ek6GHRX4Ce20PyQiWxhTMiXdZnQpnlFsYjPSBruWuj2byCDeC02Zj92pKMdfAG0/l0ovAA5ns=;7:pSsfdGpMn1+Mi9M2J+wRpR7SBQVVKNt+ZR13VS61b5Mwxapo2JzjKKo5Ul7jBMxPy/Mx6Vx8BlKBHNzBXa+vMUPz9DrHLqkfSeFYzoXQK1061XoYm+uW2g0TaBPRsaeiSgZ7Ejq07Iyro+bONLZjAuwpjl84oYoAQwwT5Axle4Emgv9OuJ1fF7WiSOYveTfq5F0T97Qk6h7dmPZ/llMHzf7snM3ObJ7fhcBk6k/kyHZfz80XK9YT08QtAjc1kFjW 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)(13464003)(377424004)(199003)(189002)(53546010)(9686003)(2906002)(33656002)(55016002)(4326008)(106356001)(53936002)(10290500003)(10090500001)(101416001)(39060400002)(189998001)(2421001)(25786009)(8990500004)(6246003)(54356999)(105586002)(50986999)(76176999)(478600001)(2900100001)(68736007)(8936002)(316002)(5250100002)(54906003)(110136005)(305945005)(81166006)(22452003)(8676002)(93886005)(2561002)(5660300001)(2950100002)(7696004)(1511001)(6116002)(86612001)(97736004)(102836003)(86362001)(4001150100001)(74316002)(3280700002)(7736002)(575784001)(99286004)(14454004)(6436002)(3660700001)(6506006)(81156014)(229853002);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR21MB0174;H:MWHPR21MB0846.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; x-ms-office365-filtering-correlation-id: f07b8da9-e7bc-47ec-b039-08d5254892a5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603249);SRVR:MWHPR21MB0174; x-ms-traffictypediagnostic: MWHPR21MB0174: authentication-results: spf=none (sender IP is ) smtp.mailfrom=longli@microsoft.com; x-exchange-antispam-report-test: UriScan:(89211679590171)(9452136761055)(140211028294663); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(61425038)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(3231021)(6055026)(61426038)(61427038)(6041248)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:MWHPR21MB0174;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:MWHPR21MB0174; x-forefront-prvs: 048396AFA0 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: f07b8da9-e7bc-47ec-b039-08d5254892a5 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2017 18:59:56.8342 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR21MB0174 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 vA6J06YR020829 > -----Original Message----- > From: Matthew Wilcox > Sent: Monday, November 6, 2017 10:10 AM > To: Long Li ; Pavel Shilovsky > Cc: linux-cifs ; Stephen Hemminger > ; linux-rdma@vger.kernel.org; Kernel Mailing > List ; Steve French > Subject: RE: [Patch v5 08/21] CIFS: SMBD: Upper layer reconnects to SMB > Direct session > > Oh, I hadn't noticed that. Then I amend my suggestion to be: > > #ifdef CONFIG_CIFS_SMB_DIRECT > #define cifs_rdma_enabled(server) ((server)->rdma) > #else > #define cifs_rdma_enabled(server) 0 > static inline void cifs_reconnect(struct TCP_Server_Info *server) { } #endif I will address those and update patch. > > > -----Original Message----- > > From: Long Li > > Sent: Sunday, November 5, 2017 2:20 PM > > To: Long Li ; Matthew Wilcox > > ; Pavel Shilovsky > > Cc: linux-cifs ; Stephen Hemminger > > ; linux-rdma@vger.kernel.org; Kernel Mailing > > List ; Steve French > > Subject: RE: [Patch v5 08/21] CIFS: SMBD: Upper layer reconnects to > > SMB Direct session > > > > > > > > > -----Original Message----- > > > From: samba-technical > > > [mailto:samba-technical-bounces@lists.samba.org] > > > On Behalf Of Long Li via samba-technical > > > Sent: Sunday, November 5, 2017 10:37 AM > > > To: Matthew Wilcox ; Pavel Shilovsky > > > > > > Cc: linux-cifs ; Stephen Hemminger > > > ; linux-rdma@vger.kernel.org; > > > samba-technical ; Kernel Mailing > > > List ; Steve French > > > > > > Subject: RE: [Patch v5 08/21] CIFS: SMBD: Upper layer reconnects to > > > SMB Direct session > > > > > > > -----Original Message----- > > > > From: Matthew Wilcox > > > > Sent: Wednesday, November 1, 2017 12:45 PM > > > > To: Pavel Shilovsky ; Long Li > > > > > > > > Cc: Steve French ; linux-cifs > > > cifs@vger.kernel.org>; samba-technical > > > > ; > > > > Kernel Mailing List ; linux- > > > > rdma@vger.kernel.org; Tom Talpey ; > Stephen > > > > Hemminger ; Long Li > > > > > Subject: RE: [Patch v5 08/21] CIFS: SMBD: Upper layer reconnects > > > > to SMB Direct session > > > > > > > > From: Pavel Shilovsky [mailto:piastryyy@gmail.com] > > > > > 2017-10-18 16:09 GMT-07:00 Long Li > : > > > > > > From: Long Li > > > > > > > > > > > > Do a reconnect on SMB Direct when it is used as the connection. > > > > > > Reconnect > > > > > can > > > > > > happen for many reasons and it's mostly the decision of SMB2 > > > > > > upper > > > > layer. > > > > > > > > > > > > Signed-off-by: Long Li > > > > > > --- > > > > > > fs/cifs/connect.c | 7 +++++++ > > > > > > 1 file changed, 7 insertions(+) > > > > > > > > > > > > diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index > > > > > > 2c0b34a..8ca3c13 100644 > > > > > > --- a/fs/cifs/connect.c > > > > > > +++ b/fs/cifs/connect.c > > > > > > @@ -406,7 +406,14 @@ cifs_reconnect(struct TCP_Server_Info > > > > > > *server) > > > > > > > > > > > > /* we should try only the port we connected to before */ > > > > > > mutex_lock(&server->srv_mutex); > > > > > > +#ifdef CONFIG_CIFS_SMB_DIRECT > > > > > > + if (server->rdma) > > > > > > + rc = smbd_reconnect(server); > > > > > > + else > > > > > > + rc = generic_ip_connect(server); > > > > > > > > > > Minor: here and in other similar places we can remove #else part > > > > > below and put #endif before else block above. > > > > > > > > > > > +#else > > > > > > rc = generic_ip_connect(server); > > > > > > +#endif > > > > > > > > I'd suggest rather: > > > > > > > > #ifdef CONFIG_CIFS_SMB_DIRECT > > > > #define cifs_rdma_enabled(server) ((server)->rdma) > > > > #else > > > > #define cifs_rdma_enabled(server) 0 > > > > #endif > > > > > > > > Then we don't need an ifdef in the users, just: > > > > > > > > if (cifs_rdma_enabled(server)) > > > > rc = smbd_reconnect(server); > > > > else > > > > rc = generic_ip_connect(server); > > > > It doesn't work well, because smbd_reconnect is defined when > > CONFIG_CIFS_SMB_DIRECT is set. Now the compiler is complaining it > > can't find this function. Maybe compiler is not smart enough :) > > > > I have sent v6 for all the other comments.