Bug 68401 - "proto=rdma" mount fails if "port=" is not also specified.
Summary: "proto=rdma" mount fails if "port=" is not also specified.
Status: RESOLVED CODE_FIX
Alias: None
Product: File System
Classification: Unclassified
Component: NFS (show other bugs)
Hardware: All Linux
: P1 enhancement
Assignee: Chuck Lever
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-09 19:41 UTC by Chuck Lever
Modified: 2022-02-21 16:11 UTC (History)
6 users (show)

See Also:
Kernel Version: 3.8
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Potential kernel patch to address bz 68401 (1.94 KB, patch)
2014-01-22 20:05 UTC, Chuck Lever
Details | Diff

Description Chuck Lever 2014-01-09 19:41:24 UTC
If "port=" is not specified during an NFS/RDMA mount attempt, the mount command fails.

Kernel log for "mount -o rdma,vers=4 server:/share /mnt":

Jan  8 15:58:28 manet kernel: rpcrdma: connection to 10.0.0.1:2049 closed (-111)
Jan  8 15:58:28 manet kernel: rpcrdma: connection to 10.0.0.1:2049 closed (-111)
Jan  8 15:58:28 manet kernel: rpcrdma: connection to 10.0.0.1:2049 closed (-111)
Jan  8 15:58:28 manet kernel: rpcrdma: connection to 10.0.0.1:2049 closed (-111)

Kernel log for "mount -o rdma,vers=3 server:/share /mnt":

Jan  8 15:59:13 manet kernel: rpcrdma: connection to 10.0.0.1:0 closed (-111)
Jan  8 15:59:13 manet kernel: rpcrdma: connection to 10.0.0.1:0 closed (-111)
Jan  8 15:59:13 manet kernel: rpcrdma: connection to 10.0.0.1:0 closed (-111)
Jan  8 15:59:13 manet kernel: rpcrdma: connection to 10.0.0.1:0 closed (-111)

When "proto=rdma" is specified, the default port should be 20049 (see RFC 5666).  Port assignment recorded by IANA:

 
http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=nfsrdma

The kernel should set the port to 20049 if "proto=rdma" is specified and the user did not specify "port=".
Comment 1 Trond Myklebust 2014-01-09 20:36:57 UTC
Could we perhaps fix this in userland instead of hard-coding new server ports in the kernel?

Basically, if the mount fails with ECONNREFUSED, then have the mount utility try to look up the 'nfsrdma' service in the /etc/services file, and pass that info to the mount syscall.
Comment 2 Trond Myklebust 2014-01-09 20:41:53 UTC
One more question: Is there a way for the server to advertise the RDMA service port using rpcbind?
Comment 3 Chuck Lever 2014-01-09 20:58:25 UTC
(In reply to Trond Myklebust from comment #1)
> Could we perhaps fix this in userland instead of hard-coding new server
> ports in the kernel?
> 
> Basically, if the mount fails with ECONNREFUSED, then have the mount utility
> try to look up the 'nfsrdma' service in the /etc/services file, and pass
> that info to the mount syscall.

I don't see the need to retry...?  If "proto=rdma" is specified now, the port setting is undefined for vers=3, and is wrong for vers=4.

Solaris clients negotiate 1. rdma, 2. tcp, 3. udp (if vers<4).  Should we assume in the long run Linux is going to try 1. tcp, 2. udp (if vers<4), 3. rdma ?

Port 2049 is defined in RFCs for NFSv4 over TCP, and likewise, port 20049 is similarly defined in RFC 5666.  If "port=" isn't specified by the admin, it is simple for mount.nfs to add the standard setting and be done with it.  But that's not the way kernel handles this for NFSv4 over TCP, AFAICT.
Comment 4 Chuck Lever 2014-01-09 20:59:03 UTC
(In reply to Trond Myklebust from comment #2)
> One more question: Is there a way for the server to advertise the RDMA
> service port using rpcbind?

rpcinfo doesn't show an "rdma" registration for any RPC service on my Solaris server.  So it wouldn't help when mounting existing Solaris servers.

I can ask Talpey if he thinks getting rpcbind involved is wise.  My impression is that the whole concept of port is meaningless for RDMA, and it should be treated the same way NFSv4 over TCP treats it: just use port 20049 unless otherwise specified.
Comment 5 Chuck Lever 2014-01-09 21:00:50 UTC
All that said, I have a slight preference for handling this in the kernel, since it's part of an Internet standard (and thus not a policy) and this is how it already works for NFSv4 over TCP.  But I'm not religious about it.
Comment 6 Chuck Lever 2014-01-22 20:05:47 UTC
Created attachment 123061 [details]
Potential kernel patch to address bz 68401

To keep the conversation moving, here's a patch that implements the new behavior in the kernel.  We can also look at mount.nfs changes, if you like.
Comment 7 Todd Vierling 2014-03-24 18:35:11 UTC
RFC5667 doesn't require that the service be registered with rpcbind, and for v4, specifically mandates that port without exception (or requirement for portmap to show the service).
Comment 9 Chuck Lever 2022-02-21 16:11:39 UTC
This issue appears to have been addressed by commit 0dfbb5f05e78 ("NFS: Make "port=" mount option optional for RDMA mounts"), available in the v5.0 kernel.

Note You need to log in before you can comment on or make changes to this bug.