public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Anna Schumaker <Anna.Schumaker-ZwjVKphTwtPQT0dZR+AlfA@public.gmane.org>
To: Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v1 2/4] nfs: Referrals should use the same proto setting as their parent
Date: Tue, 5 Dec 2017 10:36:20 -0500	[thread overview]
Message-ID: <396baae6-8372-e7bc-97e4-d5c27b341f8d@Netapp.com> (raw)
In-Reply-To: <20171204191338.18629.29071.stgit-FYjufvaPoItvLzlybtyyYzGyq/o6K9yX@public.gmane.org>

Hi Chuck,

On 12/04/2017 02:13 PM, Chuck Lever wrote:
> Helen Chao <helen.chao-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> noticed that when a user
> traverses a referral on an NFS/RDMA mount, the resulting submount
> always uses TCP.
> 
> This behavior does not match the vers= setting when traversing
> a referral (vers=4.1 is preserved). It also does not match the
> behavior of crossing from the pseudofs into a real filesystem
> (proto=rdma is preserved in that case).
> 
> The Linux NFS client does not currently support the
> fs_locations_info attribute. The situation is similar for all
> NFSv4 servers I know of. Therefore until the community has broad
> support for fs_locations_info, when following a referral:
> 
>  - First try to connect with RPC-over-RDMA. This will fail quickly
>    if the client has no RDMA-capable interfaces.
> 
>  - If connecting with RPC-over-RDMA fails, or the RPC-over-RDMA
>    transport is not available, use TCP.

Won't this have the opposite problem if the client and server have RDMA interfaces, but are currently mounted over TCP instead?

Anna

> 
> Reported-by: Helen Chao <helen.chao-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> ---
>  fs/nfs/nfs4client.c    |   23 ++++++++++++++++++++---
>  fs/nfs/nfs4namespace.c |    2 --
>  2 files changed, 20 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
> index 12bbab0..a3d5592 100644
> --- a/fs/nfs/nfs4client.c
> +++ b/fs/nfs/nfs4client.c
> @@ -1114,19 +1114,36 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data,
>  	/* Initialise the client representation from the parent server */
>  	nfs_server_copy_userdata(server, parent_server);
>  
> -	/* Get a client representation.
> -	 * Note: NFSv4 always uses TCP, */
> +	/* Get a client representation */
> +#ifdef CONFIG_SUNRPC_XPRT_RDMA
> +	rpc_set_port(data->addr, NFS_RDMA_PORT);
>  	error = nfs4_set_client(server, data->hostname,
>  				data->addr,
>  				data->addrlen,
>  				parent_client->cl_ipaddr,
> -				rpc_protocol(parent_server->client),
> +				XPRT_TRANSPORT_RDMA,
> +				parent_server->client->cl_timeout,
> +				parent_client->cl_mvops->minor_version,
> +				parent_client->cl_net);
> +	if (!error)
> +		goto init_server;
> +#endif	/* CONFIG_SUNRPC_XPRT_RDMA */
> +
> +	rpc_set_port(data->addr, NFS_PORT);
> +	error = nfs4_set_client(server, data->hostname,
> +				data->addr,
> +				data->addrlen,
> +				parent_client->cl_ipaddr,
> +				XPRT_TRANSPORT_TCP,
>  				parent_server->client->cl_timeout,
>  				parent_client->cl_mvops->minor_version,
>  				parent_client->cl_net);
>  	if (error < 0)
>  		goto error;
>  
> +#ifdef CONFIG_SUNRPC_XPRT_RDMA
> +init_server:
> +#endif
>  	error = nfs_init_server_rpcclient(server, parent_server->client->cl_timeout, data->authflavor);
>  	if (error < 0)
>  		goto error;
> diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c
> index 8c3f327..24f06dc 100644
> --- a/fs/nfs/nfs4namespace.c
> +++ b/fs/nfs/nfs4namespace.c
> @@ -270,8 +270,6 @@ static struct vfsmount *try_location(struct nfs_clone_mount *mountdata,
>  		if (mountdata->addrlen == 0)
>  			continue;
>  
> -		rpc_set_port(mountdata->addr, NFS_PORT);
> -
>  		memcpy(page2, buf->data, buf->len);
>  		page2[buf->len] = '\0';
>  		mountdata->hostname = page2;
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-12-05 15:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-04 19:13 [PATCH v1 0/4] Use same proto= after traversing a referral Chuck Lever
     [not found] ` <20171204190904.18629.70341.stgit-FYjufvaPoItvLzlybtyyYzGyq/o6K9yX@public.gmane.org>
2017-12-04 19:13   ` [PATCH v1 1/4] nfs: Define NFS_RDMA_PORT Chuck Lever
     [not found]     ` <20171204191330.18629.77069.stgit-FYjufvaPoItvLzlybtyyYzGyq/o6K9yX@public.gmane.org>
2017-12-05 15:09       ` Devesh Sharma
     [not found]         ` <CANjDDBg3qsn5oWzmTSi5e3eKJKkdEceh0GUTe+pFDAGCxkDqGg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-05 18:49           ` Chuck Lever
     [not found]             ` <06D33DF4-6BAC-411B-8A08-5098E52720C6-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-12-06  6:04               ` Devesh Sharma
     [not found]                 ` <CANjDDBiTSDfzvj6qLaeEf+-Jx=XA9W2rzA2wW_q45MfauwffPA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-06 14:52                   ` Chuck Lever
     [not found]                     ` <D1CAA846-EF79-4A1B-9BFE-70EDA1B7BBF5-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-12-06 16:42                       ` Devesh Sharma
2017-12-04 19:13   ` [PATCH v1 2/4] nfs: Referrals should use the same proto setting as their parent Chuck Lever
     [not found]     ` <20171204191338.18629.29071.stgit-FYjufvaPoItvLzlybtyyYzGyq/o6K9yX@public.gmane.org>
2017-12-05 15:36       ` Anna Schumaker [this message]
     [not found]         ` <396baae6-8372-e7bc-97e4-d5c27b341f8d-ZwjVKphTwtPQT0dZR+AlfA@public.gmane.org>
2017-12-05 19:04           ` Chuck Lever
     [not found]             ` <CB2E9621-0F9B-49A0-9A2B-59FA2F898976-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-12-13 15:15               ` Chuck Lever
2017-12-04 19:13   ` [PATCH v1 3/4] nfs: Update server port after referral or migration Chuck Lever
2017-12-04 19:13   ` [PATCH v1 4/4] SUNRPC: Remove rpc_protocol() Chuck Lever

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=396baae6-8372-e7bc-97e4-d5c27b341f8d@Netapp.com \
    --to=anna.schumaker-zwjvkphtwtpqt0dzr+alfa@public.gmane.org \
    --cc=chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox