From patchwork Tue Jun 25 17:58:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 1122187 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qvbtrkwU"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 45YDRb0cgLz9s3l for ; Wed, 26 Jun 2019 03:58:34 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726562AbfFYR6d (ORCPT ); Tue, 25 Jun 2019 13:58:33 -0400 Received: from mail-pl1-f180.google.com ([209.85.214.180]:44976 "EHLO mail-pl1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726447AbfFYR6d (ORCPT ); Tue, 25 Jun 2019 13:58:33 -0400 Received: by mail-pl1-f180.google.com with SMTP id t7so9237064plr.11 for ; Tue, 25 Jun 2019 10:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=fk2TCyC1Su2g+PlRiHnA4v4ETNRXPwwBpn6gfZ+MrQM=; b=qvbtrkwUajIXAsxRCYahGNls5Pn+Ay4uv4LgXWYD+UglRY92UydxbUhOkCYDQHrbnC YwqLr/iSNAv64PSP5TRORICUD5MQ/ntQxDzSWj9juus6NKgM516nKl0XBiCzV4U3IM8y Smq3mCqj4Ne7R/SOSyEi6TjnfsWgWCoA14i5AshWDYUlSRm7S7XzOgSpk9PCTY4wCUWq 3IvqyUyrCLnK5qedfm/u+gokktKXfmv7ejhN2XiBCtpRENOOdNoyPejQlxhj+O+sQla6 2PPlmWqnGS7VjKLar3OvAofHy8/BnOPlDfZPz8LqyBYxaokkxD7rJwm663fz0qfxFfSF 2CPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=fk2TCyC1Su2g+PlRiHnA4v4ETNRXPwwBpn6gfZ+MrQM=; b=s8Wc9aNQP/w+MqhuJ6xxniiR8JmoviHyA+rxqykZ0V9E7KVRkA0fwyLTkHH5K9Z/Qz cEi8d1LJ45OD1zkKhzZB8ILaaTdyzopPR4c19gNhcXXQ+9Jc+QrSKUZS0QPPPc0r/KXm UjzI4G5f8+gibZi524qph3VqPc0Vv2WP3kYZ/X1fOje0g4Oz5GHRoo0lHYSOHAke7D/7 eBOni39dQcr+ZmGooZ5bVQVpz1hkRyhtlysI5VgLPyAD1T7AVN4vtTOpu5pu1JPOJLr/ wEcwyO4o9DC6QBJExKlmGjoBcXMxV3MT5ZAnQvBO4ryvn3A5B4slKKqscRyutsWnESBP hKMg== X-Gm-Message-State: APjAAAV8W0SXEOCKt8IrdMKS4b/GIoQytXvxI4B0Usuxdhy43W19GbvC AEZlMrHM0dKGJw0dYeF0h+LoXq9vyNeBWqSlnszcvg== X-Google-Smtp-Source: APXvYqymwY5qMiLtKGkGox4phRljRV9EzDECWfNSaEKFHntgdzYnUHhxb75q1DYb6et61WN6v09/tpriPCtlBPylWGE= X-Received: by 2002:a17:902:20b:: with SMTP id 11mr23507964plc.78.1561485512439; Tue, 25 Jun 2019 10:58:32 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Tue, 25 Jun 2019 12:58:21 -0500 Message-ID: Subject: rebased part of multichannel patches To: CIFS , =?utf-8?q?Aur=C3=A9lien_Aptel?= Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org I rebased some of Aurelien's series (here is first patch in series that deals with parsing his new mount options) ontop of current for-next (not merged into for-next though - needs more testing etc.) From 30d3c2ff99d916e7db2f8f921debd9b75f7c2d97 Mon Sep 17 00:00:00 2001 From: Aurelien Aptel Date: Tue, 25 Jun 2019 12:52:25 -0500 Subject: [PATCH] smb3: Add mount options for multichannel support Add mount option parsing for "multichannel" and "max_channels=" Followon patches add additional support for setting up and using the channels. Signed-off-by: Aurelien Aptel Signed-off-by: Steve French --- fs/cifs/cifsglob.h | 5 +++++ fs/cifs/connect.c | 26 ++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index dd99d0318b77..e06e5dd80193 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -86,6 +86,9 @@ /* maximum number of PDUs in one compound */ #define MAX_COMPOUND 5 +/* maximum number of channels (socket connections) in multichannel use case */ +#define CIFS_MAX_CHANNELS 16 + /* * Default number of credits to keep available for SMB3. * This value is chosen somewhat arbitrarily. The Windows client @@ -586,6 +589,7 @@ struct smb_vol { bool resilient:1; /* noresilient not required since not fored for CA */ bool domainauto:1; bool rdma:1; + bool multichannel:1; unsigned int bsize; unsigned int rsize; unsigned int wsize; @@ -600,6 +604,7 @@ struct smb_vol { unsigned int echo_interval; /* echo interval in secs */ __u64 snapshot_time; /* needed for timewarp tokens */ __u32 handle_timeout; /* persistent and durable handle timeout in ms */ + unsigned int max_channels; unsigned int max_credits; /* smb3 max_credits 10 < credits < 60000 */ __u16 compression; /* compression algorithm 0xFFFF default 0=disabled */ }; diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index da85a251a609..a7c8a03f61d2 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -97,7 +97,7 @@ enum { Opt_persistent, Opt_nopersistent, Opt_resilient, Opt_noresilient, Opt_domainauto, Opt_rdma, Opt_modeace, - Opt_compress, + Opt_compress, Opt_multichannel, Opt_nomultichannel, /* Mount options which take numeric value */ Opt_backupuid, Opt_backupgid, Opt_uid, @@ -105,7 +105,7 @@ enum { Opt_dirmode, Opt_port, Opt_blocksize, Opt_rsize, Opt_wsize, Opt_actimeo, Opt_echo_interval, Opt_max_credits, Opt_handletimeout, - Opt_snapshot, + Opt_snapshot, Opt_max_channels, /* Mount options which take string value */ Opt_user, Opt_pass, Opt_ip, @@ -196,6 +196,8 @@ static const match_table_t cifs_mount_option_tokens = { { Opt_noresilient, "noresilienthandles"}, { Opt_domainauto, "domainauto"}, { Opt_rdma, "rdma"}, + { Opt_multichannel, "multichannel" }, + { Opt_nomultichannel, "nomultichannel" }, { Opt_backupuid, "backupuid=%s" }, { Opt_backupgid, "backupgid=%s" }, @@ -215,6 +217,7 @@ static const match_table_t cifs_mount_option_tokens = { { Opt_max_credits, "max_credits=%s" }, { Opt_snapshot, "snapshot=%s" }, { Opt_compress, "compress=%s" }, + { Opt_max_channels, "max_channels=%s" }, { Opt_blank_user, "user=" }, { Opt_blank_user, "username=" }, @@ -1636,6 +1639,10 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, vol->echo_interval = SMB_ECHO_INTERVAL_DEFAULT; + /* default to no multichannel (single server connection) */ + vol->multichannel = false; + vol->max_channels = 1; + if (!mountdata) goto cifs_parse_mount_err; @@ -1922,6 +1929,12 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, cifs_dbg(VFS, "SMB3 compression support is experimental\n"); break; + case Opt_multichannel: + vol->multichannel = true; + break; + case Opt_nomultichannel: + vol->multichannel = false; + break; /* Numeric Values */ case Opt_backupuid: @@ -2073,6 +2086,15 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, } vol->max_credits = option; break; + case Opt_max_channels: + if (get_option_ul(args, &option) || option < 1 || + option > CIFS_MAX_CHANNELS) { + cifs_dbg(VFS, "%s: Invalid max_channels value, needs to be 1-%d\n", + __func__, CIFS_MAX_CHANNELS); + goto cifs_parse_mount_err; + } + vol->max_channels = option; + break; /* String Arguments */ -- 2.20.1