net/sunrpc/xprtrdma/xprt_rdma.h

Source file repositories/reference/linux-study-clean/net/sunrpc/xprtrdma/xprt_rdma.h

File Facts

System
Linux kernel
Corpus path
net/sunrpc/xprtrdma/xprt_rdma.h
Extension
.h
Size
19497 bytes
Lines
623
Domain
Networking Core
Bucket
Sockets, Protocols, Packet Path, And Network Policy
Inferred role
Networking Core: implementation source
Status
source implementation candidate

Why This File Exists

Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.

Dependency Surface

Detected Declarations

Annotated Snippet

struct rpcrdma_ep {
	struct kref		re_kref;
	struct rdma_cm_id 	*re_id;
	struct ib_pd		*re_pd;
	unsigned int		re_max_rdma_segs;
	unsigned int		re_max_fr_depth;
	struct rpcrdma_mr	*re_write_pad_mr;
	enum ib_mr_type		re_mrtype;
	struct completion	re_done;
	unsigned int		re_send_count;
	unsigned int		re_send_batch;
	unsigned int		re_max_inline_send;
	unsigned int		re_max_inline_recv;
	int			re_async_rc;
	int			re_connect_status;
	atomic_t		re_receiving;
	atomic_t		re_force_disconnect;
	struct ib_qp_init_attr	re_attr;
	wait_queue_head_t       re_connect_wait;
	struct rpc_xprt		*re_xprt;
	struct rpcrdma_connect_private
				re_cm_private;
	struct rdma_conn_param	re_remote_cma;
	struct rpcrdma_notification	re_rn;
	int			re_receive_count;
	unsigned int		re_max_requests; /* depends on device */
	unsigned int		re_recv_batch;
	unsigned int		re_inline_send;	/* negotiated */
	unsigned int		re_inline_recv;	/* negotiated */

	atomic_t		re_completion_ids;

	char			re_write_pad[XDR_UNIT];
};

/* Pre-allocate extra Work Requests for handling reverse-direction
 * Receives and Sends. This is a fixed value because the Work Queues
 * are allocated when the forward channel is set up, long before the
 * backchannel is provisioned. This value is two times
 * NFS4_DEF_CB_SLOT_TABLE_SIZE.
 */
#if defined(CONFIG_SUNRPC_BACKCHANNEL)
#define RPCRDMA_BACKWARD_WRS (32)
#else
#define RPCRDMA_BACKWARD_WRS (0)
#endif

/* Registered buffer -- registered kmalloc'd memory for RDMA SEND/RECV
 */

struct rpcrdma_regbuf {
	struct ib_sge		rg_iov;
	struct ib_device	*rg_device;
	enum dma_data_direction	rg_direction;
	void			*rg_data;
};

static inline u64 rdmab_addr(struct rpcrdma_regbuf *rb)
{
	return rb->rg_iov.addr;
}

static inline u32 rdmab_length(struct rpcrdma_regbuf *rb)
{
	return rb->rg_iov.length;
}

static inline u32 rdmab_lkey(struct rpcrdma_regbuf *rb)
{
	return rb->rg_iov.lkey;
}

static inline struct ib_device *rdmab_device(struct rpcrdma_regbuf *rb)
{
	return rb->rg_device;
}

static inline void *rdmab_data(const struct rpcrdma_regbuf *rb)
{
	return rb->rg_data;
}

/* Do not use emergency memory reserves, and fail quickly if memory
 * cannot be allocated easily. These flags may be used wherever there
 * is robust logic to handle a failure to allocate.
 */
#define XPRTRDMA_GFP_FLAGS  (__GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN)

/* To ensure a transport can always make forward progress,
 * the number of RDMA segments allowed in header chunk lists

Annotation

Implementation Notes