drivers/infiniband/sw/siw/siw.h

Source file repositories/reference/linux-study-clean/drivers/infiniband/sw/siw/siw.h

File Facts

System
Linux kernel
Corpus path
drivers/infiniband/sw/siw/siw.h
Extension
.h
Size
18956 bytes
Lines
731
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 siw_dev_cap {
	int max_qp;
	int max_qp_wr;
	int max_ord; /* max. outbound read queue depth */
	int max_ird; /* max. inbound read queue depth */
	int max_sge;
	int max_sge_rd;
	int max_cq;
	int max_cqe;
	int max_mr;
	int max_pd;
	int max_mw;
	int max_srq;
	int max_srq_wr;
	int max_srq_sge;
};

struct siw_pd {
	struct ib_pd base_pd;
};

struct siw_device {
	struct ib_device base_dev;
	struct siw_dev_cap attrs;

	u32 vendor_part_id;
	int numa_node;
	char raw_gid[ETH_ALEN];

	spinlock_t lock;

	struct xarray qp_xa;
	struct xarray mem_xa;

	struct list_head cep_list;
	struct list_head qp_list;

	/* active objects statistics to enforce limits */
	atomic_t num_qp;
	atomic_t num_cq;
	atomic_t num_pd;
	atomic_t num_mr;
	atomic_t num_srq;
	atomic_t num_ctx;
};

struct siw_ucontext {
	struct ib_ucontext base_ucontext;
	struct siw_device *sdev;
};

/*
 * The RDMA core does not define LOCAL_READ access, which is always
 * enabled implictely.
 */
#define IWARP_ACCESS_MASK					\
	(IB_ACCESS_LOCAL_WRITE | IB_ACCESS_REMOTE_WRITE	|	\
	 IB_ACCESS_REMOTE_READ)

/*
 * siw presentation of user memory registered as source
 * or target of RDMA operations.
 */

struct siw_page_chunk {
	struct page **plist;
};

struct siw_umem {
	struct ib_umem *base_mem;
	unsigned int num_pages;
	unsigned int num_chunks;
	u64 fp_addr; /* First page base address */
	struct siw_page_chunk page_chunk[] __counted_by(num_chunks);
};

struct siw_pble {
	dma_addr_t addr; /* Address of assigned buffer */
	unsigned int size; /* Size of this entry */
	unsigned long pbl_off; /* Total offset from start of PBL */
};

struct siw_pbl {
	unsigned int num_buf;
	unsigned int max_buf;
	struct siw_pble pbe[] __counted_by(max_buf);
};

/*
 * Generic memory representation for registered siw memory.

Annotation

Implementation Notes