Blame SOURCES/nfs-utils-2.3.3-nfsconf-rdmaport.patch

d4362b
commit 0240df0e8ccf7be2706a6a10a2a620f8eda55275
d4362b
Author: Yongcheng Yang <yongcheng.yang@gmail.com>
d4362b
Date:   Thu Sep 5 07:36:26 2019 -0400
d4362b
d4362b
    nfsd: Adjust nfs.conf setting/parsing of rdma port
d4362b
    
d4362b
    The rpc.nfsd program can use option "--rdma" to enable
d4362b
    RDMA on the standard port (nfsrdma/20049) or "--rdma=port"
d4362b
    for an alternate port.
d4362b
    
d4362b
    But now in /etc/nfs.conf, we need to specify the port
d4362b
    number (e.g. rdma=nfsrdma) to enable it, which is not
d4362b
    convenient.
d4362b
    The default setting "rdma=n" may cause more confusion.
d4362b
    
d4362b
    Update to enable RDMA on standard port when setting
d4362b
    boolean YES to "rdma=". And using "rdma-port=" for an
d4362b
    alternate port if necessary.
d4362b
    
d4362b
    Also let previous config (e.g. rdma=nfsrdma) work as well.
d4362b
    
d4362b
    Signed-off-by: Yongcheng Yang <yongcheng.yang@gmail.com>
d4362b
    Signed-off-by: Steve Dickson <steved@redhat.com>
d4362b
d4362b
diff --git a/nfs.conf b/nfs.conf
d4362b
index 85097fd..186a5b1 100644
d4362b
--- a/nfs.conf
d4362b
+++ b/nfs.conf
d4362b
@@ -63,6 +63,7 @@
d4362b
 # vers4.1=y
d4362b
 # vers4.2=y
d4362b
 # rdma=n
d4362b
+# rdma-port=20049
d4362b
 #
d4362b
 [statd]
d4362b
 # debug=0
d4362b
diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
d4362b
index b256bd9..a412a02 100644
d4362b
--- a/utils/nfsd/nfsd.c
d4362b
+++ b/utils/nfsd/nfsd.c
d4362b
@@ -92,7 +92,14 @@ main(int argc, char **argv)
d4362b
 	port = conf_get_str("nfsd", "port");
d4362b
 	if (!port)
d4362b
 		port = "nfs";
d4362b
-	rdma_port = conf_get_str("nfsd", "rdma");
d4362b
+	if (conf_get_bool("nfsd", "rdma", false)) {
d4362b
+		rdma_port = conf_get_str("nfsd", "rdma-port");
d4362b
+		if (!rdma_port)
d4362b
+			rdma_port = "nfsrdma";
d4362b
+	}
d4362b
+	/* backward compatibility - nfs.conf used to set rdma port directly */
d4362b
+	if (!rdma_port)
d4362b
+		rdma_port = conf_get_str("nfsd", "rdma");
d4362b
 	if (conf_get_bool("nfsd", "udp", NFSCTL_UDPISSET(protobits)))
d4362b
 		NFSCTL_UDPSET(protobits);
d4362b
 	else
d4362b
diff --git a/utils/nfsd/nfsd.man b/utils/nfsd/nfsd.man
d4362b
index d83ef86..2701ba7 100644
d4362b
--- a/utils/nfsd/nfsd.man
d4362b
+++ b/utils/nfsd/nfsd.man
d4362b
@@ -144,7 +144,11 @@ The lease time for NFSv4, in seconds.
d4362b
 Set the port for TCP/UDP to bind to.
d4362b
 .TP
d4362b
 .B rdma
d4362b
-Set RDMA port.  Use "rdma=nfsrdma" to enable standard port.
d4362b
+Enable RDMA port (with "on" or "yes" etc) on the standard port
d4362b
+("nfsrdma", port 20049).
d4362b
+.TP
d4362b
+.B rdma-port
d4362b
+Set an alternate RDMA port.
d4362b
 .TP
d4362b
 .B UDP
d4362b
 Enable (with "on" or "yes" etc) or disable ("off", "no") UDP support.