2015-03-31 02:34:21 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2015 Oracle. All rights reserved.
|
|
|
|
* Copyright (c) 2003-2007 Network Appliance, Inc. All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Lightweight memory registration using Fast Registration Work
|
|
|
|
* Requests (FRWR). Also referred to sometimes as FRMR mode.
|
|
|
|
*
|
|
|
|
* FRWR features ordered asynchronous registration and deregistration
|
|
|
|
* of arbitrarily sized memory regions. This is the fastest and safest
|
|
|
|
* but most complex memory registration mode.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "xprt_rdma.h"
|
|
|
|
|
|
|
|
#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
|
|
|
|
# define RPCDBG_FACILITY RPCDBG_TRANS
|
|
|
|
#endif
|
|
|
|
|
2015-03-31 02:34:30 +08:00
|
|
|
/* FRWR mode conveys a list of pages per chunk segment. The
|
|
|
|
* maximum length of that list is the FRWR page list depth.
|
|
|
|
*/
|
|
|
|
static size_t
|
|
|
|
frwr_op_maxpages(struct rpcrdma_xprt *r_xprt)
|
|
|
|
{
|
|
|
|
struct rpcrdma_ia *ia = &r_xprt->rx_ia;
|
|
|
|
|
|
|
|
return min_t(unsigned int, RPCRDMA_MAX_DATA_SEGS,
|
|
|
|
rpcrdma_max_segments(r_xprt) * ia->ri_max_frmr_depth);
|
|
|
|
}
|
|
|
|
|
2015-03-31 02:34:21 +08:00
|
|
|
const struct rpcrdma_memreg_ops rpcrdma_frwr_memreg_ops = {
|
2015-03-31 02:34:30 +08:00
|
|
|
.ro_maxpages = frwr_op_maxpages,
|
2015-03-31 02:34:21 +08:00
|
|
|
.ro_displayname = "frwr",
|
|
|
|
};
|