public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] mount: Updated RDMA processing in the mount command.
@ 2010-09-07 20:21 Steve Dickson
  2010-09-07 20:21 ` [PATCH 1/3] Added support for the the -o rdma option Steve Dickson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Steve Dickson @ 2010-09-07 20:21 UTC (permalink / raw)
  To: Linux NFS Mailing list

Here the code I've been testing for the last 4 days.

Steve Dickson (3):
  Added support for the the -o rdma option
  Ensure the corrrect address family is used on RDMA mounts
  Document the rdma mount option in the nfs man page

 support/nfs/getport.c |   21 +++++++++++++++++++++
 utils/mount/nfs.man   |   14 +++++++++++++-
 utils/mount/stropts.c |   33 +++++++++++++++++++++++----------
 3 files changed, 57 insertions(+), 11 deletions(-)

-- 
1.7.2.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] Added support for the the -o rdma option
  2010-09-07 20:21 [PATCH 0/3] mount: Updated RDMA processing in the mount command Steve Dickson
@ 2010-09-07 20:21 ` Steve Dickson
  2010-09-07 20:22 ` [PATCH 2/3] Ensure the corrrect address family is used on RDMA mounts Steve Dickson
  2010-09-07 20:22 ` [PATCH 3/3] Document the rdma mount option in the nfs man page Steve Dickson
  2 siblings, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2010-09-07 20:21 UTC (permalink / raw)
  To: Linux NFS Mailing list

Network transports can be specified with both
the proto= and -o options. The patch adds support
for the -o rdma option.

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 utils/mount/stropts.c |   29 ++++++++++++++++++++---------
 1 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index 0241400..eb6ecc5 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -98,6 +98,22 @@ struct nfsmount_info {
 				child;		/* forked bg child? */
 };
 
+/*
+ * Check the options to see if the transport is RDMA
+ */
+static int nfs_rdma_option(struct mount_options *options)
+{
+	char *option;
+
+	if (po_contains(options, "rdma"))
+		return 1;
+	option = po_get(options, "proto");
+	if (option && strcmp(option, "rdma") == 0)
+		return 1;
+
+	return 0;
+}
+
 #ifdef MOUNT_CONFIG
 static void nfs_default_version(struct nfsmount_info *mi);
 
@@ -302,11 +318,8 @@ static int nfs_set_version(struct nfsmount_info *mi)
 
 	if (strncmp(mi->type, "nfs4", 4) == 0)
 		mi->version = 4;
-	else {
-		char *option = po_get(mi->options, "proto");
-		if (option && strcmp(option, "rdma") == 0)
-			mi->version = 3;
-	}
+	else if (mi->version == 0 && nfs_rdma_option(mi->options))
+		mi->version = 3; /* The default for RDMA mounts */
 
 	/*
 	 * If we still don't know, check for version-specific
@@ -491,13 +504,11 @@ nfs_rewrite_pmap_mount_options(struct mount_options *options)
 	struct sockaddr *mnt_saddr = &mnt_address.sa;
 	socklen_t mnt_salen = sizeof(mnt_address);
 	struct pmap mnt_pmap;
-	char *option;
 
 	/*
-	 * Skip option negotiation for proto=rdma mounts.
+	 * Skip option negotiation for RDMA mounts.
 	 */
-	option = po_get(options, "proto");
-	if (option && strcmp(option, "rdma") == 0)
+	if (nfs_rdma_option(options))
 		goto out;
 
 	/*
-- 
1.7.2.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] Ensure the corrrect address family is used on RDMA mounts
  2010-09-07 20:21 [PATCH 0/3] mount: Updated RDMA processing in the mount command Steve Dickson
  2010-09-07 20:21 ` [PATCH 1/3] Added support for the the -o rdma option Steve Dickson
@ 2010-09-07 20:22 ` Steve Dickson
  2010-09-07 20:22 ` [PATCH 3/3] Document the rdma mount option in the nfs man page Steve Dickson
  2 siblings, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2010-09-07 20:22 UTC (permalink / raw)
  To: Linux NFS Mailing list

Due to the lack of RDMA netid support and no IANA protocol
number defined just make sure the correct address
family is used on RDMA mounts.

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 support/nfs/getport.c |   21 +++++++++++++++++++++
 utils/mount/stropts.c |    4 +++-
 2 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/support/nfs/getport.c b/support/nfs/getport.c
index c930539..8f788d2 100644
--- a/support/nfs/getport.c
+++ b/support/nfs/getport.c
@@ -216,6 +216,17 @@ nfs_get_proto(const char *netid, sa_family_t *family, unsigned long *protocol)
 	struct netconfig *nconf;
 	struct protoent *proto;
 
+	/*
+	 * Special Case for RDMA mounts. Since
+	 * there is no RDMA netid support, just
+	 * ensure the correct address family 
+	 * is used.
+	 */
+	if (strcasecmp(netid, "rdma") == 0) {
+		*family = AF_INET;
+		return 1;
+	}
+
 	nconf = getnetconfigent(netid);
 	if (nconf == NULL)
 		return 0;
@@ -242,6 +253,16 @@ nfs_get_proto(const char *netid, sa_family_t *family, unsigned long *protocol)
 {
 	struct protoent *proto;
 
+	/*
+	 * Special Case for RDMA mounts. Since
+	 * there is not a protocol number define 
+	 * for  RDMA, just ensure the correct 
+	 * address family is used.
+	 */
+	if (strcasecmp(netid, "rdma") == 0) {
+		*family = AF_INET;
+		return 1;
+	}
 	proto = getprotobyname(netid);
 	if (proto == NULL)
 		return 0;
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index eb6ecc5..3f53ade 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -359,7 +359,9 @@ static int nfs_validate_options(struct nfsmount_info *mi)
 	if (!nfs_parse_devname(mi->spec, &mi->hostname, NULL))
 		return 0;
 
-	if (!nfs_nfs_proto_family(mi->options, &family))
+	if (nfs_rdma_option(mi->options))
+		family = AF_INET;
+	else if (!nfs_nfs_proto_family(mi->options, &family))
 		return 0;
 
 	hint.ai_family = (int)family;
-- 
1.7.2.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] Document the rdma mount option in the nfs man page
  2010-09-07 20:21 [PATCH 0/3] mount: Updated RDMA processing in the mount command Steve Dickson
  2010-09-07 20:21 ` [PATCH 1/3] Added support for the the -o rdma option Steve Dickson
  2010-09-07 20:22 ` [PATCH 2/3] Ensure the corrrect address family is used on RDMA mounts Steve Dickson
@ 2010-09-07 20:22 ` Steve Dickson
  2 siblings, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2010-09-07 20:22 UTC (permalink / raw)
  To: Linux NFS Mailing list

Co-Authored-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
---
 utils/mount/nfs.man |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/utils/mount/nfs.man b/utils/mount/nfs.man
index 3806635..8964512 100644
--- a/utils/mount/nfs.man
+++ b/utils/mount/nfs.man
@@ -495,9 +495,15 @@ command,
 .I netid
 is a valid netid listed in
 .IR /etc/netconfig .
-Otherwise,
+The value "rdma" may also be specified.
+If the
+.B mount.nfs
+command does not have TI-RPC support, then
 .I netid
 is one of "tcp," "udp," or "rdma," and only IPv4 may be used.
+Also with "rdma" the version 3 NFS protocol will be used
+unless a different protocol is specified on the command
+line.
 .IP
 Each transport protocol uses different default
 .B retrans
@@ -537,6 +543,12 @@ option is an alternative to specifying
 .BR proto=tcp.
 It is included for compatibility with other operating systems.
 .TP 1.5i
+.B rdma
+The
+.B rdma
+option is an alternative to specifying
+.BR proto=rdma.
+.TP 1.5i
 .BI port= n
 The numeric value of the server's NFS service port.
 If the server's NFS service is not available on the specified port,
-- 
1.7.2.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-09-07 20:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-07 20:21 [PATCH 0/3] mount: Updated RDMA processing in the mount command Steve Dickson
2010-09-07 20:21 ` [PATCH 1/3] Added support for the the -o rdma option Steve Dickson
2010-09-07 20:22 ` [PATCH 2/3] Ensure the corrrect address family is used on RDMA mounts Steve Dickson
2010-09-07 20:22 ` [PATCH 3/3] Document the rdma mount option in the nfs man page Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox