aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2015-06-04 11:21:42 -0400
committerJ. Bruce Fields <bfields@redhat.com>2015-06-04 16:56:02 -0400
commitffe1f0df586237a18f9b568597bddabb56e96d5e (patch)
treec0a56204cdd1f9f9bcde3f0d641bbcaf5414c15f
parent0380a3f37540ad0582b3c749a74fc127af914689 (diff)
rpcrdma: Merge svcrdma and xprtrdma modules into one
Bi-directional RPC support means code in svcrdma.ko invokes a bit of code in xprtrdma.ko, and vice versa. To avoid loader/linker loops, merge the server and client side modules together into a single module. When backchannel capabilities are added, the combined module will register all needed transport capabilities so that Upper Layer consumers automatically have everything needed to create a bi-directional transport connection. Module aliases are added for backwards compatibility with user space, which still may expect svcrdma.ko or xprtrdma.ko to be present. This commit reverts commit 2e8c12e1b765 ("xprtrdma: add separate Kconfig options for NFSoRDMA client and server support") and provides a single CONFIG option for enabling the new module. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--net/sunrpc/Kconfig28
-rw-r--r--net/sunrpc/Makefile3
-rw-r--r--net/sunrpc/xprtrdma/Makefile14
-rw-r--r--net/sunrpc/xprtrdma/module.c46
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma.c8
-rw-r--r--net/sunrpc/xprtrdma/transport.c13
-rw-r--r--net/sunrpc/xprtrdma/xprt_rdma.h5
7 files changed, 69 insertions, 48 deletions
diff --git a/net/sunrpc/Kconfig b/net/sunrpc/Kconfig
index 9068e72aa73c..04ce2c0b660e 100644
--- a/net/sunrpc/Kconfig
+++ b/net/sunrpc/Kconfig
@@ -48,28 +48,16 @@ config SUNRPC_DEBUG
48 48
49 If unsure, say Y. 49 If unsure, say Y.
50 50
51config SUNRPC_XPRT_RDMA_CLIENT 51config SUNRPC_XPRT_RDMA
52 tristate "RPC over RDMA Client Support" 52 tristate "RPC-over-RDMA transport"
53 depends on SUNRPC && INFINIBAND && INFINIBAND_ADDR_TRANS 53 depends on SUNRPC && INFINIBAND && INFINIBAND_ADDR_TRANS
54 default SUNRPC && INFINIBAND 54 default SUNRPC && INFINIBAND
55 help 55 help
56 This option allows the NFS client to support an RDMA-enabled 56 This option allows the NFS client and server to use RDMA
57 transport. 57 transports (InfiniBand, iWARP, or RoCE).
58 58
59 To compile RPC client RDMA transport support as a module, 59 To compile this support as a module, choose M. The module
60 choose M here: the module will be called xprtrdma. 60 will be called rpcrdma.ko.
61 61
62 If unsure, say N. 62 If unsure, or you know there is no RDMA capability on your
63 63 hardware platform, say N.
64config SUNRPC_XPRT_RDMA_SERVER
65 tristate "RPC over RDMA Server Support"
66 depends on SUNRPC && INFINIBAND && INFINIBAND_ADDR_TRANS
67 default SUNRPC && INFINIBAND
68 help
69 This option allows the NFS server to support an RDMA-enabled
70 transport.
71
72 To compile RPC server RDMA transport support as a module,
73 choose M here: the module will be called svcrdma.
74
75 If unsure, say N.
diff --git a/net/sunrpc/Makefile b/net/sunrpc/Makefile
index 15e6f6c23c5d..936ad0a15371 100644
--- a/net/sunrpc/Makefile
+++ b/net/sunrpc/Makefile
@@ -5,8 +5,7 @@
5 5
6obj-$(CONFIG_SUNRPC) += sunrpc.o 6obj-$(CONFIG_SUNRPC) += sunrpc.o
7obj-$(CONFIG_SUNRPC_GSS) += auth_gss/ 7obj-$(CONFIG_SUNRPC_GSS) += auth_gss/
8 8obj-$(CONFIG_SUNRPC_XPRT_RDMA) += xprtrdma/
9obj-y += xprtrdma/
10 9
11sunrpc-y := clnt.o xprt.o socklib.o xprtsock.o sched.o \ 10sunrpc-y := clnt.o xprt.o socklib.o xprtsock.o sched.o \
12 auth.o auth_null.o auth_unix.o auth_generic.o \ 11 auth.o auth_null.o auth_unix.o auth_generic.o \
diff --git a/net/sunrpc/xprtrdma/Makefile b/net/sunrpc/xprtrdma/Makefile
index 579f72bbcf4b..48913de240bd 100644
--- a/net/sunrpc/xprtrdma/Makefile
+++ b/net/sunrpc/xprtrdma/Makefile
@@ -1,9 +1,7 @@
1obj-$(CONFIG_SUNRPC_XPRT_RDMA_CLIENT) += xprtrdma.o 1obj-$(CONFIG_SUNRPC_XPRT_RDMA) += rpcrdma.o
2 2
3xprtrdma-y := transport.o rpc_rdma.o verbs.o \ 3rpcrdma-y := transport.o rpc_rdma.o verbs.o \
4 fmr_ops.o frwr_ops.o physical_ops.o 4 fmr_ops.o frwr_ops.o physical_ops.o \
5 5 svc_rdma.o svc_rdma_transport.o \
6obj-$(CONFIG_SUNRPC_XPRT_RDMA_SERVER) += svcrdma.o 6 svc_rdma_marshal.o svc_rdma_sendto.o svc_rdma_recvfrom.o \
7 7 module.o
8svcrdma-y := svc_rdma.o svc_rdma_transport.o \
9 svc_rdma_marshal.o svc_rdma_sendto.o svc_rdma_recvfrom.o
diff --git a/net/sunrpc/xprtrdma/module.c b/net/sunrpc/xprtrdma/module.c
new file mode 100644
index 000000000000..560712bd9fa2
--- /dev/null
+++ b/net/sunrpc/xprtrdma/module.c
@@ -0,0 +1,46 @@
1/*
2 * Copyright (c) 2015 Oracle. All rights reserved.
3 */
4
5/* rpcrdma.ko module initialization
6 */
7
8#include <linux/module.h>
9#include <linux/init.h>
10#include <linux/sunrpc/svc_rdma.h>
11#include "xprt_rdma.h"
12
13#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
14# define RPCDBG_FACILITY RPCDBG_TRANS
15#endif
16
17MODULE_AUTHOR("Open Grid Computing and Network Appliance, Inc.");
18MODULE_DESCRIPTION("RPC/RDMA Transport");
19MODULE_LICENSE("Dual BSD/GPL");
20MODULE_ALIAS("svcrdma");
21MODULE_ALIAS("xprtrdma");
22
23static void __exit rpc_rdma_cleanup(void)
24{
25 xprt_rdma_cleanup();
26 svc_rdma_cleanup();
27}
28
29static int __init rpc_rdma_init(void)
30{
31 int rc;
32
33 rc = svc_rdma_init();
34 if (rc)
35 goto out;
36
37 rc = xprt_rdma_init();
38 if (rc)
39 svc_rdma_cleanup();
40
41out:
42 return rc;
43}
44
45module_init(rpc_rdma_init);
46module_exit(rpc_rdma_cleanup);
diff --git a/net/sunrpc/xprtrdma/svc_rdma.c b/net/sunrpc/xprtrdma/svc_rdma.c
index c1b6270262c2..2cd252f023a5 100644
--- a/net/sunrpc/xprtrdma/svc_rdma.c
+++ b/net/sunrpc/xprtrdma/svc_rdma.c
@@ -38,8 +38,7 @@
38 * 38 *
39 * Author: Tom Tucker <tom@opengridcomputing.com> 39 * Author: Tom Tucker <tom@opengridcomputing.com>
40 */ 40 */
41#include <linux/module.h> 41
42#include <linux/init.h>
43#include <linux/slab.h> 42#include <linux/slab.h>
44#include <linux/fs.h> 43#include <linux/fs.h>
45#include <linux/sysctl.h> 44#include <linux/sysctl.h>
@@ -295,8 +294,3 @@ int svc_rdma_init(void)
295 destroy_workqueue(svc_rdma_wq); 294 destroy_workqueue(svc_rdma_wq);
296 return -ENOMEM; 295 return -ENOMEM;
297} 296}
298MODULE_AUTHOR("Tom Tucker <tom@opengridcomputing.com>");
299MODULE_DESCRIPTION("SVC RDMA Transport");
300MODULE_LICENSE("Dual BSD/GPL");
301module_init(svc_rdma_init);
302module_exit(svc_rdma_cleanup);
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
index 54f23b1be986..436da2caec95 100644
--- a/net/sunrpc/xprtrdma/transport.c
+++ b/net/sunrpc/xprtrdma/transport.c
@@ -48,7 +48,6 @@
48 */ 48 */
49 49
50#include <linux/module.h> 50#include <linux/module.h>
51#include <linux/init.h>
52#include <linux/slab.h> 51#include <linux/slab.h>
53#include <linux/seq_file.h> 52#include <linux/seq_file.h>
54#include <linux/sunrpc/addr.h> 53#include <linux/sunrpc/addr.h>
@@ -59,11 +58,6 @@
59# define RPCDBG_FACILITY RPCDBG_TRANS 58# define RPCDBG_FACILITY RPCDBG_TRANS
60#endif 59#endif
61 60
62MODULE_LICENSE("Dual BSD/GPL");
63
64MODULE_DESCRIPTION("RPC/RDMA Transport for Linux kernel NFS");
65MODULE_AUTHOR("Network Appliance, Inc.");
66
67/* 61/*
68 * tunables 62 * tunables
69 */ 63 */
@@ -711,7 +705,7 @@ static struct xprt_class xprt_rdma = {
711 .setup = xprt_setup_rdma, 705 .setup = xprt_setup_rdma,
712}; 706};
713 707
714static void __exit xprt_rdma_cleanup(void) 708void xprt_rdma_cleanup(void)
715{ 709{
716 int rc; 710 int rc;
717 711
@@ -728,7 +722,7 @@ static void __exit xprt_rdma_cleanup(void)
728 __func__, rc); 722 __func__, rc);
729} 723}
730 724
731static int __init xprt_rdma_init(void) 725int xprt_rdma_init(void)
732{ 726{
733 int rc; 727 int rc;
734 728
@@ -753,6 +747,3 @@ static int __init xprt_rdma_init(void)
753#endif 747#endif
754 return 0; 748 return 0;
755} 749}
756
757module_init(xprt_rdma_init);
758module_exit(xprt_rdma_cleanup);
diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h
index e60907b0e1f1..58163b88738c 100644
--- a/net/sunrpc/xprtrdma/xprt_rdma.h
+++ b/net/sunrpc/xprtrdma/xprt_rdma.h
@@ -480,6 +480,11 @@ void rpcrdma_reply_handler(struct rpcrdma_rep *);
480 */ 480 */
481int rpcrdma_marshal_req(struct rpc_rqst *); 481int rpcrdma_marshal_req(struct rpc_rqst *);
482 482
483/* RPC/RDMA module init - xprtrdma/transport.c
484 */
485int xprt_rdma_init(void);
486void xprt_rdma_cleanup(void);
487
483/* Temporary NFS request map cache. Created in svc_rdma.c */ 488/* Temporary NFS request map cache. Created in svc_rdma.c */
484extern struct kmem_cache *svc_rdma_map_cachep; 489extern struct kmem_cache *svc_rdma_map_cachep;
485/* WR context cache. Created in svc_rdma.c */ 490/* WR context cache. Created in svc_rdma.c */