From: NeilBrown <neilb@suse.com>
To: Olga Kornievskaia <aglo@umich.edu>,
Chuck Lever <chuck.lever@oracle.com>,
Schumaker Anna <Anna.Schumaker@netapp.com>,
Trond Myklebust <trondmy@hammerspace.com>
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 6/9] NFS: Add a mount option to specify number of TCP connections to use
Date: Thu, 30 May 2019 10:41:28 +1000 [thread overview]
Message-ID: <155917688876.3988.2056442739107972319.stgit@noble.brown> (raw)
In-Reply-To: <155917564898.3988.6096672032831115016.stgit@noble.brown>
From: Trond Myklebust <trond.myklebust@primarydata.com>
Allow the user to specify that the client should use multiple connections
to the server. For the moment, this functionality will be limited to
TCP and to NFSv4.x (x>0).
The value is not yet copied through from parsed data to the
nfs_client, later patches will do that.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: NeilBrown <neilb@suse.com>
---
fs/nfs/internal.h | 1 +
fs/nfs/super.c | 12 ++++++++++++
include/linux/nfs_fs_sb.h | 1 +
3 files changed, 14 insertions(+)
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 498fab72f70b..bba09dace5d6 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -123,6 +123,7 @@ struct nfs_parsed_mount_data {
char *export_path;
int port;
unsigned short protocol;
+ unsigned short nconnect;
} nfs_server;
void *lsm_opts;
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index f88ddac2dcdf..bd3ba1d323ea 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -77,6 +77,8 @@
#define NFS_DEFAULT_VERSION 2
#endif
+#define NFS_MAX_CONNECTIONS 16
+
enum {
/* Mount options that take no arguments */
Opt_soft, Opt_softerr, Opt_hard,
@@ -108,6 +110,7 @@ enum {
Opt_nfsvers,
Opt_sec, Opt_proto, Opt_mountproto, Opt_mounthost,
Opt_addr, Opt_mountaddr, Opt_clientaddr,
+ Opt_nconnect,
Opt_lookupcache,
Opt_fscache_uniq,
Opt_local_lock,
@@ -181,6 +184,8 @@ static const match_table_t nfs_mount_option_tokens = {
{ Opt_mounthost, "mounthost=%s" },
{ Opt_mountaddr, "mountaddr=%s" },
+ { Opt_nconnect, "nconnect=%s" },
+
{ Opt_lookupcache, "lookupcache=%s" },
{ Opt_fscache_uniq, "fsc=%s" },
{ Opt_local_lock, "local_lock=%s" },
@@ -673,6 +678,8 @@ static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss,
seq_printf(m, ",proto=%s",
rpc_peeraddr2str(nfss->client, RPC_DISPLAY_NETID));
rcu_read_unlock();
+ if (clp->cl_nconnect > 0)
+ seq_printf(m, ",nconnect=%u", clp->cl_nconnect);
if (version == 4) {
if (nfss->port != NFS_PORT)
seq_printf(m, ",port=%u", nfss->port);
@@ -1549,6 +1556,11 @@ static int nfs_parse_mount_options(char *raw,
if (mnt->mount_server.addrlen == 0)
goto out_invalid_address;
break;
+ case Opt_nconnect:
+ if (nfs_get_option_ul_bound(args, &option, 1, NFS_MAX_CONNECTIONS))
+ goto out_invalid_value;
+ mnt->nfs_server.nconnect = option;
+ break;
case Opt_lookupcache:
string = match_strdup(args);
if (string == NULL)
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 1e78032a174b..a87fe854f008 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -58,6 +58,7 @@ struct nfs_client {
struct nfs_subversion * cl_nfs_mod; /* pointer to nfs version module */
u32 cl_minorversion;/* NFSv4 minorversion */
+ unsigned int cl_nconnect; /* Number of connections */
const char * cl_principal; /* used for machine cred */
#if IS_ENABLED(CONFIG_NFS_V4)
next prev parent reply other threads:[~2019-05-30 0:43 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-30 0:41 [PATCH 0/9] Multiple network connections for a single NFS mount NeilBrown
2019-05-30 0:41 ` [PATCH 2/9] SUNRPC: Allow creation of RPC clients with multiple connections NeilBrown
2019-05-30 0:41 ` [PATCH 9/9] NFS: Allow multiple connections to a NFSv2 or NFSv3 server NeilBrown
2019-05-30 0:41 ` [PATCH 4/9] SUNRPC: enhance rpc_clnt_show_stats() to report on all xprts NeilBrown
2019-05-30 0:41 ` [PATCH 5/9] SUNRPC: add links for all client xprts to debugfs NeilBrown
2019-05-30 0:41 ` [PATCH 3/9] NFS: send state management on a single connection NeilBrown
2019-07-23 18:11 ` Schumaker, Anna
2019-07-23 22:54 ` NeilBrown
2019-07-31 2:05 ` [PATCH] NFS: add flags arg to nfs4_call_sync_sequence() NeilBrown
2019-05-30 0:41 ` [PATCH 8/9] pNFS: Allow multiple connections to the DS NeilBrown
2019-05-30 0:41 ` [PATCH 1/9] SUNRPC: Add basic load balancing to the transport switch NeilBrown
2019-05-30 0:41 ` [PATCH 7/9] NFSv4: Allow multiple connections to NFSv4.x servers NeilBrown
2019-05-30 0:41 ` NeilBrown [this message]
2019-05-30 17:05 ` [PATCH 0/9] Multiple network connections for a single NFS mount Tom Talpey
2019-05-30 17:20 ` Olga Kornievskaia
2019-05-30 17:41 ` Tom Talpey
2019-05-30 18:41 ` Olga Kornievskaia
2019-05-31 1:45 ` Tom Talpey
2019-05-30 22:38 ` NeilBrown
2019-05-31 1:48 ` Tom Talpey
2019-05-31 2:31 ` NeilBrown
2019-05-31 12:39 ` Tom Talpey
2019-05-30 23:53 ` Rick Macklem
2019-05-31 0:15 ` J. Bruce Fields
2019-05-31 1:01 ` NeilBrown
2019-05-31 2:20 ` Rick Macklem
2019-05-31 12:36 ` Tom Talpey
2019-05-31 13:33 ` Trond Myklebust
2019-05-30 17:56 ` Chuck Lever
2019-05-30 18:59 ` Olga Kornievskaia
2019-05-30 22:56 ` NeilBrown
2019-05-31 13:46 ` Chuck Lever
2019-05-31 15:38 ` J. Bruce Fields
2019-06-11 1:09 ` NeilBrown
2019-06-11 14:51 ` Chuck Lever
2019-06-11 15:05 ` Tom Talpey
2019-06-11 15:20 ` Trond Myklebust
2019-06-11 15:35 ` Chuck Lever
2019-06-11 16:41 ` Trond Myklebust
2019-06-11 17:32 ` Chuck Lever
2019-06-11 17:44 ` Trond Myklebust
2019-06-12 12:34 ` Steve Dickson
2019-06-12 12:47 ` Trond Myklebust
2019-06-12 13:10 ` Trond Myklebust
2019-06-11 15:34 ` Olga Kornievskaia
2019-06-11 17:46 ` Chuck Lever
2019-06-11 19:13 ` Olga Kornievskaia
2019-06-11 20:02 ` Tom Talpey
2019-06-11 20:09 ` Chuck Lever
2019-06-11 21:10 ` Olga Kornievskaia
2019-06-11 21:35 ` Tom Talpey
2019-06-11 22:55 ` NeilBrown
2019-06-12 12:55 ` Tom Talpey
2019-06-11 23:02 ` NeilBrown
2019-06-11 23:21 ` NeilBrown
2019-06-12 12:52 ` Tom Talpey
2019-06-11 23:42 ` NeilBrown
2019-06-12 12:39 ` Steve Dickson
2019-06-12 17:36 ` Chuck Lever
2019-06-12 23:03 ` NeilBrown
2019-06-13 16:13 ` Chuck Lever
2019-06-12 1:49 ` NeilBrown
2019-06-12 18:32 ` Chuck Lever
2019-06-12 23:37 ` NeilBrown
2019-06-13 16:27 ` Chuck Lever
2019-05-31 0:24 ` J. Bruce Fields
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=155917688876.3988.2056442739107972319.stgit@noble.brown \
--to=neilb@suse.com \
--cc=Anna.Schumaker@netapp.com \
--cc=aglo@umich.edu \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=trondmy@hammerspace.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).