drivers/infiniband/ulp/rtrs/rtrs-srv.h

Source file repositories/reference/linux-study-clean/drivers/infiniband/ulp/rtrs/rtrs-srv.h

File Facts

System
Linux kernel
Corpus path
drivers/infiniband/ulp/rtrs/rtrs-srv.h
Extension
.h
Size
4055 bytes
Lines
158
Domain
Driver Families
Bucket
drivers/infiniband
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct rtrs_srv_stats_rdma_stats {
	struct {
		u64 cnt;
		u64 size_total;
	} dir[2];
};

struct rtrs_srv_stats {
	struct kobject					kobj_stats;
	struct rtrs_srv_stats_rdma_stats __percpu	*rdma_stats;
	struct rtrs_srv_path				*srv_path;
};

struct rtrs_srv_con {
	struct rtrs_con		c;
	struct list_head	rsp_wr_wait_list;
	spinlock_t		rsp_wr_wait_lock;
};

/* IO context in rtrs_srv, each io has one */
struct rtrs_srv_op {
	struct rtrs_srv_con		*con;
	u32				msg_id;
	u8				dir;
	struct rtrs_msg_rdma_read	*rd_msg;
	struct ib_rdma_wr		tx_wr;
	struct ib_sge			tx_sg;
	struct list_head		wait_list;
	int				status;
};

/*
 * server side memory region context, when always_invalidate=Y, we need
 * queue_depth of memory region to invalidate each memory region.
 */
struct rtrs_srv_mr {
	struct ib_mr	*mr;
	struct sg_table	sgt;
	struct ib_cqe	inv_cqe;	/* only for always_invalidate=true */
	u32		msg_id;		/* only for always_invalidate=true */
	u32		msg_off;	/* only for always_invalidate=true */
	struct rtrs_iu	*iu;		/* send buffer for new rkey msg */
};

struct rtrs_srv_path {
	struct rtrs_path	s;
	struct rtrs_srv_sess	*srv;
	struct work_struct	close_work;
	enum rtrs_srv_state	state;
	spinlock_t		state_lock;
	int			cur_cq_vector;
	struct rtrs_srv_op	**ops_ids;
	struct percpu_ref       ids_inflight_ref;
	struct completion       complete_done;
	struct rtrs_srv_mr	*mrs;
	unsigned int		mrs_num;
	dma_addr_t		*dma_addr;
	bool			established;
	unsigned int		mem_bits;
	struct kobject		kobj;
	struct rtrs_srv_stats	*stats;
	unsigned long		connection_timeout;
};

static inline struct rtrs_srv_path *to_srv_path(struct rtrs_path *s)
{
	return container_of(s, struct rtrs_srv_path, s);
}

struct rtrs_srv_sess {
	struct list_head	paths_list;
	int			paths_up;
	struct mutex		paths_ev_mutex;
	size_t			paths_num;
	struct mutex		paths_mutex;
	uuid_t			paths_uuid;
	refcount_t		refcount;
	struct rtrs_srv_ctx	*ctx;
	struct list_head	ctx_list;
	void			*priv;
	size_t			queue_depth;
	struct page		**chunks;
	struct device		dev;
	unsigned int		dev_ref;
	struct kobject		*kobj_paths;
};

struct rtrs_srv_ctx {
	struct rtrs_srv_ops ops;
	struct rdma_cm_id *cm_id_ip;

Annotation

Implementation Notes