Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ffe1f0df authored by Chuck Lever's avatar Chuck Lever Committed by J. Bruce Fields
Browse files

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 2e8c12e1 ("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: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 0380a3f3
Loading
Loading
Loading
Loading
+8 −20
Original line number Diff line number Diff line
@@ -48,28 +48,16 @@ config SUNRPC_DEBUG

	  If unsure, say Y.

config SUNRPC_XPRT_RDMA_CLIENT
	tristate "RPC over RDMA Client Support"
config SUNRPC_XPRT_RDMA
	tristate "RPC-over-RDMA transport"
	depends on SUNRPC && INFINIBAND && INFINIBAND_ADDR_TRANS
	default SUNRPC && INFINIBAND
	help
	  This option allows the NFS client to support an RDMA-enabled
	  transport.
	  This option allows the NFS client and server to use RDMA
	  transports (InfiniBand, iWARP, or RoCE).

	  To compile RPC client RDMA transport support as a module,
	  choose M here: the module will be called xprtrdma.
	  To compile this support as a module, choose M. The module
	  will be called rpcrdma.ko.

	  If unsure, say N.

config SUNRPC_XPRT_RDMA_SERVER
	tristate "RPC over RDMA Server Support"
	depends on SUNRPC && INFINIBAND && INFINIBAND_ADDR_TRANS
	default SUNRPC && INFINIBAND
	help
	  This option allows the NFS server to support an RDMA-enabled
	  transport.

	  To compile RPC server RDMA transport support as a module,
	  choose M here: the module will be called svcrdma.

	  If unsure, say N.
	  If unsure, or you know there is no RDMA capability on your
	  hardware platform, say N.
+1 −2
Original line number Diff line number Diff line
@@ -5,8 +5,7 @@

obj-$(CONFIG_SUNRPC) += sunrpc.o
obj-$(CONFIG_SUNRPC_GSS) += auth_gss/

obj-y += xprtrdma/
obj-$(CONFIG_SUNRPC_XPRT_RDMA) += xprtrdma/

sunrpc-y := clnt.o xprt.o socklib.o xprtsock.o sched.o \
	    auth.o auth_null.o auth_unix.o auth_generic.o \
+6 −8
Original line number Diff line number Diff line
obj-$(CONFIG_SUNRPC_XPRT_RDMA_CLIENT) += xprtrdma.o
obj-$(CONFIG_SUNRPC_XPRT_RDMA) += rpcrdma.o

xprtrdma-y := transport.o rpc_rdma.o verbs.o \
	fmr_ops.o frwr_ops.o physical_ops.o

obj-$(CONFIG_SUNRPC_XPRT_RDMA_SERVER) += svcrdma.o

svcrdma-y := svc_rdma.o svc_rdma_transport.o \
	svc_rdma_marshal.o svc_rdma_sendto.o svc_rdma_recvfrom.o
rpcrdma-y := transport.o rpc_rdma.o verbs.o \
	fmr_ops.o frwr_ops.o physical_ops.o \
	svc_rdma.o svc_rdma_transport.o \
	svc_rdma_marshal.o svc_rdma_sendto.o svc_rdma_recvfrom.o \
	module.o
+46 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2015 Oracle.  All rights reserved.
 */

/* rpcrdma.ko module initialization
 */

#include <linux/module.h>
#include <linux/init.h>
#include <linux/sunrpc/svc_rdma.h>
#include "xprt_rdma.h"

#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
# define RPCDBG_FACILITY	RPCDBG_TRANS
#endif

MODULE_AUTHOR("Open Grid Computing and Network Appliance, Inc.");
MODULE_DESCRIPTION("RPC/RDMA Transport");
MODULE_LICENSE("Dual BSD/GPL");
MODULE_ALIAS("svcrdma");
MODULE_ALIAS("xprtrdma");

static void __exit rpc_rdma_cleanup(void)
{
	xprt_rdma_cleanup();
	svc_rdma_cleanup();
}

static int __init rpc_rdma_init(void)
{
	int rc;

	rc = svc_rdma_init();
	if (rc)
		goto out;

	rc = xprt_rdma_init();
	if (rc)
		svc_rdma_cleanup();

out:
	return rc;
}

module_init(rpc_rdma_init);
module_exit(rpc_rdma_cleanup);
+1 −7
Original line number Diff line number Diff line
@@ -38,8 +38,7 @@
 *
 * Author: Tom Tucker <tom@opengridcomputing.com>
 */
#include <linux/module.h>
#include <linux/init.h>

#include <linux/slab.h>
#include <linux/fs.h>
#include <linux/sysctl.h>
@@ -295,8 +294,3 @@ int svc_rdma_init(void)
	destroy_workqueue(svc_rdma_wq);
	return -ENOMEM;
}
MODULE_AUTHOR("Tom Tucker <tom@opengridcomputing.com>");
MODULE_DESCRIPTION("SVC RDMA Transport");
MODULE_LICENSE("Dual BSD/GPL");
module_init(svc_rdma_init);
module_exit(svc_rdma_cleanup);
Loading