-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xprtrdma: Add vector of ops for each memory registration strategy
Instead of employing switch() statements, let's use the typical Linux kernel idiom for handling behavioral variation: virtual functions. Start by defining a vector of operations for each supported memory registration mode, and by adding a source file for each mode. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Tested-by: Devesh Sharma <Devesh.Sharma@Emulex.Com> Tested-by: Meghana Cheripady <Meghana.Cheripady@Emulex.Com> Tested-by: Veeresh U. Kokatnur <veereshuk@chelsio.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
- Loading branch information
Chuck Lever
authored and
Anna Schumaker
committed
Mar 31, 2015
1 parent
41f9702
commit a0ce85f
Showing
6 changed files
with
89 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (c) 2015 Oracle. All rights reserved. | ||
* Copyright (c) 2003-2007 Network Appliance, Inc. All rights reserved. | ||
*/ | ||
|
||
/* Lightweight memory registration using Fast Memory Regions (FMR). | ||
* Referred to sometimes as MTHCAFMR mode. | ||
* | ||
* FMR uses synchronous memory registration and deregistration. | ||
* FMR registration is known to be fast, but FMR deregistration | ||
* can take tens of usecs to complete. | ||
*/ | ||
|
||
#include "xprt_rdma.h" | ||
|
||
#if IS_ENABLED(CONFIG_SUNRPC_DEBUG) | ||
# define RPCDBG_FACILITY RPCDBG_TRANS | ||
#endif | ||
|
||
const struct rpcrdma_memreg_ops rpcrdma_fmr_memreg_ops = { | ||
.ro_displayname = "fmr", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* 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 | ||
|
||
const struct rpcrdma_memreg_ops rpcrdma_frwr_memreg_ops = { | ||
.ro_displayname = "frwr", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright (c) 2015 Oracle. All rights reserved. | ||
* Copyright (c) 2003-2007 Network Appliance, Inc. All rights reserved. | ||
*/ | ||
|
||
/* No-op chunk preparation. All client memory is pre-registered. | ||
* Sometimes referred to as ALLPHYSICAL mode. | ||
* | ||
* Physical registration is simple because all client memory is | ||
* pre-registered and never deregistered. This mode is good for | ||
* adapter bring up, but is considered not safe: the server is | ||
* trusted not to abuse its access to client memory not involved | ||
* in RDMA I/O. | ||
*/ | ||
|
||
#include "xprt_rdma.h" | ||
|
||
#if IS_ENABLED(CONFIG_SUNRPC_DEBUG) | ||
# define RPCDBG_FACILITY RPCDBG_TRANS | ||
#endif | ||
|
||
const struct rpcrdma_memreg_ops rpcrdma_physical_memreg_ops = { | ||
.ro_displayname = "physical", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters