mount: Updated RDMA processing in the mount command.
Subsystems (2)
cover mount: Updated RDMA processing in the mount command.
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(-)
Signature · 1 line
1.7.2.1
PATCH 1/3 Added support for the the -o rdma option
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 <[email protected]>
--- utils/mount/stropts.c | 29 ++++++++++++++++++++--------- 1 files changed, 20 insertions(+), 9 deletions(-)
utils/mount/stropts.c +20 -9
@@ -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;/*
Signature · 1 line
1.7.2.1
PATCH 2/3 Ensure the corrrect address family is used on RDMA mounts
In reply to Steve DicksonDue 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 <[email protected]>
--- support/nfs/getport.c | 21 +++++++++++++++++++++ utils/mount/stropts.c | 4 +++- 2 files changed, 24 insertions(+), 1 deletions(-)
support/nfs/getport.c +21 -0
@@ -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 ;
utils/mount/stropts.c +3 -1
@@ -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;
Signature · 1 line
1.7.2.1
PATCH 3/3 Document the rdma mount option in the nfs man page
In reply to Steve DicksonCo-Authored-by Chuck Lever <[email protected]>
Signed-off-by Steve Dickson <[email protected]>
--- utils/mount/nfs.man | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-)
utils/mount/nfs.man +13 -1
@@ -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,
Signature · 1 line
1.7.2.1