All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Pavel Shilovsky <piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 03/16] CIFS: Check for SMB2 vs CIFS in find_tcp_session
Date: Mon, 7 May 2012 07:52:03 -0500	[thread overview]
Message-ID: <CAH2r5mt7hxvaCzaUU0n96p9SVQ6Sso5p6JaYg0gwm6QA0SgHeg@mail.gmail.com> (raw)
In-Reply-To: <20120507073636.1d10a9ae-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>

On Mon, May 7, 2012 at 6:36 AM, Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> On Sun, 6 May 2012 22:32:54 -0500
> Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>> On Sun, May 6, 2012 at 9:01 AM, Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>> > On Mon, 26 Mar 2012 13:21:30 +0400
>> > Pavel Shilovsky <piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org> wrote:
>> >
>> >> Signed-off-by: Steve French <sfrench-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
>> >> Signed-off-by: Pavel Shilovsky <piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>
>> >> ---
>> >>  fs/cifs/cifsglob.h |    3 +++
>> >>  fs/cifs/connect.c  |   16 +++++++++++++++-
>> >>  2 files changed, 18 insertions(+), 1 deletions(-)
>> >>
>> >> diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
>> >> index 9e28070..fbee8ef 100644
>> >> --- a/fs/cifs/cifsglob.h
>> >> +++ b/fs/cifs/cifsglob.h
>> >> @@ -267,6 +267,9 @@ struct TCP_Server_Info {
>> >>       char server_GUID[16];
>> >>       char sec_mode;
>> >>       bool session_estab; /* mark when very first sess is established */
>> >> +#ifdef CONFIG_CIFS_SMB2
>> >> +     bool is_smb2;   /* SMB2 not CIFS protocol negotiated */
>> >> +#endif
>> >>       u16 dialect; /* dialect index that server chose */
>> >>       enum securityEnum secType;
>> >>       bool oplocks:1; /* enable oplocks */
>> >> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
>> >> index 955f0a3..1fbc21f 100644
>> >> --- a/fs/cifs/connect.c
>> >> +++ b/fs/cifs/connect.c
>> >> @@ -1,7 +1,7 @@
>> >>  /*
>> >>   *   fs/cifs/connect.c
>> >>   *
>> >> - *   Copyright (C) International Business Machines  Corp., 2002,2009
>> >> + *   Copyright (C) International Business Machines  Corp., 2002,2011
>> >>   *   Author(s): Steve French (sfrench-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org)
>> >>   *
>> >>   *   This library is free software; you can redistribute it and/or modify
>> >> @@ -2093,6 +2093,14 @@ static int match_server(struct TCP_Server_Info *server, struct sockaddr *addr,
>> >>                          (struct sockaddr *)&vol->srcaddr))
>> >>               return 0;
>> >>
>> >> +#ifdef CONFIG_CIFS_SMB2
>> >> +     if ((server->is_smb2 == true) && (vol->use_smb2 == false))
>> >> +             return 0;
>> >> +
>> >> +     if ((server->is_smb2 == false) && (vol->use_smb2 == true))
>> >> +             return 0;
>> >> +#endif /* CONFIG_CIFS_SMB2 */
>> >> +
>> >
>> > Again, booleans for this seem like a less than ideal solution. Better
>> > to have this based on a version number or maybe a protocol version enum?
>> >
>> >>       if (!match_port(server, addr))
>> >>               return 0;
>> >>
>> >> @@ -2217,6 +2225,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
>> >>
>> >>       tcp_ses->noblocksnd = volume_info->noblocksnd;
>> >>       tcp_ses->noautotune = volume_info->noautotune;
>> >> +     /* BB should we set this unconditionally now, especially for SMB2 */
>> >>       tcp_ses->tcp_nodelay = volume_info->sockopt_tcp_nodelay;
>> >
>> > Why is it more important to use TCP_NODELAY for SMB2? The above comment
>> > doesn't really say...
>> >
>> >>       tcp_ses->in_flight = 0;
>> >>       tcp_ses->credits = 1;
>> >> @@ -2261,6 +2270,11 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
>> >>               goto out_err_crypto_release;
>> >>       }
>> >>
>> >> +#ifdef CONFIG_CIFS_SMB2
>> >> +     if (volume_info->use_smb2)
>> >> +             tcp_ses->is_smb2 = true;
>> >> +#endif /* CONFIG_CIFS_SMB2 */
>> >> +
>> >
>> > The above should instead set a pointer to a "struct
>> > protocol_operations" or something. That struct could have a version
>> > field within it and it would give you a mechanism to allow for
>> > protocol-version specific behavior without resorting to sprinkling
>> > "is_smb2" checks all over the code.
>>
>> On the tcp-nodelay question:
>>
>> I think it complicates things to give the user a choice now (it should
>> be faster to send with nodelay) - should probably be unconditional
>> (less options for SMB2 is easier since we have a spec, and well
>> behaved servers)
>>
>
> It is more complicated to give a choice, but why should we choose to
> use TCP_NODELAY at all? Do we have any benchmarks or anything that show
> that it really helps performance or makes any difference at all?

We did have benchmarks that showed it was faster (it got requests
on the wire faster) but that was years ago.  Generally for request/response
protocols why wouldn't you always set TCP_NODELAY?
-- 
Thanks,

Steve

  parent reply	other threads:[~2012-05-07 12:52 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-26  9:21 [PATCH 00/16] Get SMB2 mount work Pavel Shilovsky
     [not found] ` <1332753703-4315-1-git-send-email-piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>
2012-03-26  9:21   ` [PATCH 01/16] CIFS: Introduce SMB2 Kconfig option Pavel Shilovsky
     [not found]     ` <1332753703-4315-2-git-send-email-piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>
2012-05-06 12:25       ` Jeff Layton
2012-03-26  9:21   ` [PATCH 02/16] CIFS: Introduce SMB2 mounts as vers=2 Pavel Shilovsky
     [not found]     ` <1332753703-4315-3-git-send-email-piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>
2012-05-06 12:31       ` Jeff Layton
     [not found]         ` <20120506083103.605e3dae-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2012-05-06 12:37           ` Jeff Layton
2012-03-26  9:21   ` [PATCH 03/16] CIFS: Check for SMB2 vs CIFS in find_tcp_session Pavel Shilovsky
     [not found]     ` <1332753703-4315-4-git-send-email-piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>
2012-05-06 14:01       ` Jeff Layton
     [not found]         ` <20120506100129.0b2f626b-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2012-05-07  3:32           ` Steve French
     [not found]             ` <CAH2r5mvX4pfxR4B9TXYcSDOTn3cY0d+Be50zwZ+NhceDOR6vxQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-07 11:36               ` Jeff Layton
     [not found]                 ` <20120507073636.1d10a9ae-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2012-05-07 12:52                   ` Steve French [this message]
     [not found]                     ` <CAH2r5mt7hxvaCzaUU0n96p9SVQ6Sso5p6JaYg0gwm6QA0SgHeg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-07 13:32                       ` Jeff Layton
     [not found]                         ` <20120507093233.04d13b0d-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2012-05-07 13:34                           ` Steve French
     [not found]                             ` <CAH2r5msg8C8WMk_+4WYss_109EWec8v2R=vcH4BGmsGtb2tUQw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-07 13:36                               ` Steve French
     [not found]                                 ` <CAH2r5msOqC=jgX7m6GfKs_S7oMaxzC5rh+0_-ZGLYrVOJri=Vg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-07 13:51                                   ` Jeff Layton
2012-05-11 17:21           ` Jeff Layton
2012-03-26  9:21   ` [PATCH 04/16] CIFS: Add SMB2 status codes Pavel Shilovsky
     [not found]     ` <1332753703-4315-5-git-send-email-piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>
2012-05-06 14:10       ` Jeff Layton
2012-03-26  9:21   ` [PATCH 06/16] CIFS: Make transport routines work with SMB2 Pavel Shilovsky
2012-03-26  9:21   ` [PATCH 07/16] CIFS: Add SMB2 credits support Pavel Shilovsky
2012-03-26  9:21   ` [PATCH 08/16] CIFS: Make demultiplex_thread work with SMB2 code Pavel Shilovsky
2012-03-26  9:21   ` [PATCH 09/16] CIFS: Respect SMB2 max hdr size for cifs_request kmem_cache Pavel Shilovsky
2012-03-26  9:21   ` [PATCH 10/16] CIFS: Add capability to send SMB2 negotiate message Pavel Shilovsky
2012-03-26  9:21   ` [PATCH 11/16] CIFS: Add session setup/logoff capability for SMB2 Pavel Shilovsky
2012-03-26  9:21   ` [PATCH 12/16] CIFS: Add tree connect/disconnect " Pavel Shilovsky
2012-03-26  9:21   ` [PATCH 13/16] CIFS: Process reconnects for SMB2 shares Pavel Shilovsky
2012-03-26  9:21   ` [PATCH 14/16] CIFS: Add SMB2 support for is_path_accessible Pavel Shilovsky
2012-03-26  9:21   ` [PATCH 15/16] CIFS: Query SMB2 inode info Pavel Shilovsky
2012-03-26  9:21   ` [PATCH 16/16] CIFS: Get SMB2 mount work Pavel Shilovsky

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=CAH2r5mt7hxvaCzaUU0n96p9SVQ6Sso5p6JaYg0gwm6QA0SgHeg@mail.gmail.com \
    --to=smfrench-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org \
    /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.