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.
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
rdma/ib_verbs.hrdma/restrack.hlinux/socket.hlinux/skbuff.hlinux/crc32.hlinux/crc32c.hlinux/unaligned.hrdma/siw-abi.hiwarp.h
Detected Declarations
struct siw_dev_capstruct siw_pdstruct siw_devicestruct siw_ucontextstruct siw_page_chunkstruct siw_umemstruct siw_pblestruct siw_pblstruct siw_memstruct siw_mrstruct siw_wqestruct siw_cqstruct siw_srqstruct siw_qp_attrsstruct siw_rx_streamstruct siw_rx_fpdustruct siw_send_pktstruct siw_write_pktstruct siw_rreq_pktstruct siw_rresp_pktstruct siw_iwarp_txstruct siw_qpstruct iwarp_msg_infostruct siw_user_mmap_entryenum siw_access_stateenum siw_wr_stateenum siw_qp_stateenum siw_qp_flagsenum siw_qp_attr_maskenum siw_tx_ctxenum siw_rx_statefunction set_rx_fpdu_contextfunction to_siw_mmap_entryfunction qp_idfunction siw_qp_getfunction siw_qp_putfunction siw_sq_emptyfunction siw_orq_emptyfunction siw_crc_initfunction siw_crc_updatefunction siw_crc_finalfunction siw_crc_oneshotfunction siw_crc_skb
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
- Immediate include surface: `rdma/ib_verbs.h`, `rdma/restrack.h`, `linux/socket.h`, `linux/skbuff.h`, `linux/crc32.h`, `linux/crc32c.h`, `linux/unaligned.h`, `rdma/siw-abi.h`.
- Detected declarations: `struct siw_dev_cap`, `struct siw_pd`, `struct siw_device`, `struct siw_ucontext`, `struct siw_page_chunk`, `struct siw_umem`, `struct siw_pble`, `struct siw_pbl`, `struct siw_mem`, `struct siw_mr`.
- Atlas domain: Driver Families / drivers/infiniband.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.