linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Talpey <ttalpey@microsoft.com>
To: Pavel Shilovsky <piastryyy@gmail.com>, Aurelien Aptel <aaptel@suse.com>
Cc: linux-cifs <linux-cifs@vger.kernel.org>,
	Steve French <smfrench@gmail.com>
Subject: RE: [EXTERNAL] Re: [PATCH v4 1/6] cifs: sort interface list by speed
Date: Tue, 26 Nov 2019 16:04:48 +0000	[thread overview]
Message-ID: <DM6PR21MB1433DA86898BCD2C9687956EA0450@DM6PR21MB1433.namprd21.prod.outlook.com> (raw)
In-Reply-To: <CAKywueS3DpPkpeNprSUwrXw=ErZZsn3vRF6uVE646oCWC_8-4w@mail.gmail.com>

> -----Original Message-----
> From: linux-cifs-owner@vger.kernel.org <linux-cifs-owner@vger.kernel.org> On
> Behalf Of Pavel Shilovsky
> Sent: Monday, November 25, 2019 4:29 PM
> To: Aurelien Aptel <aaptel@suse.com>
> Cc: linux-cifs <linux-cifs@vger.kernel.org>; Steve French
> <smfrench@gmail.com>
> Subject: [EXTERNAL] Re: [PATCH v4 1/6] cifs: sort interface list by speed
> 
> сб, 2 нояб. 2019 г. в 18:21, Aurelien Aptel <aaptel@suse.com>:
> >
> > New channels are going to be opened by walking the list sequentially,
> > so by sorting it we will connect to the fastest interfaces first.

Sorting by speed is definitely appropriate, but sorting the other
multichannel attributes is just as important. For example, if the
RDMA attribute is set, the address should actually be excluded
for non-RDMA connections (a second, non-RDMA entry is included,
if the interface supports both). And, the RSS attribute indicates a
"better" destination than non-RSS for a given speed, because it is
more efficient at local traffic management.

Suggest a followon effort to take advantage of these, by excluding
ineligible paths, and raising the sort priority of others.

Tom.

> > Signed-off-by: Aurelien Aptel <aaptel@suse.com>
> > ---
> >  fs/cifs/smb2ops.c | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> >
> > diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
> > index cd55af9b7cc5..ea634581791a 100644
> > --- a/fs/cifs/smb2ops.c
> > +++ b/fs/cifs/smb2ops.c
> > @@ -10,6 +10,7 @@
> >  #include <linux/falloc.h>
> >  #include <linux/scatterlist.h>
> >  #include <linux/uuid.h>
> > +#include <linux/sort.h>
> >  #include <crypto/aead.h>
> >  #include "cifsglob.h"
> >  #include "smb2pdu.h"
> > @@ -558,6 +559,13 @@ parse_server_interfaces(struct
> network_interface_info_ioctl_rsp *buf,
> >         return rc;
> >  }
> >
> > +static int compare_iface(const void *ia, const void *ib)
> > +{
> > +       const struct cifs_server_iface *a = (struct cifs_server_iface *)ia;
> > +       const struct cifs_server_iface *b = (struct cifs_server_iface *)ib;
> > +
> > +       return a->speed == b->speed ? 0 : (a->speed > b->speed ? -1 : 1);
> > +}
> >
> >  static int
> >  SMB3_request_interfaces(const unsigned int xid, struct cifs_tcon *tcon)
> > @@ -587,6 +595,9 @@ SMB3_request_interfaces(const unsigned int xid,
> struct cifs_tcon *tcon)
> >         if (rc)
> >                 goto out;
> >
> > +       /* sort interfaces from fastest to slowest */
> > +       sort(iface_list, iface_count, sizeof(*iface_list), compare_iface, NULL);
> > +
> >         spin_lock(&ses->iface_lock);
> >         kfree(ses->iface_list);
> >         ses->iface_list = iface_list;
> > --
> > 2.16.4
> >
> 
> Looks good at the first glance, thanks!
> 
> @Steve, you may add
> 
> Acked-by: Pavel Shilovsky <pshilov@microsoft.com>
> 
> to this and other patches in the series.
> 
> --
> Best regards,
> Pavel Shilovsky

  reply	other threads:[~2019-11-26 16:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-03  1:21 [PATCH v4 0/6] add multichannel support Aurelien Aptel
2019-11-03  1:21 ` [PATCH v4 1/6] cifs: sort interface list by speed Aurelien Aptel
2019-11-25 21:29   ` Pavel Shilovsky
2019-11-26 16:04     ` Tom Talpey [this message]
2019-11-26 16:54       ` [EXTERNAL] " Aurélien Aptel
2019-11-26 18:38         ` Tom Talpey
2019-11-03  1:21 ` [PATCH v4 2/6] cifs: add multichannel mount options and data structs Aurelien Aptel
2019-11-03  1:21 ` [PATCH v4 3/6] cifs: add server param Aurelien Aptel
2019-11-03  1:21 ` [PATCH v4 4/6] cifs: switch servers depending on binding state Aurelien Aptel
2019-11-03  1:21 ` [PATCH v4 5/6] cifs: try opening channels after mounting Aurelien Aptel
2019-11-03  1:21 ` [PATCH v4 6/6] cifs: dump channel info in DebugData Aurelien Aptel

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=DM6PR21MB1433DA86898BCD2C9687956EA0450@DM6PR21MB1433.namprd21.prod.outlook.com \
    --to=ttalpey@microsoft.com \
    --cc=aaptel@suse.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=piastryyy@gmail.com \
    --cc=smfrench@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).