drivers/infiniband/hw/erdma/erdma_verbs.h
Source file repositories/reference/linux-study-clean/drivers/infiniband/hw/erdma/erdma_verbs.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/hw/erdma/erdma_verbs.h- Extension
.h- Size
- 11975 bytes
- Lines
- 492
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
erdma.h
Detected Declarations
struct erdma_user_mmap_entrystruct erdma_ext_db_infostruct erdma_ucontextstruct erdma_pdstruct erdma_mttstruct erdma_memstruct erdma_mrstruct erdma_user_dbrecords_pagestruct erdma_avstruct erdma_ahstruct erdma_uqpstruct erdma_kqpstruct erdma_mod_qp_params_iwarpstruct erdma_qp_attrs_iwarpstruct erdma_mod_qp_params_rocev2struct erdma_qp_attrs_rocev2struct erdma_qp_attrsstruct erdma_qpstruct erdma_kcq_infostruct erdma_ucq_infostruct erdma_cqenum erdma_qps_iwarpenum erdma_qpa_mask_iwarpenum erdma_qps_rocev2enum erdma_qpa_mask_rocev2enum erdma_qp_flagsfunction to_erdma_access_flagsfunction erdma_device_iwarpfunction erdma_device_rocev2function erdma_check_gid_attrfunction to_emmap
Annotated Snippet
struct erdma_user_mmap_entry {
struct rdma_user_mmap_entry rdma_entry;
u64 address;
u8 mmap_flag;
};
struct erdma_ext_db_info {
bool enable;
u16 sdb_off;
u16 rdb_off;
u16 cdb_off;
};
struct erdma_ucontext {
struct ib_ucontext ibucontext;
struct erdma_ext_db_info ext_db;
u64 sdb;
u64 rdb;
u64 cdb;
struct rdma_user_mmap_entry *sq_db_mmap_entry;
struct rdma_user_mmap_entry *rq_db_mmap_entry;
struct rdma_user_mmap_entry *cq_db_mmap_entry;
/* doorbell records */
struct list_head dbrecords_page_list;
struct mutex dbrecords_page_mutex;
};
struct erdma_pd {
struct ib_pd ibpd;
u32 pdn;
};
/*
* MemoryRegion definition.
*/
#define ERDMA_MAX_INLINE_MTT_ENTRIES 4
#define MTT_SIZE(mtt_cnt) ((mtt_cnt) << 3) /* per mtt entry takes 8 Bytes. */
#define ERDMA_MR_MAX_MTT_CNT 524288
#define ERDMA_MTT_ENTRY_SIZE 8
#define ERDMA_MR_TYPE_NORMAL 0
#define ERDMA_MR_TYPE_FRMR 1
#define ERDMA_MR_TYPE_DMA 2
#define ERDMA_MR_MTT_0LEVEL 0
#define ERDMA_MR_MTT_1LEVEL 1
#define ERDMA_MR_ACC_RA BIT(0)
#define ERDMA_MR_ACC_LR BIT(1)
#define ERDMA_MR_ACC_LW BIT(2)
#define ERDMA_MR_ACC_RR BIT(3)
#define ERDMA_MR_ACC_RW BIT(4)
static inline u8 to_erdma_access_flags(int access)
{
return (access & IB_ACCESS_REMOTE_READ ? ERDMA_MR_ACC_RR : 0) |
(access & IB_ACCESS_LOCAL_WRITE ? ERDMA_MR_ACC_LW : 0) |
(access & IB_ACCESS_REMOTE_WRITE ? ERDMA_MR_ACC_RW : 0) |
(access & IB_ACCESS_REMOTE_ATOMIC ? ERDMA_MR_ACC_RA : 0);
}
/* Hierarchical storage structure for MTT entries */
struct erdma_mtt {
u64 *buf;
size_t size;
bool continuous;
union {
dma_addr_t buf_dma;
struct {
dma_addr_t *dma_addrs;
u32 npages;
u32 level;
};
};
struct erdma_mtt *low_level;
};
struct erdma_mem {
struct ib_umem *umem;
struct erdma_mtt *mtt;
u32 page_size;
u32 page_offset;
u32 page_cnt;
Annotation
- Immediate include surface: `erdma.h`.
- Detected declarations: `struct erdma_user_mmap_entry`, `struct erdma_ext_db_info`, `struct erdma_ucontext`, `struct erdma_pd`, `struct erdma_mtt`, `struct erdma_mem`, `struct erdma_mr`, `struct erdma_user_dbrecords_page`, `struct erdma_av`, `struct erdma_ah`.
- Atlas domain: Driver Families / drivers/infiniband.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.