aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2016-09-13 10:53:07 -0400
committerJ. Bruce Fields <bfields@redhat.com>2016-09-23 10:18:53 -0400
commit5d48709656584420f31b361c4b1a3ebf1d68b225 (patch)
tree8d3d829d61d1f7d18b3957c30a2abb0360f61add
parent9995237bba702281e0e8e677edd5bb225f4f6c30 (diff)
rpcrdma: RDMA/CM private message data structure
Introduce data structure used by both client and server to exchange implementation details during RDMA/CM connection establishment. This is an experimental out-of-band exchange between Linux RPC-over-RDMA Version One implementations, replacing the deprecated CCP (see RFC 5666bis). The purpose of this extension is to enable prototyping of features that might be introduced in a subsequent version of RPC-over-RDMA. Suggested by Christoph Hellwig and Devesh Sharma. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--include/linux/sunrpc/rpc_rdma.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/linux/sunrpc/rpc_rdma.h b/include/linux/sunrpc/rpc_rdma.h
index 3b1ff38f0c37..a7da6bf56610 100644
--- a/include/linux/sunrpc/rpc_rdma.h
+++ b/include/linux/sunrpc/rpc_rdma.h
@@ -41,6 +41,7 @@
41#define _LINUX_SUNRPC_RPC_RDMA_H 41#define _LINUX_SUNRPC_RPC_RDMA_H
42 42
43#include <linux/types.h> 43#include <linux/types.h>
44#include <linux/bitops.h>
44 45
45#define RPCRDMA_VERSION 1 46#define RPCRDMA_VERSION 1
46#define rpcrdma_version cpu_to_be32(RPCRDMA_VERSION) 47#define rpcrdma_version cpu_to_be32(RPCRDMA_VERSION)
@@ -129,4 +130,38 @@ enum rpcrdma_proc {
129#define rdma_done cpu_to_be32(RDMA_DONE) 130#define rdma_done cpu_to_be32(RDMA_DONE)
130#define rdma_error cpu_to_be32(RDMA_ERROR) 131#define rdma_error cpu_to_be32(RDMA_ERROR)
131 132
133/*
134 * Private extension to RPC-over-RDMA Version One.
135 * Message passed during RDMA-CM connection set-up.
136 *
137 * Add new fields at the end, and don't permute existing
138 * fields.
139 */
140struct rpcrdma_connect_private {
141 __be32 cp_magic;
142 u8 cp_version;
143 u8 cp_flags;
144 u8 cp_send_size;
145 u8 cp_recv_size;
146} __packed;
147
148#define rpcrdma_cmp_magic __cpu_to_be32(0xf6ab0e18)
149
150enum {
151 RPCRDMA_CMP_VERSION = 1,
152 RPCRDMA_CMP_F_SND_W_INV_OK = BIT(0),
153};
154
155static inline u8
156rpcrdma_encode_buffer_size(unsigned int size)
157{
158 return (size >> 10) - 1;
159}
160
161static inline unsigned int
162rpcrdma_decode_buffer_size(u8 val)
163{
164 return ((unsigned int)val + 1) << 10;
165}
166
132#endif /* _LINUX_SUNRPC_RPC_RDMA_H */ 167#endif /* _LINUX_SUNRPC_RPC_RDMA_H */