2020-11-09 21:22:10

by Trond Myklebust

[permalink] [raw]
Subject: [PATCH v2 0/5] Add RDMA support to the pNFS file+flexfiles data channels

From: Trond Myklebust <[email protected]>

Add support for connecting to the pNFS files/flexfiles data servers
through RDMA, assuming that the GETDEVICEINFO call advertises that
support.

v2: Fix layoutstats encoding for pNFS/flexfiles.

Trond Myklebust (5):
SUNRPC: xprt_load_transport() needs to support the netid "rdma6"
NFSv4/pNFS: Use connections to a DS that are all of the same protocol
family
NFSv4/pNFS: Store the transport type in struct nfs4_pnfs_ds_addr
pNFS/flexfiles: Fix up layoutstats reporting for non-TCP transports
pNFS: Clean up open coded kmemdup_nul()

fs/nfs/flexfilelayout/flexfilelayout.c | 34 +++++++++--
fs/nfs/pnfs.h | 1 +
fs/nfs/pnfs_nfs.c | 80 +++++++++++++++++++-------
net/sunrpc/xprtrdma/module.c | 2 +
4 files changed, 91 insertions(+), 26 deletions(-)

--
2.28.0


2020-11-09 21:22:10

by Trond Myklebust

[permalink] [raw]
Subject: [PATCH v2 1/5] SUNRPC: xprt_load_transport() needs to support the netid "rdma6"

From: Trond Myklebust <[email protected]>

According to RFC5666, the correct netid for an IPv6 addressed RDMA
transport is "rdma6", which we've supported as a mount option since
Linux-4.7. The problem is when we try to load the module "xprtrdma6",
that will fail, since there is no modulealias of that name.

Fixes: 181342c5ebe8 ("xprtrdma: Add rdma6 option to support NFS/RDMA IPv6")
Signed-off-by: Trond Myklebust <[email protected]>
---
net/sunrpc/xprtrdma/module.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/net/sunrpc/xprtrdma/module.c b/net/sunrpc/xprtrdma/module.c
index 620327c01302..fb55983628b4 100644
--- a/net/sunrpc/xprtrdma/module.c
+++ b/net/sunrpc/xprtrdma/module.c
@@ -23,7 +23,9 @@ MODULE_AUTHOR("Open Grid Computing and Network Appliance, Inc.");
MODULE_DESCRIPTION("RPC/RDMA Transport");
MODULE_LICENSE("Dual BSD/GPL");
MODULE_ALIAS("svcrdma");
+MODULE_ALIAS("svcrdma6");
MODULE_ALIAS("xprtrdma");
+MODULE_ALIAS("xprtrdma6");

static void __exit rpc_rdma_cleanup(void)
{
--
2.28.0

2020-11-09 21:22:56

by Trond Myklebust

[permalink] [raw]
Subject: [PATCH v2 2/5] NFSv4/pNFS: Use connections to a DS that are all of the same protocol family

From: Trond Myklebust <[email protected]>

If the pNFS metadata server advertises multiple addresses for the same
data server, we should try to connect to just one protocol family and
transport type on the assumption that homogeneity will improve performance.

Signed-off-by: Trond Myklebust <[email protected]>
---
fs/nfs/pnfs_nfs.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/fs/nfs/pnfs_nfs.c b/fs/nfs/pnfs_nfs.c
index 679767ac258d..7027dac41cc7 100644
--- a/fs/nfs/pnfs_nfs.c
+++ b/fs/nfs/pnfs_nfs.c
@@ -860,6 +860,9 @@ static int _nfs4_pnfs_v3_ds_connect(struct nfs_server *mds_srv,
.addrlen = da->da_addrlen,
.servername = clp->cl_hostname,
};
+
+ if (da->da_addr.ss_family != clp->cl_addr.ss_family)
+ continue;
/* Add this address as an alias */
rpc_clnt_add_xprt(clp->cl_rpcclient, &xprt_args,
rpc_clnt_test_and_add_xprt, NULL);
@@ -920,6 +923,8 @@ static int _nfs4_pnfs_v4_ds_connect(struct nfs_server *mds_srv,
.data = &xprtdata,
};

+ if (da->da_addr.ss_family != clp->cl_addr.ss_family)
+ continue;
/**
* Test this address for session trunking and
* add as an alias
--
2.28.0

2020-11-09 21:50:33

by Chuck Lever III

[permalink] [raw]
Subject: Re: [PATCH v2 1/5] SUNRPC: xprt_load_transport() needs to support the netid "rdma6"



> On Nov 9, 2020, at 4:10 PM, [email protected] wrote:
>
> From: Trond Myklebust <[email protected]>
>
> According to RFC5666, the correct netid for an IPv6 addressed RDMA
> transport is "rdma6", which we've supported as a mount option since
> Linux-4.7. The problem is when we try to load the module "xprtrdma6",
> that will fail, since there is no modulealias of that name.

Trying to wrap my head around this. Who is forming the legacy names
"xprtrdma6" and "svcrdma6" ?

The module name these days is "rpcrdma". Seems like you should fix
the code that is trying to load these by the wrong name rather than
adding more legacy names.


> Fixes: 181342c5ebe8 ("xprtrdma: Add rdma6 option to support NFS/RDMA IPv6")
> Signed-off-by: Trond Myklebust <[email protected]>
> ---
> net/sunrpc/xprtrdma/module.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/net/sunrpc/xprtrdma/module.c b/net/sunrpc/xprtrdma/module.c
> index 620327c01302..fb55983628b4 100644
> --- a/net/sunrpc/xprtrdma/module.c
> +++ b/net/sunrpc/xprtrdma/module.c
> @@ -23,7 +23,9 @@ MODULE_AUTHOR("Open Grid Computing and Network Appliance, Inc.");
> MODULE_DESCRIPTION("RPC/RDMA Transport");
> MODULE_LICENSE("Dual BSD/GPL");
> MODULE_ALIAS("svcrdma");
> +MODULE_ALIAS("svcrdma6");
> MODULE_ALIAS("xprtrdma");
> +MODULE_ALIAS("xprtrdma6");
>
> static void __exit rpc_rdma_cleanup(void)
> {
> --
> 2.28.0
>

--
Chuck Lever



2020-11-09 22:06:58

by Trond Myklebust

[permalink] [raw]
Subject: Re: [PATCH v2 1/5] SUNRPC: xprt_load_transport() needs to support the netid "rdma6"

On Mon, 2020-11-09 at 16:50 -0500, Chuck Lever wrote:
>
>
> > On Nov 9, 2020, at 4:10 PM, [email protected] wrote:
> >
> > From: Trond Myklebust <[email protected]>
> >
> > According to RFC5666, the correct netid for an IPv6 addressed RDMA
> > transport is "rdma6", which we've supported as a mount option since
> > Linux-4.7. The problem is when we try to load the module
> > "xprtrdma6",
> > that will fail, since there is no modulealias of that name.
>
> Trying to wrap my head around this. Who is forming the legacy names
> "xprtrdma6" and "svcrdma6" ?

I don't care about "svcrdma6", because nothing uses that name, AFAICS,
because __write_ports_addxprt() appears to use the "transport name",
whatever that is.

> The module name these days is "rpcrdma". Seems like you should fix
> the code that is trying to load these by the wrong name rather than
> adding more legacy names.

No, I'm not going to do that.

The intention was always that xprt_load_transport() should take the
netid as its argument. Furthermore, it makes no sense for either the
NFS or generic RPC layers to have to figure out how by themselves how
to translate netids into transport module names.

>
> > Fixes: 181342c5ebe8 ("xprtrdma: Add rdma6 option to support
> > NFS/RDMA IPv6")
> > Signed-off-by: Trond Myklebust <[email protected]>
> > ---
> > net/sunrpc/xprtrdma/module.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/net/sunrpc/xprtrdma/module.c
> > b/net/sunrpc/xprtrdma/module.c
> > index 620327c01302..fb55983628b4 100644
> > --- a/net/sunrpc/xprtrdma/module.c
> > +++ b/net/sunrpc/xprtrdma/module.c
> > @@ -23,7 +23,9 @@ MODULE_AUTHOR("Open Grid Computing and Network
> > Appliance, Inc.");
> > MODULE_DESCRIPTION("RPC/RDMA Transport");
> > MODULE_LICENSE("Dual BSD/GPL");
> > MODULE_ALIAS("svcrdma");
> > +MODULE_ALIAS("svcrdma6");
> > MODULE_ALIAS("xprtrdma");
> > +MODULE_ALIAS("xprtrdma6");
> >
> > static void __exit rpc_rdma_cleanup(void)
> > {
> > --
> > 2.28.0
> >
>
> --
> Chuck Lever
>
>
>

--
Trond Myklebust
Linux NFS client maintainer, Hammerspace
[email protected]