Skip to content

Commit

Permalink
rpcrdma: RDMA/CM private message data structure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chuck Lever authored and J. Bruce Fields committed Sep 23, 2016
1 parent 9995237 commit 5d48709
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions include/linux/sunrpc/rpc_rdma.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#define _LINUX_SUNRPC_RPC_RDMA_H

#include <linux/types.h>
#include <linux/bitops.h>

#define RPCRDMA_VERSION 1
#define rpcrdma_version cpu_to_be32(RPCRDMA_VERSION)
Expand Down Expand Up @@ -129,4 +130,38 @@ enum rpcrdma_proc {
#define rdma_done cpu_to_be32(RDMA_DONE)
#define rdma_error cpu_to_be32(RDMA_ERROR)

/*
* Private extension to RPC-over-RDMA Version One.
* Message passed during RDMA-CM connection set-up.
*
* Add new fields at the end, and don't permute existing
* fields.
*/
struct rpcrdma_connect_private {
__be32 cp_magic;
u8 cp_version;
u8 cp_flags;
u8 cp_send_size;
u8 cp_recv_size;
} __packed;

#define rpcrdma_cmp_magic __cpu_to_be32(0xf6ab0e18)

enum {
RPCRDMA_CMP_VERSION = 1,
RPCRDMA_CMP_F_SND_W_INV_OK = BIT(0),
};

static inline u8
rpcrdma_encode_buffer_size(unsigned int size)
{
return (size >> 10) - 1;
}

static inline unsigned int
rpcrdma_decode_buffer_size(u8 val)
{
return ((unsigned int)val + 1) << 10;
}

#endif /* _LINUX_SUNRPC_RPC_RDMA_H */

0 comments on commit 5d48709

Please sign in to comment.