All of lore.kernel.org
 help / color / mirror / Atom feed
From: Long Li <longli@microsoft.com>
To: Tom Talpey <ttalpey@microsoft.com>,
	Matthew Wilcox <mawilcox@microsoft.com>,
	Pavel Shilovsky <piastryyy@gmail.com>
Cc: linux-cifs <linux-cifs@vger.kernel.org>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Steve French <sfrench@samba.org>
Subject: RE: [Patch v5 08/21] CIFS: SMBD: Upper layer reconnects to SMB Direct session
Date: Mon, 6 Nov 2017 20:46:37 +0000	[thread overview]
Message-ID: <MWHPR21MB08467FA475A0FC935E7216EDCE500@MWHPR21MB0846.namprd21.prod.outlook.com> (raw)
In-Reply-To: <CY4PR21MB0182E4A75B9499B34C8BDF54A0500@CY4PR21MB0182.namprd21.prod.outlook.com>

> -----Original Message-----
> From: Tom Talpey
> Sent: Monday, November 6, 2017 12:26 PM
> To: Long Li <longli@microsoft.com>; Matthew Wilcox
> <mawilcox@microsoft.com>; Pavel Shilovsky <piastryyy@gmail.com>
> Cc: linux-cifs <linux-cifs@vger.kernel.org>; Stephen Hemminger
> <sthemmin@microsoft.com>; linux-rdma@vger.kernel.org; Kernel Mailing
> List <linux-kernel@vger.kernel.org>; Steve French <sfrench@samba.org>
> Subject: RE: [Patch v5 08/21] CIFS: SMBD: Upper layer reconnects to SMB
> Direct session
> 
> > -----Original Message-----
> > From: linux-cifs-owner@vger.kernel.org [mailto:linux-cifs-
> > owner@vger.kernel.org] On Behalf Of Long Li
> > Sent: Monday, November 6, 2017 2:00 PM
> > To: Matthew Wilcox <mawilcox@microsoft.com>; Pavel Shilovsky
> > <piastryyy@gmail.com>
> > Cc: linux-cifs <linux-cifs@vger.kernel.org>; Stephen Hemminger
> > <sthemmin@microsoft.com>; linux-rdma@vger.kernel.org; Kernel Mailing
> > List <linux-kernel@vger.kernel.org>; Steve French <sfrench@samba.org>
> > Subject: RE: [Patch v5 08/21] CIFS: SMBD: Upper layer reconnects to
> > SMB Direct session
> >
> > > -----Original Message-----
> > > From: Matthew Wilcox
> > > Sent: Monday, November 6, 2017 10:10 AM
> > > To: Long Li <longli@microsoft.com>; Pavel Shilovsky
> > > <piastryyy@gmail.com>
> > > Cc: linux-cifs <linux-cifs@vger.kernel.org>; Stephen Hemminger
> > > <sthemmin@microsoft.com>; linux-rdma@vger.kernel.org; Kernel
> Mailing
> > > List <linux-kernel@vger.kernel.org>; Steve French
> > > <sfrench@samba.org>
> > > 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.
> 
> I don't think stubbing such a generic-looking function cifs_reconnect() under
> an RDMA conditional is a good idea. It would seem to hide what's truly going
> on, and deeply confuse someone who tried to code cifs_reconnect() on any
> other code path, thinking it would, well, reconnect.
> 
> How about cifs_rdma_reconnect()? That would be fine to override.

Yes this makes more sense, this is the approach I'm going to code.

> 
> Tom.
> 
> >
> > >
> > > > -----Original Message-----
> > > > From: Long Li
> > > > Sent: Sunday, November 5, 2017 2:20 PM
> > > > To: Long Li <longli@microsoft.com>; Matthew Wilcox
> > > > <mawilcox@microsoft.com>; Pavel Shilovsky <piastryyy@gmail.com>
> > > > Cc: linux-cifs <linux-cifs@vger.kernel.org>; Stephen Hemminger
> > > > <sthemmin@microsoft.com>; linux-rdma@vger.kernel.org; Kernel
> > > > Mailing List <linux-kernel@vger.kernel.org>; Steve French
> > > > <sfrench@samba.org>
> > > > 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 <mawilcox@microsoft.com>; Pavel Shilovsky
> > > > > <piastryyy@gmail.com>
> > > > > Cc: linux-cifs <linux-cifs@vger.kernel.org>; Stephen Hemminger
> > > > > <sthemmin@microsoft.com>; linux-rdma@vger.kernel.org;
> > > > > samba-technical <samba-technical@lists.samba.org>; Kernel
> > > > > Mailing List <linux- kernel@vger.kernel.org>; Steve French
> > > > > <sfrench@samba.org>
> > > > > 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 <piastryyy@gmail.com>; Long Li
> > > > > > <longli@microsoft.com>
> > > > > > Cc: Steve French <sfrench@samba.org>; linux-cifs <linux-
> > > > > > cifs@vger.kernel.org>; samba-technical
> > > > > > <samba-technical@lists.samba.org>;
> > > > > > Kernel Mailing List <linux-kernel@vger.kernel.org>; linux-
> > > > > > rdma@vger.kernel.org; Tom Talpey <ttalpey@microsoft.com>;
> > > Stephen
> > > > > > Hemminger <sthemmin@microsoft.com>; Long Li
> > > <longli@microsoft.com>
> > > > > > 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
> > > <longli@exchange.microsoft.com>:
> > > > > > > > From: Long Li <longli@microsoft.com>
> > > > > > > >
> > > > > > > > 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 <longli@microsoft.com>
> > > > > > > > ---
> > > > > > > >  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.
> > \x13  칻\x1c & ~ & \x18  +-
> >   ݶ\x17  w  ˛   m b  \  "  ^n r   z \x1a  h    &  \x1e G   h \x03( 階
> >  ݢj"  \x1a ^[m     z ޖ   f   h   ~ m

  reply	other threads:[~2017-11-06 20:46 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-18 23:08 [Patch v5 00/21] CIFS: Implement SMB Direct protocol Long Li
2017-10-18 23:09 ` [Patch v5 01/21] CIFS: SMBD: Add SMB Direct protocol initial values and constants Long Li
     [not found]   ` <20171018230920.21042-2-longli-Lp/cVzEoVyZiJJESP9tAQJZ3qXmFLfmx@public.gmane.org>
2017-11-01 17:21     ` Steve French
     [not found]       ` <CAH2r5msbXygf-GaSLyy4q_k6pNR8zSKw2KwF3--oeofimdghag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-01 18:49         ` Long Li
2017-10-18 23:09 ` [Patch v5 03/21] CIFS: SMBD: export protocol initial values Long Li
2017-10-18 23:09 ` [Patch v5 04/21] CIFS: SMBD: Add rdma mount option Long Li
2017-10-18 23:09 ` [Patch v5 05/21] CIFS: SMBD: Implement function to create a SMB Direct connection Long Li
2017-10-18 23:09 ` [Patch v5 06/21] CIFS: SMBD: Upper layer connects to SMBDirect session Long Li
2017-10-18 23:09 ` [Patch v5 08/21] CIFS: SMBD: Upper layer reconnects to SMB Direct session Long Li
     [not found]   ` <20171018230920.21042-9-longli-Lp/cVzEoVyZiJJESP9tAQJZ3qXmFLfmx@public.gmane.org>
2017-11-01 18:04     ` Pavel Shilovsky
2017-11-01 18:04       ` Pavel Shilovsky
2017-11-01 19:44       ` Matthew Wilcox
2017-11-01 19:44         ` Matthew Wilcox
     [not found]         ` <BN6PR21MB083455CADF03A6BD40863968CB5F0-M7qishpO4ShSLOx3ThEYWs1VXTxX1y3OvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-11-05 18:37           ` Long Li
2017-11-05 18:37             ` Long Li
     [not found]             ` <MWHPR21MB01904A80D5C08396A7209471CE530-saRRjQKJ25M/hL2NnenhuM1VXTxX1y3OvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-11-05 19:19               ` Long Li
2017-11-05 19:19                 ` Long Li
     [not found]                 ` <MWHPR21MB019066558DAE185D630EC2E7CE530-saRRjQKJ25M/hL2NnenhuM1VXTxX1y3OvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-11-06 18:10                   ` Matthew Wilcox
2017-11-06 18:10                     ` Matthew Wilcox
     [not found]                     ` <DM5PR21MB08439FAD284B66941BD4E1A3CB500-wL6gkCBjFTaTOEAW4KKL081VXTxX1y3OvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-11-06 18:59                       ` Long Li
2017-11-06 18:59                         ` Long Li
     [not found]                         ` <MWHPR21MB0846AFBFCA9D6CDC97060C5DCE500-saRRjQKJ25OdAu0pOMKhMc1VXTxX1y3OvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-11-06 20:25                           ` Tom Talpey
2017-11-06 20:25                             ` Tom Talpey
2017-11-06 20:46                             ` Long Li [this message]
2017-10-18 23:09 ` [Patch v5 09/21] CIFS: SMBD: Implement function to destroy a SMB Direct connection Long Li
2017-10-18 23:09 ` [Patch v5 10/21] CIFS: SMBD: Upper layer destroys SMB Direct session on shutdown or umount Long Li
     [not found] ` <20171018230920.21042-1-longli-Lp/cVzEoVyZiJJESP9tAQJZ3qXmFLfmx@public.gmane.org>
2017-10-18 23:09   ` [Patch v5 02/21] CIFS: SMBD: Establish SMB Direct connection Long Li
2017-10-18 23:09     ` Long Li
     [not found]     ` <20171018230920.21042-3-longli-Lp/cVzEoVyZiJJESP9tAQJZ3qXmFLfmx@public.gmane.org>
2017-11-01 17:19       ` Pavel Shilovsky
2017-11-01 17:19         ` Pavel Shilovsky
2017-11-01 18:48         ` Long Li
2017-10-18 23:09   ` [Patch v5 07/21] CIFS: SMBD: Implement function to reconnect to a SMB Direct transport Long Li
2017-10-18 23:09     ` Long Li
2017-10-18 23:09   ` [Patch v5 11/21] CIFS: SMBD: Set SMB Direct maximum read or write size for I/O Long Li
2017-10-18 23:09     ` Long Li
2017-10-18 23:09   ` [Patch v5 15/21] CIFS: SMBD: Upper layer sends data via RDMA send Long Li
2017-10-18 23:09     ` Long Li
2017-10-18 23:09   ` [Patch v5 18/21] CIFS: SMBD: Add parameter rdata to smb2_new_read_req Long Li
2017-10-18 23:09     ` Long Li
2017-10-18 23:09 ` [Patch v5 12/21] CIFS: SMBD: Implement function to receive data via RDMA receive Long Li
2017-10-18 23:09 ` [Patch v5 13/21] CIFS: SMBD: Upper layer receives " Long Li
2017-10-18 23:09 ` [Patch v5 14/21] CIFS: SMBD: Implement function to send data via RDMA send Long Li
2017-10-18 23:09 ` [Patch v5 16/21] CIFS: SMBD: Implement RDMA memory registration Long Li
2017-10-18 23:09 ` [Patch v5 17/21] CIFS: SMBD: Upper layer performs SMB write via RDMA read through " Long Li
2017-10-18 23:09 ` [Patch v5 19/21] CIFS: SMBD: Read correct returned data length for RDMA write (SMB read) I/O Long Li
     [not found]   ` <20171018230920.21042-20-longli-Lp/cVzEoVyZiJJESP9tAQJZ3qXmFLfmx@public.gmane.org>
2017-11-01 16:50     ` Pavel Shilovsky
2017-11-01 16:50       ` Pavel Shilovsky
     [not found]       ` <CAKywueSUUgxdxcdJbpo0YJTcxauVebzO45UPLD46zzrKVurc5A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-01 18:48         ` Long Li
2017-11-01 18:48           ` Long Li
2017-10-18 23:09 ` [Patch v5 20/21] CIFS: SMBD: Upper layer performs SMB read via RDMA write through memory registration Long Li
2017-10-18 23:09 ` [Patch v5 21/21] CIFS: SMBD: Add SMB Direct debug counters Long Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MWHPR21MB08467FA475A0FC935E7216EDCE500@MWHPR21MB0846.namprd21.prod.outlook.com \
    --to=longli@microsoft.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mawilcox@microsoft.com \
    --cc=piastryyy@gmail.com \
    --cc=sfrench@samba.org \
    --cc=sthemmin@microsoft.com \
    --cc=ttalpey@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.