2019-05-29 00:57:16 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
2008-10-23 07:47:39 +08:00
|
|
|
/*
|
|
|
|
* linux/fs/9p/trans_rdma.c
|
|
|
|
*
|
|
|
|
* RDMA transport layer based on the trans_fd.c implementation.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2008 by Tom Tucker <tom@opengridcomputing.com>
|
|
|
|
* Copyright (C) 2006 by Russ Cox <rsc@swtch.com>
|
|
|
|
* Copyright (C) 2004-2005 by Latchesar Ionkov <lucho@ionkov.net>
|
|
|
|
* Copyright (C) 2004-2008 by Eric Van Hensbergen <ericvh@gmail.com>
|
|
|
|
* Copyright (C) 1997-2002 by Ron Minnich <rminnich@sarnoff.com>
|
|
|
|
*/
|
|
|
|
|
2011-11-29 02:40:46 +08:00
|
|
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
|
|
|
|
2008-10-23 07:47:39 +08:00
|
|
|
#include <linux/in.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/net.h>
|
|
|
|
#include <linux/ipv6.h>
|
|
|
|
#include <linux/kthread.h>
|
|
|
|
#include <linux/errno.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/un.h>
|
|
|
|
#include <linux/uaccess.h>
|
|
|
|
#include <linux/inet.h>
|
|
|
|
#include <linux/idr.h>
|
|
|
|
#include <linux/file.h>
|
|
|
|
#include <linux/parser.h>
|
|
|
|
#include <linux/semaphore.h>
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 16:04:11 +08:00
|
|
|
#include <linux/slab.h>
|
2017-07-05 23:25:37 +08:00
|
|
|
#include <linux/seq_file.h>
|
2008-10-23 07:47:39 +08:00
|
|
|
#include <net/9p/9p.h>
|
|
|
|
#include <net/9p/client.h>
|
|
|
|
#include <net/9p/transport.h>
|
|
|
|
#include <rdma/ib_verbs.h>
|
|
|
|
#include <rdma/rdma_cm.h>
|
|
|
|
|
|
|
|
#define P9_PORT 5640
|
|
|
|
#define P9_RDMA_SQ_DEPTH 32
|
|
|
|
#define P9_RDMA_RQ_DEPTH 32
|
|
|
|
#define P9_RDMA_SEND_SGE 4
|
|
|
|
#define P9_RDMA_RECV_SGE 4
|
|
|
|
#define P9_RDMA_IRD 0
|
|
|
|
#define P9_RDMA_ORD 0
|
|
|
|
#define P9_RDMA_TIMEOUT 30000 /* 30 seconds */
|
2013-06-21 21:32:37 +08:00
|
|
|
#define P9_RDMA_MAXSIZE (1024*1024) /* 1MB */
|
2008-10-23 07:47:39 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* struct p9_trans_rdma - RDMA transport instance
|
|
|
|
*
|
|
|
|
* @state: tracks the transport state machine for connection setup and tear down
|
|
|
|
* @cm_id: The RDMA CM ID
|
|
|
|
* @pd: Protection Domain pointer
|
|
|
|
* @qp: Queue Pair pointer
|
|
|
|
* @cq: Completion Queue pointer
|
|
|
|
* @timeout: Number of uSecs to wait for connection management events
|
2017-07-05 23:25:37 +08:00
|
|
|
* @privport: Whether a privileged port may be used
|
|
|
|
* @port: The port to use
|
2008-10-23 07:47:39 +08:00
|
|
|
* @sq_depth: The depth of the Send Queue
|
|
|
|
* @sq_sem: Semaphore for the SQ
|
|
|
|
* @rq_depth: The depth of the Receive Queue.
|
2013-06-21 21:32:39 +08:00
|
|
|
* @rq_sem: Semaphore for the RQ
|
2013-06-21 21:32:42 +08:00
|
|
|
* @excess_rc : Amount of posted Receive Contexts without a pending request.
|
|
|
|
* See rdma_request()
|
2008-10-23 07:47:39 +08:00
|
|
|
* @addr: The remote peer's address
|
|
|
|
* @req_lock: Protects the active request list
|
|
|
|
* @cm_done: Completion event for connection management tracking
|
|
|
|
*/
|
|
|
|
struct p9_trans_rdma {
|
|
|
|
enum {
|
|
|
|
P9_RDMA_INIT,
|
|
|
|
P9_RDMA_ADDR_RESOLVED,
|
|
|
|
P9_RDMA_ROUTE_RESOLVED,
|
|
|
|
P9_RDMA_CONNECTED,
|
|
|
|
P9_RDMA_FLUSHING,
|
|
|
|
P9_RDMA_CLOSING,
|
|
|
|
P9_RDMA_CLOSED,
|
|
|
|
} state;
|
|
|
|
struct rdma_cm_id *cm_id;
|
|
|
|
struct ib_pd *pd;
|
|
|
|
struct ib_qp *qp;
|
|
|
|
struct ib_cq *cq;
|
|
|
|
long timeout;
|
2017-07-05 23:25:37 +08:00
|
|
|
bool privport;
|
|
|
|
u16 port;
|
2008-10-23 07:47:39 +08:00
|
|
|
int sq_depth;
|
|
|
|
struct semaphore sq_sem;
|
|
|
|
int rq_depth;
|
2013-06-21 21:32:39 +08:00
|
|
|
struct semaphore rq_sem;
|
2013-06-21 21:32:42 +08:00
|
|
|
atomic_t excess_rc;
|
2008-10-23 07:47:39 +08:00
|
|
|
struct sockaddr_in addr;
|
|
|
|
spinlock_t req_lock;
|
|
|
|
|
|
|
|
struct completion cm_done;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* p9_rdma_context - Keeps track of in-process WR
|
|
|
|
*
|
|
|
|
* @busa: Bus address to unmap when the WR completes
|
|
|
|
* @req: Keeps track of requests (send)
|
|
|
|
* @rc: Keepts track of replies (receive)
|
|
|
|
*/
|
|
|
|
struct p9_rdma_req;
|
|
|
|
struct p9_rdma_context {
|
2016-03-03 16:36:06 +08:00
|
|
|
struct ib_cqe cqe;
|
2008-10-23 07:47:39 +08:00
|
|
|
dma_addr_t busa;
|
|
|
|
union {
|
|
|
|
struct p9_req_t *req;
|
2018-07-30 13:55:19 +08:00
|
|
|
struct p9_fcall rc;
|
2008-10-23 07:47:39 +08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* p9_rdma_opts - Collection of mount options
|
|
|
|
* @port: port of connection
|
|
|
|
* @sq_depth: The requested depth of the SQ. This really doesn't need
|
|
|
|
* to be any deeper than the number of threads used in the client
|
|
|
|
* @rq_depth: The depth of the RQ. Should be greater than or equal to SQ depth
|
|
|
|
* @timeout: Time to wait in msecs for CM events
|
|
|
|
*/
|
|
|
|
struct p9_rdma_opts {
|
|
|
|
short port;
|
2017-07-05 23:25:37 +08:00
|
|
|
bool privport;
|
2008-10-23 07:47:39 +08:00
|
|
|
int sq_depth;
|
|
|
|
int rq_depth;
|
|
|
|
long timeout;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Option Parsing (code inspired by NFS code)
|
|
|
|
*/
|
|
|
|
enum {
|
|
|
|
/* Options that take integer arguments */
|
2015-01-09 20:07:00 +08:00
|
|
|
Opt_port, Opt_rq_depth, Opt_sq_depth, Opt_timeout,
|
|
|
|
/* Options that take no argument */
|
|
|
|
Opt_privport,
|
|
|
|
Opt_err,
|
2008-10-23 07:47:39 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static match_table_t tokens = {
|
|
|
|
{Opt_port, "port=%u"},
|
|
|
|
{Opt_sq_depth, "sq=%u"},
|
|
|
|
{Opt_rq_depth, "rq=%u"},
|
|
|
|
{Opt_timeout, "timeout=%u"},
|
2015-01-09 20:07:00 +08:00
|
|
|
{Opt_privport, "privport"},
|
2008-10-23 07:47:39 +08:00
|
|
|
{Opt_err, NULL},
|
|
|
|
};
|
|
|
|
|
2017-07-05 23:25:37 +08:00
|
|
|
static int p9_rdma_show_options(struct seq_file *m, struct p9_client *clnt)
|
|
|
|
{
|
|
|
|
struct p9_trans_rdma *rdma = clnt->trans;
|
|
|
|
|
|
|
|
if (rdma->port != P9_PORT)
|
|
|
|
seq_printf(m, ",port=%u", rdma->port);
|
|
|
|
if (rdma->sq_depth != P9_RDMA_SQ_DEPTH)
|
|
|
|
seq_printf(m, ",sq=%u", rdma->sq_depth);
|
|
|
|
if (rdma->rq_depth != P9_RDMA_RQ_DEPTH)
|
|
|
|
seq_printf(m, ",rq=%u", rdma->rq_depth);
|
|
|
|
if (rdma->timeout != P9_RDMA_TIMEOUT)
|
|
|
|
seq_printf(m, ",timeout=%lu", rdma->timeout);
|
|
|
|
if (rdma->privport)
|
|
|
|
seq_puts(m, ",privport");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-10-23 07:47:39 +08:00
|
|
|
/**
|
2009-07-20 03:41:55 +08:00
|
|
|
* parse_opts - parse mount options into rdma options structure
|
|
|
|
* @params: options string passed from mount
|
|
|
|
* @opts: rdma transport-specific structure to parse options into
|
2008-10-23 07:47:39 +08:00
|
|
|
*
|
|
|
|
* Returns 0 upon success, -ERRNO upon failure
|
|
|
|
*/
|
|
|
|
static int parse_opts(char *params, struct p9_rdma_opts *opts)
|
|
|
|
{
|
|
|
|
char *p;
|
|
|
|
substring_t args[MAX_OPT_ARGS];
|
|
|
|
int option;
|
2010-02-09 06:23:23 +08:00
|
|
|
char *options, *tmp_options;
|
2008-10-23 07:47:39 +08:00
|
|
|
|
|
|
|
opts->port = P9_PORT;
|
|
|
|
opts->sq_depth = P9_RDMA_SQ_DEPTH;
|
|
|
|
opts->rq_depth = P9_RDMA_RQ_DEPTH;
|
|
|
|
opts->timeout = P9_RDMA_TIMEOUT;
|
2017-07-05 23:25:37 +08:00
|
|
|
opts->privport = false;
|
2008-10-23 07:47:39 +08:00
|
|
|
|
|
|
|
if (!params)
|
|
|
|
return 0;
|
|
|
|
|
2010-02-09 06:23:23 +08:00
|
|
|
tmp_options = kstrdup(params, GFP_KERNEL);
|
|
|
|
if (!tmp_options) {
|
2011-11-29 02:40:46 +08:00
|
|
|
p9_debug(P9_DEBUG_ERROR,
|
|
|
|
"failed to allocate copy of option string\n");
|
2008-10-23 07:47:39 +08:00
|
|
|
return -ENOMEM;
|
|
|
|
}
|
2010-02-09 06:23:23 +08:00
|
|
|
options = tmp_options;
|
2008-10-23 07:47:39 +08:00
|
|
|
|
|
|
|
while ((p = strsep(&options, ",")) != NULL) {
|
|
|
|
int token;
|
|
|
|
int r;
|
|
|
|
if (!*p)
|
|
|
|
continue;
|
|
|
|
token = match_token(p, tokens, args);
|
2015-01-09 20:07:00 +08:00
|
|
|
if ((token != Opt_err) && (token != Opt_privport)) {
|
|
|
|
r = match_int(&args[0], &option);
|
|
|
|
if (r < 0) {
|
|
|
|
p9_debug(P9_DEBUG_ERROR,
|
|
|
|
"integer field, but no integer?\n");
|
|
|
|
continue;
|
|
|
|
}
|
2008-10-23 07:47:39 +08:00
|
|
|
}
|
|
|
|
switch (token) {
|
|
|
|
case Opt_port:
|
|
|
|
opts->port = option;
|
|
|
|
break;
|
|
|
|
case Opt_sq_depth:
|
|
|
|
opts->sq_depth = option;
|
|
|
|
break;
|
|
|
|
case Opt_rq_depth:
|
|
|
|
opts->rq_depth = option;
|
|
|
|
break;
|
|
|
|
case Opt_timeout:
|
|
|
|
opts->timeout = option;
|
|
|
|
break;
|
2015-01-09 20:07:00 +08:00
|
|
|
case Opt_privport:
|
2017-07-05 23:25:37 +08:00
|
|
|
opts->privport = true;
|
2015-01-09 20:07:00 +08:00
|
|
|
break;
|
2008-10-23 07:47:39 +08:00
|
|
|
default:
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* RQ must be at least as large as the SQ */
|
|
|
|
opts->rq_depth = max(opts->rq_depth, opts->sq_depth);
|
2010-02-09 06:23:23 +08:00
|
|
|
kfree(tmp_options);
|
2008-10-23 07:47:39 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
p9_cm_event_handler(struct rdma_cm_id *id, struct rdma_cm_event *event)
|
|
|
|
{
|
|
|
|
struct p9_client *c = id->context;
|
|
|
|
struct p9_trans_rdma *rdma = c->trans;
|
|
|
|
switch (event->event) {
|
|
|
|
case RDMA_CM_EVENT_ADDR_RESOLVED:
|
|
|
|
BUG_ON(rdma->state != P9_RDMA_INIT);
|
|
|
|
rdma->state = P9_RDMA_ADDR_RESOLVED;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RDMA_CM_EVENT_ROUTE_RESOLVED:
|
|
|
|
BUG_ON(rdma->state != P9_RDMA_ADDR_RESOLVED);
|
|
|
|
rdma->state = P9_RDMA_ROUTE_RESOLVED;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RDMA_CM_EVENT_ESTABLISHED:
|
|
|
|
BUG_ON(rdma->state != P9_RDMA_ROUTE_RESOLVED);
|
|
|
|
rdma->state = P9_RDMA_CONNECTED;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RDMA_CM_EVENT_DISCONNECTED:
|
|
|
|
if (rdma)
|
|
|
|
rdma->state = P9_RDMA_CLOSED;
|
2018-09-07 23:26:50 +08:00
|
|
|
c->status = Disconnected;
|
2008-10-23 07:47:39 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RDMA_CM_EVENT_TIMEWAIT_EXIT:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RDMA_CM_EVENT_ADDR_CHANGE:
|
|
|
|
case RDMA_CM_EVENT_ROUTE_ERROR:
|
|
|
|
case RDMA_CM_EVENT_DEVICE_REMOVAL:
|
|
|
|
case RDMA_CM_EVENT_MULTICAST_JOIN:
|
|
|
|
case RDMA_CM_EVENT_MULTICAST_ERROR:
|
|
|
|
case RDMA_CM_EVENT_REJECTED:
|
|
|
|
case RDMA_CM_EVENT_CONNECT_REQUEST:
|
|
|
|
case RDMA_CM_EVENT_CONNECT_RESPONSE:
|
|
|
|
case RDMA_CM_EVENT_CONNECT_ERROR:
|
|
|
|
case RDMA_CM_EVENT_ADDR_ERROR:
|
|
|
|
case RDMA_CM_EVENT_UNREACHABLE:
|
|
|
|
c->status = Disconnected;
|
|
|
|
rdma_disconnect(rdma->cm_id);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
BUG();
|
|
|
|
}
|
|
|
|
complete(&rdma->cm_done);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2016-03-03 16:36:06 +08:00
|
|
|
recv_done(struct ib_cq *cq, struct ib_wc *wc)
|
2008-10-23 07:47:39 +08:00
|
|
|
{
|
2016-03-03 16:36:06 +08:00
|
|
|
struct p9_client *client = cq->cq_context;
|
|
|
|
struct p9_trans_rdma *rdma = client->trans;
|
|
|
|
struct p9_rdma_context *c =
|
|
|
|
container_of(wc->wr_cqe, struct p9_rdma_context, cqe);
|
2008-10-23 07:47:39 +08:00
|
|
|
struct p9_req_t *req;
|
|
|
|
int err = 0;
|
|
|
|
int16_t tag;
|
|
|
|
|
|
|
|
req = NULL;
|
|
|
|
ib_dma_unmap_single(rdma->cm_id->device, c->busa, client->msize,
|
|
|
|
DMA_FROM_DEVICE);
|
|
|
|
|
2016-03-03 16:36:06 +08:00
|
|
|
if (wc->status != IB_WC_SUCCESS)
|
2008-10-23 07:47:39 +08:00
|
|
|
goto err_out;
|
|
|
|
|
2018-07-30 13:55:19 +08:00
|
|
|
c->rc.size = wc->byte_len;
|
|
|
|
err = p9_parse_header(&c->rc, NULL, NULL, &tag, 1);
|
2008-10-23 07:47:39 +08:00
|
|
|
if (err)
|
|
|
|
goto err_out;
|
|
|
|
|
|
|
|
req = p9_tag_lookup(client, tag);
|
|
|
|
if (!req)
|
|
|
|
goto err_out;
|
|
|
|
|
2013-06-21 21:32:38 +08:00
|
|
|
/* Check that we have not yet received a reply for this request.
|
|
|
|
*/
|
2018-07-30 13:55:19 +08:00
|
|
|
if (unlikely(req->rc.sdata)) {
|
2013-06-21 21:32:38 +08:00
|
|
|
pr_err("Duplicate reply for request %d", tag);
|
|
|
|
goto err_out;
|
|
|
|
}
|
|
|
|
|
2018-07-30 13:55:19 +08:00
|
|
|
req->rc.size = c->rc.size;
|
|
|
|
req->rc.sdata = c->rc.sdata;
|
2014-01-18 01:31:00 +08:00
|
|
|
p9_client_cb(client, req, REQ_STATUS_RCVD);
|
2008-10-23 07:47:39 +08:00
|
|
|
|
2016-03-03 16:36:06 +08:00
|
|
|
out:
|
|
|
|
up(&rdma->rq_sem);
|
|
|
|
kfree(c);
|
2008-10-23 07:47:39 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
err_out:
|
2016-03-03 16:36:06 +08:00
|
|
|
p9_debug(P9_DEBUG_ERROR, "req %p err %d status %d\n",
|
|
|
|
req, err, wc->status);
|
2008-10-23 07:47:39 +08:00
|
|
|
rdma->state = P9_RDMA_FLUSHING;
|
|
|
|
client->status = Disconnected;
|
2016-03-03 16:36:06 +08:00
|
|
|
goto out;
|
2008-10-23 07:47:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2016-03-03 16:36:06 +08:00
|
|
|
send_done(struct ib_cq *cq, struct ib_wc *wc)
|
2008-10-23 07:47:39 +08:00
|
|
|
{
|
2016-03-03 16:36:06 +08:00
|
|
|
struct p9_client *client = cq->cq_context;
|
|
|
|
struct p9_trans_rdma *rdma = client->trans;
|
|
|
|
struct p9_rdma_context *c =
|
|
|
|
container_of(wc->wr_cqe, struct p9_rdma_context, cqe);
|
|
|
|
|
2008-10-23 07:47:39 +08:00
|
|
|
ib_dma_unmap_single(rdma->cm_id->device,
|
2018-07-30 13:55:19 +08:00
|
|
|
c->busa, c->req->tc.size,
|
2008-10-23 07:47:39 +08:00
|
|
|
DMA_TO_DEVICE);
|
2016-03-03 16:36:06 +08:00
|
|
|
up(&rdma->sq_sem);
|
2018-08-15 01:43:42 +08:00
|
|
|
p9_req_put(c->req);
|
2016-03-03 16:36:06 +08:00
|
|
|
kfree(c);
|
2008-10-23 07:47:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void qp_event_handler(struct ib_event *event, void *context)
|
|
|
|
{
|
2011-11-29 02:40:46 +08:00
|
|
|
p9_debug(P9_DEBUG_ERROR, "QP event %d context %p\n",
|
|
|
|
event->event, context);
|
2008-10-23 07:47:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rdma_destroy_trans(struct p9_trans_rdma *rdma)
|
|
|
|
{
|
|
|
|
if (!rdma)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (rdma->qp && !IS_ERR(rdma->qp))
|
|
|
|
ib_destroy_qp(rdma->qp);
|
|
|
|
|
|
|
|
if (rdma->pd && !IS_ERR(rdma->pd))
|
|
|
|
ib_dealloc_pd(rdma->pd);
|
|
|
|
|
|
|
|
if (rdma->cq && !IS_ERR(rdma->cq))
|
2016-03-03 16:36:06 +08:00
|
|
|
ib_free_cq(rdma->cq);
|
2008-10-23 07:47:39 +08:00
|
|
|
|
|
|
|
if (rdma->cm_id && !IS_ERR(rdma->cm_id))
|
|
|
|
rdma_destroy_id(rdma->cm_id);
|
|
|
|
|
|
|
|
kfree(rdma);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
post_recv(struct p9_client *client, struct p9_rdma_context *c)
|
|
|
|
{
|
|
|
|
struct p9_trans_rdma *rdma = client->trans;
|
2018-07-19 00:25:26 +08:00
|
|
|
struct ib_recv_wr wr;
|
2008-10-23 07:47:39 +08:00
|
|
|
struct ib_sge sge;
|
2024-06-12 13:13:20 +08:00
|
|
|
int ret;
|
2008-10-23 07:47:39 +08:00
|
|
|
|
|
|
|
c->busa = ib_dma_map_single(rdma->cm_id->device,
|
2018-07-30 13:55:19 +08:00
|
|
|
c->rc.sdata, client->msize,
|
2008-10-23 07:47:39 +08:00
|
|
|
DMA_FROM_DEVICE);
|
|
|
|
if (ib_dma_mapping_error(rdma->cm_id->device, c->busa))
|
|
|
|
goto error;
|
|
|
|
|
2016-03-03 16:36:06 +08:00
|
|
|
c->cqe.done = recv_done;
|
|
|
|
|
2008-10-23 07:47:39 +08:00
|
|
|
sge.addr = c->busa;
|
|
|
|
sge.length = client->msize;
|
2015-07-31 07:22:25 +08:00
|
|
|
sge.lkey = rdma->pd->local_dma_lkey;
|
2008-10-23 07:47:39 +08:00
|
|
|
|
|
|
|
wr.next = NULL;
|
2016-03-03 16:36:06 +08:00
|
|
|
wr.wr_cqe = &c->cqe;
|
2008-10-23 07:47:39 +08:00
|
|
|
wr.sg_list = &sge;
|
|
|
|
wr.num_sge = 1;
|
2024-06-12 13:13:20 +08:00
|
|
|
|
|
|
|
ret = ib_post_recv(rdma->qp, &wr, NULL);
|
|
|
|
if (ret)
|
|
|
|
ib_dma_unmap_single(rdma->cm_id->device, c->busa,
|
|
|
|
client->msize, DMA_FROM_DEVICE);
|
|
|
|
return ret;
|
2008-10-23 07:47:39 +08:00
|
|
|
|
|
|
|
error:
|
2011-11-29 02:40:46 +08:00
|
|
|
p9_debug(P9_DEBUG_ERROR, "EIO\n");
|
2008-10-23 07:47:39 +08:00
|
|
|
return -EIO;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rdma_request(struct p9_client *client, struct p9_req_t *req)
|
|
|
|
{
|
|
|
|
struct p9_trans_rdma *rdma = client->trans;
|
2018-07-19 00:25:26 +08:00
|
|
|
struct ib_send_wr wr;
|
2008-10-23 07:47:39 +08:00
|
|
|
struct ib_sge sge;
|
|
|
|
int err = 0;
|
|
|
|
unsigned long flags;
|
|
|
|
struct p9_rdma_context *c = NULL;
|
|
|
|
struct p9_rdma_context *rpl_context = NULL;
|
|
|
|
|
2013-06-21 21:32:42 +08:00
|
|
|
/* When an error occurs between posting the recv and the send,
|
|
|
|
* there will be a receive context posted without a pending request.
|
|
|
|
* Since there is no way to "un-post" it, we remember it and skip
|
|
|
|
* post_recv() for the next request.
|
|
|
|
* So here,
|
|
|
|
* see if we are this `next request' and need to absorb an excess rc.
|
|
|
|
* If yes, then drop and free our own, and do not recv_post().
|
|
|
|
**/
|
|
|
|
if (unlikely(atomic_read(&rdma->excess_rc) > 0)) {
|
|
|
|
if ((atomic_sub_return(1, &rdma->excess_rc) >= 0)) {
|
2018-07-30 13:55:19 +08:00
|
|
|
/* Got one! */
|
|
|
|
p9_fcall_fini(&req->rc);
|
|
|
|
req->rc.sdata = NULL;
|
2013-06-21 21:32:42 +08:00
|
|
|
goto dont_need_post_recv;
|
|
|
|
} else {
|
|
|
|
/* We raced and lost. */
|
|
|
|
atomic_inc(&rdma->excess_rc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-10-23 07:47:39 +08:00
|
|
|
/* Allocate an fcall for the reply */
|
2011-03-08 19:09:47 +08:00
|
|
|
rpl_context = kmalloc(sizeof *rpl_context, GFP_NOFS);
|
2010-09-13 23:53:18 +08:00
|
|
|
if (!rpl_context) {
|
|
|
|
err = -ENOMEM;
|
2013-06-21 21:32:41 +08:00
|
|
|
goto recv_error;
|
2010-09-13 23:53:18 +08:00
|
|
|
}
|
2018-07-30 13:55:19 +08:00
|
|
|
rpl_context->rc.sdata = req->rc.sdata;
|
2008-10-23 07:47:39 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Post a receive buffer for this request. We need to ensure
|
|
|
|
* there is a reply buffer available for every outstanding
|
|
|
|
* request. A flushed request can result in no reply for an
|
|
|
|
* outstanding request, so we must keep a count to avoid
|
|
|
|
* overflowing the RQ.
|
|
|
|
*/
|
2013-06-21 21:32:41 +08:00
|
|
|
if (down_interruptible(&rdma->rq_sem)) {
|
|
|
|
err = -EINTR;
|
|
|
|
goto recv_error;
|
|
|
|
}
|
2013-06-21 21:32:39 +08:00
|
|
|
|
|
|
|
err = post_recv(client, rpl_context);
|
|
|
|
if (err) {
|
2018-08-30 18:29:36 +08:00
|
|
|
p9_debug(P9_DEBUG_ERROR, "POST RECV failed: %d\n", err);
|
2013-06-21 21:32:41 +08:00
|
|
|
goto recv_error;
|
2013-06-21 21:32:39 +08:00
|
|
|
}
|
2008-10-23 07:47:39 +08:00
|
|
|
/* remove posted receive buffer from request structure */
|
2018-07-30 13:55:19 +08:00
|
|
|
req->rc.sdata = NULL;
|
2008-10-23 07:47:39 +08:00
|
|
|
|
2013-06-21 21:32:42 +08:00
|
|
|
dont_need_post_recv:
|
2008-10-23 07:47:39 +08:00
|
|
|
/* Post the request */
|
2011-03-08 19:09:47 +08:00
|
|
|
c = kmalloc(sizeof *c, GFP_NOFS);
|
2010-09-13 23:53:18 +08:00
|
|
|
if (!c) {
|
|
|
|
err = -ENOMEM;
|
2013-06-21 21:32:41 +08:00
|
|
|
goto send_error;
|
2010-09-13 23:53:18 +08:00
|
|
|
}
|
2008-10-23 07:47:39 +08:00
|
|
|
c->req = req;
|
|
|
|
|
|
|
|
c->busa = ib_dma_map_single(rdma->cm_id->device,
|
2018-07-30 13:55:19 +08:00
|
|
|
c->req->tc.sdata, c->req->tc.size,
|
2008-10-23 07:47:39 +08:00
|
|
|
DMA_TO_DEVICE);
|
2013-06-21 21:32:41 +08:00
|
|
|
if (ib_dma_mapping_error(rdma->cm_id->device, c->busa)) {
|
|
|
|
err = -EIO;
|
|
|
|
goto send_error;
|
|
|
|
}
|
2008-10-23 07:47:39 +08:00
|
|
|
|
2016-03-03 16:36:06 +08:00
|
|
|
c->cqe.done = send_done;
|
|
|
|
|
2008-10-23 07:47:39 +08:00
|
|
|
sge.addr = c->busa;
|
2018-07-30 13:55:19 +08:00
|
|
|
sge.length = c->req->tc.size;
|
2015-07-31 07:22:25 +08:00
|
|
|
sge.lkey = rdma->pd->local_dma_lkey;
|
2008-10-23 07:47:39 +08:00
|
|
|
|
|
|
|
wr.next = NULL;
|
2016-03-03 16:36:06 +08:00
|
|
|
wr.wr_cqe = &c->cqe;
|
2008-10-23 07:47:39 +08:00
|
|
|
wr.opcode = IB_WR_SEND;
|
|
|
|
wr.send_flags = IB_SEND_SIGNALED;
|
|
|
|
wr.sg_list = &sge;
|
|
|
|
wr.num_sge = 1;
|
|
|
|
|
2013-06-21 21:32:41 +08:00
|
|
|
if (down_interruptible(&rdma->sq_sem)) {
|
|
|
|
err = -EINTR;
|
2024-06-12 13:13:20 +08:00
|
|
|
goto dma_unmap;
|
2013-06-21 21:32:41 +08:00
|
|
|
}
|
|
|
|
|
2014-03-10 23:38:50 +08:00
|
|
|
/* Mark request as `sent' *before* we actually send it,
|
|
|
|
* because doing if after could erase the REQ_STATUS_RCVD
|
|
|
|
* status in case of a very fast reply.
|
|
|
|
*/
|
|
|
|
req->status = REQ_STATUS_SENT;
|
2018-07-19 00:25:26 +08:00
|
|
|
err = ib_post_send(rdma->qp, &wr, NULL);
|
2013-06-21 21:32:41 +08:00
|
|
|
if (err)
|
2024-06-12 13:13:20 +08:00
|
|
|
goto dma_unmap;
|
2008-10-23 07:47:39 +08:00
|
|
|
|
2013-06-21 21:32:41 +08:00
|
|
|
/* Success */
|
|
|
|
return 0;
|
2008-10-23 07:47:39 +08:00
|
|
|
|
2024-06-12 13:13:20 +08:00
|
|
|
dma_unmap:
|
|
|
|
ib_dma_unmap_single(rdma->cm_id->device, c->busa,
|
|
|
|
c->req->tc.size, DMA_TO_DEVICE);
|
2013-06-21 21:32:41 +08:00
|
|
|
/* Handle errors that happened during or while preparing the send: */
|
|
|
|
send_error:
|
2014-03-10 23:38:50 +08:00
|
|
|
req->status = REQ_STATUS_ERROR;
|
2010-09-13 23:53:18 +08:00
|
|
|
kfree(c);
|
2013-06-21 21:32:41 +08:00
|
|
|
p9_debug(P9_DEBUG_ERROR, "Error %d in rdma_request()\n", err);
|
2013-06-21 21:32:42 +08:00
|
|
|
|
|
|
|
/* Ach.
|
|
|
|
* We did recv_post(), but not send. We have one recv_post in excess.
|
|
|
|
*/
|
|
|
|
atomic_inc(&rdma->excess_rc);
|
2013-06-21 21:32:41 +08:00
|
|
|
return err;
|
|
|
|
|
|
|
|
/* Handle errors that happened during or while preparing post_recv(): */
|
|
|
|
recv_error:
|
2010-09-13 23:53:18 +08:00
|
|
|
kfree(rpl_context);
|
2008-10-23 07:47:39 +08:00
|
|
|
spin_lock_irqsave(&rdma->req_lock, flags);
|
2018-08-30 18:29:36 +08:00
|
|
|
if (err != -EINTR && rdma->state < P9_RDMA_CLOSING) {
|
2008-10-23 07:47:39 +08:00
|
|
|
rdma->state = P9_RDMA_CLOSING;
|
|
|
|
spin_unlock_irqrestore(&rdma->req_lock, flags);
|
|
|
|
rdma_disconnect(rdma->cm_id);
|
|
|
|
} else
|
|
|
|
spin_unlock_irqrestore(&rdma->req_lock, flags);
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rdma_close(struct p9_client *client)
|
|
|
|
{
|
|
|
|
struct p9_trans_rdma *rdma;
|
|
|
|
|
|
|
|
if (!client)
|
|
|
|
return;
|
|
|
|
|
|
|
|
rdma = client->trans;
|
|
|
|
if (!rdma)
|
|
|
|
return;
|
|
|
|
|
|
|
|
client->status = Disconnected;
|
|
|
|
rdma_disconnect(rdma->cm_id);
|
|
|
|
rdma_destroy_trans(rdma);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* alloc_rdma - Allocate and initialize the rdma transport structure
|
|
|
|
* @opts: Mount options structure
|
|
|
|
*/
|
|
|
|
static struct p9_trans_rdma *alloc_rdma(struct p9_rdma_opts *opts)
|
|
|
|
{
|
|
|
|
struct p9_trans_rdma *rdma;
|
|
|
|
|
|
|
|
rdma = kzalloc(sizeof(struct p9_trans_rdma), GFP_KERNEL);
|
|
|
|
if (!rdma)
|
|
|
|
return NULL;
|
|
|
|
|
2017-07-05 23:25:37 +08:00
|
|
|
rdma->port = opts->port;
|
|
|
|
rdma->privport = opts->privport;
|
2008-10-23 07:47:39 +08:00
|
|
|
rdma->sq_depth = opts->sq_depth;
|
|
|
|
rdma->rq_depth = opts->rq_depth;
|
|
|
|
rdma->timeout = opts->timeout;
|
|
|
|
spin_lock_init(&rdma->req_lock);
|
|
|
|
init_completion(&rdma->cm_done);
|
|
|
|
sema_init(&rdma->sq_sem, rdma->sq_depth);
|
2013-06-21 21:32:39 +08:00
|
|
|
sema_init(&rdma->rq_sem, rdma->rq_depth);
|
2013-06-21 21:32:42 +08:00
|
|
|
atomic_set(&rdma->excess_rc, 0);
|
2008-10-23 07:47:39 +08:00
|
|
|
|
|
|
|
return rdma;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rdma_cancel(struct p9_client *client, struct p9_req_t *req)
|
|
|
|
{
|
2014-03-10 23:38:51 +08:00
|
|
|
/* Nothing to do here.
|
|
|
|
* We will take care of it (if we have to) in rdma_cancelled()
|
|
|
|
*/
|
2008-10-23 07:47:39 +08:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2014-03-10 23:38:51 +08:00
|
|
|
/* A request has been fully flushed without a reply.
|
|
|
|
* That means we have posted one buffer in excess.
|
|
|
|
*/
|
|
|
|
static int rdma_cancelled(struct p9_client *client, struct p9_req_t *req)
|
|
|
|
{
|
|
|
|
struct p9_trans_rdma *rdma = client->trans;
|
|
|
|
atomic_inc(&rdma->excess_rc);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-01-09 20:07:00 +08:00
|
|
|
static int p9_rdma_bind_privport(struct p9_trans_rdma *rdma)
|
|
|
|
{
|
|
|
|
struct sockaddr_in cl = {
|
|
|
|
.sin_family = AF_INET,
|
|
|
|
.sin_addr.s_addr = htonl(INADDR_ANY),
|
|
|
|
};
|
|
|
|
int port, err = -EINVAL;
|
|
|
|
|
|
|
|
for (port = P9_DEF_MAX_RESVPORT; port >= P9_DEF_MIN_RESVPORT; port--) {
|
|
|
|
cl.sin_port = htons((ushort)port);
|
|
|
|
err = rdma_bind_addr(rdma->cm_id, (struct sockaddr *)&cl);
|
|
|
|
if (err != -EADDRINUSE)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
2008-10-23 07:47:39 +08:00
|
|
|
/**
|
2018-05-08 09:49:38 +08:00
|
|
|
* rdma_create_trans - Transport method for creating a transport instance
|
2008-10-23 07:47:39 +08:00
|
|
|
* @client: client instance
|
|
|
|
* @addr: IP address string
|
|
|
|
* @args: Mount options string
|
|
|
|
*/
|
|
|
|
static int
|
|
|
|
rdma_create_trans(struct p9_client *client, const char *addr, char *args)
|
|
|
|
{
|
|
|
|
int err;
|
|
|
|
struct p9_rdma_opts opts;
|
|
|
|
struct p9_trans_rdma *rdma;
|
|
|
|
struct rdma_conn_param conn_param;
|
|
|
|
struct ib_qp_init_attr qp_attr;
|
|
|
|
|
2018-07-27 19:05:58 +08:00
|
|
|
if (addr == NULL)
|
|
|
|
return -EINVAL;
|
|
|
|
|
2008-10-23 07:47:39 +08:00
|
|
|
/* Parse the transport specific mount options */
|
|
|
|
err = parse_opts(args, &opts);
|
|
|
|
if (err < 0)
|
|
|
|
return err;
|
|
|
|
|
|
|
|
/* Create and initialize the RDMA transport structure */
|
|
|
|
rdma = alloc_rdma(&opts);
|
|
|
|
if (!rdma)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
/* Create the RDMA CM ID */
|
2015-10-22 20:20:10 +08:00
|
|
|
rdma->cm_id = rdma_create_id(&init_net, p9_cm_event_handler, client,
|
|
|
|
RDMA_PS_TCP, IB_QPT_RC);
|
2008-10-23 07:47:39 +08:00
|
|
|
if (IS_ERR(rdma->cm_id))
|
|
|
|
goto error;
|
|
|
|
|
2008-10-24 05:30:13 +08:00
|
|
|
/* Associate the client with the transport */
|
|
|
|
client->trans = rdma;
|
|
|
|
|
2015-01-09 20:07:00 +08:00
|
|
|
/* Bind to a privileged port if we need to */
|
|
|
|
if (opts.privport) {
|
|
|
|
err = p9_rdma_bind_privport(rdma);
|
|
|
|
if (err < 0) {
|
|
|
|
pr_err("%s (%d): problem binding to privport: %d\n",
|
|
|
|
__func__, task_pid_nr(current), -err);
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-10-23 07:47:39 +08:00
|
|
|
/* Resolve the server's address */
|
|
|
|
rdma->addr.sin_family = AF_INET;
|
|
|
|
rdma->addr.sin_addr.s_addr = in_aton(addr);
|
|
|
|
rdma->addr.sin_port = htons(opts.port);
|
|
|
|
err = rdma_resolve_addr(rdma->cm_id, NULL,
|
|
|
|
(struct sockaddr *)&rdma->addr,
|
|
|
|
rdma->timeout);
|
|
|
|
if (err)
|
|
|
|
goto error;
|
|
|
|
err = wait_for_completion_interruptible(&rdma->cm_done);
|
|
|
|
if (err || (rdma->state != P9_RDMA_ADDR_RESOLVED))
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
/* Resolve the route to the server */
|
|
|
|
err = rdma_resolve_route(rdma->cm_id, rdma->timeout);
|
|
|
|
if (err)
|
|
|
|
goto error;
|
|
|
|
err = wait_for_completion_interruptible(&rdma->cm_done);
|
|
|
|
if (err || (rdma->state != P9_RDMA_ROUTE_RESOLVED))
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
/* Create the Completion Queue */
|
2019-07-30 01:22:09 +08:00
|
|
|
rdma->cq = ib_alloc_cq_any(rdma->cm_id->device, client,
|
|
|
|
opts.sq_depth + opts.rq_depth + 1,
|
|
|
|
IB_POLL_SOFTIRQ);
|
2008-10-23 07:47:39 +08:00
|
|
|
if (IS_ERR(rdma->cq))
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
/* Create the Protection Domain */
|
2016-09-05 18:56:17 +08:00
|
|
|
rdma->pd = ib_alloc_pd(rdma->cm_id->device, 0);
|
2008-10-23 07:47:39 +08:00
|
|
|
if (IS_ERR(rdma->pd))
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
/* Create the Queue Pair */
|
|
|
|
memset(&qp_attr, 0, sizeof qp_attr);
|
|
|
|
qp_attr.event_handler = qp_event_handler;
|
|
|
|
qp_attr.qp_context = client;
|
|
|
|
qp_attr.cap.max_send_wr = opts.sq_depth;
|
|
|
|
qp_attr.cap.max_recv_wr = opts.rq_depth;
|
|
|
|
qp_attr.cap.max_send_sge = P9_RDMA_SEND_SGE;
|
|
|
|
qp_attr.cap.max_recv_sge = P9_RDMA_RECV_SGE;
|
|
|
|
qp_attr.sq_sig_type = IB_SIGNAL_REQ_WR;
|
|
|
|
qp_attr.qp_type = IB_QPT_RC;
|
|
|
|
qp_attr.send_cq = rdma->cq;
|
|
|
|
qp_attr.recv_cq = rdma->cq;
|
|
|
|
err = rdma_create_qp(rdma->cm_id, rdma->pd, &qp_attr);
|
|
|
|
if (err)
|
|
|
|
goto error;
|
|
|
|
rdma->qp = rdma->cm_id->qp;
|
|
|
|
|
|
|
|
/* Request a connection */
|
|
|
|
memset(&conn_param, 0, sizeof(conn_param));
|
|
|
|
conn_param.private_data = NULL;
|
|
|
|
conn_param.private_data_len = 0;
|
|
|
|
conn_param.responder_resources = P9_RDMA_IRD;
|
|
|
|
conn_param.initiator_depth = P9_RDMA_ORD;
|
|
|
|
err = rdma_connect(rdma->cm_id, &conn_param);
|
|
|
|
if (err)
|
|
|
|
goto error;
|
|
|
|
err = wait_for_completion_interruptible(&rdma->cm_done);
|
|
|
|
if (err || (rdma->state != P9_RDMA_CONNECTED))
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
client->status = Connected;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
error:
|
|
|
|
rdma_destroy_trans(rdma);
|
|
|
|
return -ENOTCONN;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct p9_trans_module p9_rdma_trans = {
|
|
|
|
.name = "rdma",
|
|
|
|
.maxsize = P9_RDMA_MAXSIZE,
|
|
|
|
.def = 0,
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.create = rdma_create_trans,
|
|
|
|
.close = rdma_close,
|
|
|
|
.request = rdma_request,
|
|
|
|
.cancel = rdma_cancel,
|
2014-03-10 23:38:51 +08:00
|
|
|
.cancelled = rdma_cancelled,
|
2017-07-05 23:25:37 +08:00
|
|
|
.show_options = p9_rdma_show_options,
|
2008-10-23 07:47:39 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* p9_trans_rdma_init - Register the 9P RDMA transport driver
|
|
|
|
*/
|
|
|
|
static int __init p9_trans_rdma_init(void)
|
|
|
|
{
|
|
|
|
v9fs_register_trans(&p9_rdma_trans);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void __exit p9_trans_rdma_exit(void)
|
|
|
|
{
|
|
|
|
v9fs_unregister_trans(&p9_rdma_trans);
|
|
|
|
}
|
|
|
|
|
|
|
|
module_init(p9_trans_rdma_init);
|
|
|
|
module_exit(p9_trans_rdma_exit);
|
|
|
|
|
|
|
|
MODULE_AUTHOR("Tom Tucker <tom@opengridcomputing.com>");
|
|
|
|
MODULE_DESCRIPTION("RDMA Transport for 9P");
|
|
|
|
MODULE_LICENSE("Dual BSD/GPL");
|