Skip to content

Commit ff06bd1

Browse files
chuckleveramschuma-ntap
authored andcommitted
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 <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 6ea8e71 commit ff06bd1

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

include/linux/sunrpc/rpc_rdma.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#define _LINUX_SUNRPC_RPC_RDMA_H
4242

4343
#include <linux/types.h>
44+
#include <linux/bitops.h>
4445

4546
#define RPCRDMA_VERSION 1
4647
#define rpcrdma_version cpu_to_be32(RPCRDMA_VERSION)
@@ -129,4 +130,38 @@ enum rpcrdma_proc {
129130
#define rdma_done cpu_to_be32(RDMA_DONE)
130131
#define rdma_error cpu_to_be32(RDMA_ERROR)
131132

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+
*/
140+
struct 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+
150+
enum {
151+
RPCRDMA_CMP_VERSION = 1,
152+
RPCRDMA_CMP_F_SND_W_INV_OK = BIT(0),
153+
};
154+
155+
static inline u8
156+
rpcrdma_encode_buffer_size(unsigned int size)
157+
{
158+
return (size >> 10) - 1;
159+
}
160+
161+
static inline unsigned int
162+
rpcrdma_decode_buffer_size(u8 val)
163+
{
164+
return ((unsigned int)val + 1) << 10;
165+
}
166+
132167
#endif /* _LINUX_SUNRPC_RPC_RDMA_H */

0 commit comments

Comments
 (0)