aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author\"Talpey, Thomas\ <Thomas.Talpey@netapp.com>2007-09-10 13:49:41 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-09 17:18:00 -0400
commit2cf7ff7a37cc149bd59c4f3bad432f686a4619c8 (patch)
tree9752290f4a0cb00d10a1fae24db8ef85b85b84e7
parentc3a57ed7471a17b07844d531534d970b84b69faf (diff)
NFS: support RDMA mounts
Adds hooks to the string-based NFS mount to support an "rdma" protocol option. Signed-off-by: Tom Talpey <tmt@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/client.c2
-rw-r--r--fs/nfs/super.c21
2 files changed, 21 insertions, 2 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 6f6755529788..a532ee12740a 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -24,6 +24,7 @@
24#include <linux/sunrpc/stats.h> 24#include <linux/sunrpc/stats.h>
25#include <linux/sunrpc/metrics.h> 25#include <linux/sunrpc/metrics.h>
26#include <linux/sunrpc/xprtsock.h> 26#include <linux/sunrpc/xprtsock.h>
27#include <linux/sunrpc/xprtrdma.h>
27#include <linux/nfs_fs.h> 28#include <linux/nfs_fs.h>
28#include <linux/nfs_mount.h> 29#include <linux/nfs_mount.h>
29#include <linux/nfs4_mount.h> 30#include <linux/nfs4_mount.h>
@@ -342,6 +343,7 @@ static void nfs_init_timeout_values(struct rpc_timeout *to, int proto,
342 343
343 switch (proto) { 344 switch (proto) {
344 case XPRT_TRANSPORT_TCP: 345 case XPRT_TRANSPORT_TCP:
346 case XPRT_TRANSPORT_RDMA:
345 if (!to->to_initval) 347 if (!to->to_initval)
346 to->to_initval = 60 * HZ; 348 to->to_initval = 60 * HZ;
347 if (to->to_initval > NFS_MAX_TCP_TIMEOUT) 349 if (to->to_initval > NFS_MAX_TCP_TIMEOUT)
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 347c36341e53..11ab7ff6e087 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -34,6 +34,7 @@
34#include <linux/sunrpc/stats.h> 34#include <linux/sunrpc/stats.h>
35#include <linux/sunrpc/metrics.h> 35#include <linux/sunrpc/metrics.h>
36#include <linux/sunrpc/xprtsock.h> 36#include <linux/sunrpc/xprtsock.h>
37#include <linux/sunrpc/xprtrdma.h>
37#include <linux/nfs_fs.h> 38#include <linux/nfs_fs.h>
38#include <linux/nfs_mount.h> 39#include <linux/nfs_mount.h>
39#include <linux/nfs4_mount.h> 40#include <linux/nfs4_mount.h>
@@ -68,7 +69,7 @@ enum {
68 Opt_ac, Opt_noac, 69 Opt_ac, Opt_noac,
69 Opt_lock, Opt_nolock, 70 Opt_lock, Opt_nolock,
70 Opt_v2, Opt_v3, 71 Opt_v2, Opt_v3,
71 Opt_udp, Opt_tcp, 72 Opt_udp, Opt_tcp, Opt_rdma,
72 Opt_acl, Opt_noacl, 73 Opt_acl, Opt_noacl,
73 Opt_rdirplus, Opt_nordirplus, 74 Opt_rdirplus, Opt_nordirplus,
74 Opt_sharecache, Opt_nosharecache, 75 Opt_sharecache, Opt_nosharecache,
@@ -114,6 +115,7 @@ static match_table_t nfs_mount_option_tokens = {
114 { Opt_v3, "v3" }, 115 { Opt_v3, "v3" },
115 { Opt_udp, "udp" }, 116 { Opt_udp, "udp" },
116 { Opt_tcp, "tcp" }, 117 { Opt_tcp, "tcp" },
118 { Opt_rdma, "rdma" },
117 { Opt_acl, "acl" }, 119 { Opt_acl, "acl" },
118 { Opt_noacl, "noacl" }, 120 { Opt_noacl, "noacl" },
119 { Opt_rdirplus, "rdirplus" }, 121 { Opt_rdirplus, "rdirplus" },
@@ -153,7 +155,7 @@ static match_table_t nfs_mount_option_tokens = {
153}; 155};
154 156
155enum { 157enum {
156 Opt_xprt_udp, Opt_xprt_tcp, 158 Opt_xprt_udp, Opt_xprt_tcp, Opt_xprt_rdma,
157 159
158 Opt_xprt_err 160 Opt_xprt_err
159}; 161};
@@ -161,6 +163,7 @@ enum {
161static match_table_t nfs_xprt_protocol_tokens = { 163static match_table_t nfs_xprt_protocol_tokens = {
162 { Opt_xprt_udp, "udp" }, 164 { Opt_xprt_udp, "udp" },
163 { Opt_xprt_tcp, "tcp" }, 165 { Opt_xprt_tcp, "tcp" },
166 { Opt_xprt_rdma, "rdma" },
164 167
165 { Opt_xprt_err, NULL } 168 { Opt_xprt_err, NULL }
166}; 169};
@@ -668,6 +671,12 @@ static int nfs_parse_mount_options(char *raw,
668 mnt->timeo = 600; 671 mnt->timeo = 600;
669 mnt->retrans = 2; 672 mnt->retrans = 2;
670 break; 673 break;
674 case Opt_rdma:
675 mnt->flags |= NFS_MOUNT_TCP; /* for side protocols */
676 mnt->nfs_server.protocol = XPRT_TRANSPORT_RDMA;
677 mnt->timeo = 600;
678 mnt->retrans = 2;
679 break;
671 case Opt_acl: 680 case Opt_acl:
672 mnt->flags &= ~NFS_MOUNT_NOACL; 681 mnt->flags &= ~NFS_MOUNT_NOACL;
673 break; 682 break;
@@ -883,6 +892,13 @@ static int nfs_parse_mount_options(char *raw,
883 mnt->timeo = 600; 892 mnt->timeo = 600;
884 mnt->retrans = 2; 893 mnt->retrans = 2;
885 break; 894 break;
895 case Opt_xprt_rdma:
896 /* vector side protocols to TCP */
897 mnt->flags |= NFS_MOUNT_TCP;
898 mnt->nfs_server.protocol = XPRT_TRANSPORT_RDMA;
899 mnt->timeo = 600;
900 mnt->retrans = 2;
901 break;
886 default: 902 default:
887 goto out_unrec_xprt; 903 goto out_unrec_xprt;
888 } 904 }
@@ -902,6 +918,7 @@ static int nfs_parse_mount_options(char *raw,
902 case Opt_xprt_tcp: 918 case Opt_xprt_tcp:
903 mnt->mount_server.protocol = XPRT_TRANSPORT_TCP; 919 mnt->mount_server.protocol = XPRT_TRANSPORT_TCP;
904 break; 920 break;
921 case Opt_xprt_rdma: /* not used for side protocols */
905 default: 922 default:
906 goto out_unrec_xprt; 923 goto out_unrec_xprt;
907 } 924 }