drivers/infiniband/hw/mlx4/mlx4_ib.h
Source file repositories/reference/linux-study-clean/drivers/infiniband/hw/mlx4/mlx4_ib.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/hw/mlx4/mlx4_ib.h- Extension
.h- Size
- 27125 bytes
- Lines
- 968
- 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
linux/compiler.hlinux/list.hlinux/mutex.hlinux/idr.hlinux/notifier.hrdma/ib_verbs.hrdma/ib_umem.hrdma/ib_mad.hrdma/ib_sa.hlinux/mlx4/device.hlinux/mlx4/doorbell.hlinux/mlx4/qp.hlinux/mlx4/cq.h
Detected Declarations
struct mlx4_ib_ucontextstruct mlx4_ib_pdstruct mlx4_ib_xrcdstruct mlx4_ib_cq_bufstruct mlx4_ib_cq_resizestruct mlx4_ib_cqstruct mlx4_ib_mrstruct mlx4_ib_mwstruct mlx4_flow_reg_idstruct mlx4_ib_flowstruct mlx4_ib_wqstruct mlx4_ib_gid_entrystruct mlx4_ib_tunnel_headerstruct mlx4_ib_bufstruct mlx4_rcv_tunnel_hdrstruct mlx4_ib_proxy_sqp_hdrstruct mlx4_roce_smac_vlan_infostruct mlx4_wqn_rangestruct mlx4_ib_rssstruct mlx4_ib_sqpstruct mlx4_ib_qpstruct mlx4_ib_srqstruct mlx4_ib_ahstruct mlx4_ib_rwq_ind_tablestruct mlx4_sriov_alias_guid_info_rec_detstruct mlx4_sriov_alias_guid_port_rec_detstruct mlx4_sriov_alias_guidstruct mlx4_ib_demux_workstruct mlx4_ib_tun_tx_bufstruct mlx4_ib_demux_pv_qpstruct mlx4_ib_demux_pv_ctxstruct mlx4_ib_demux_ctxstruct mlx4_ib_sriovstruct gid_cache_contextstruct gid_entrystruct mlx4_port_gid_tablestruct mlx4_ib_iboestruct pkey_mgtstruct mlx4_ib_iov_sysfs_attrstruct mlx4_ib_iov_sysfs_attr_arstruct mlx4_ib_iov_portstruct counter_indexstruct mlx4_ib_countersstruct mlx4_ib_diag_countersstruct mlx4_ib_devstruct ib_event_workstruct mlx4_ib_qp_tunnel_init_attrstruct mlx4_uverbs_ex_query_device
Annotated Snippet
struct mlx4_ib_ucontext {
struct ib_ucontext ibucontext;
struct mlx4_uar uar;
struct list_head db_page_list;
struct mutex db_page_mutex;
struct list_head wqn_ranges_list;
struct mutex wqn_ranges_mutex; /* protect wqn_ranges_list */
};
struct mlx4_ib_pd {
struct ib_pd ibpd;
u32 pdn;
};
struct mlx4_ib_xrcd {
struct ib_xrcd ibxrcd;
u32 xrcdn;
struct ib_pd *pd;
struct ib_cq *cq;
};
struct mlx4_ib_cq_buf {
struct mlx4_buf buf;
struct mlx4_mtt mtt;
int entry_size;
};
struct mlx4_ib_cq_resize {
struct mlx4_ib_cq_buf buf;
int cqe;
};
struct mlx4_ib_cq {
struct ib_cq ibcq;
struct mlx4_cq mcq;
struct mlx4_ib_cq_buf buf;
struct mlx4_ib_cq_resize *resize_buf;
struct mlx4_db db;
spinlock_t lock;
struct mutex resize_mutex;
struct ib_umem *umem;
struct ib_umem *resize_umem;
/* List of qps that it serves.*/
struct list_head send_qp_list;
struct list_head recv_qp_list;
};
#define MLX4_MR_PAGES_ALIGN 0x40
struct mlx4_ib_mr {
struct ib_mr ibmr;
__be64 *pages;
dma_addr_t page_map;
u32 npages;
u32 max_pages;
int access_flags;
struct mlx4_mr mmr;
struct ib_umem *umem;
size_t page_map_size;
};
struct mlx4_ib_mw {
struct ib_mw ibmw;
struct mlx4_mw mmw;
};
#define MAX_REGS_PER_FLOW 2
struct mlx4_flow_reg_id {
u64 id;
u64 mirror;
};
struct mlx4_ib_flow {
struct ib_flow ibflow;
/* translating DMFS verbs sniffer rule to FW API requires two reg IDs */
struct mlx4_flow_reg_id reg_id[MAX_REGS_PER_FLOW];
};
struct mlx4_ib_wq {
u64 *wrid;
spinlock_t lock;
int wqe_cnt;
int max_post;
int max_gs;
int offset;
int wqe_shift;
unsigned head;
unsigned tail;
};
Annotation
- Immediate include surface: `linux/compiler.h`, `linux/list.h`, `linux/mutex.h`, `linux/idr.h`, `linux/notifier.h`, `rdma/ib_verbs.h`, `rdma/ib_umem.h`, `rdma/ib_mad.h`.
- Detected declarations: `struct mlx4_ib_ucontext`, `struct mlx4_ib_pd`, `struct mlx4_ib_xrcd`, `struct mlx4_ib_cq_buf`, `struct mlx4_ib_cq_resize`, `struct mlx4_ib_cq`, `struct mlx4_ib_mr`, `struct mlx4_ib_mw`, `struct mlx4_flow_reg_id`, `struct mlx4_ib_flow`.
- 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.