drivers/infiniband/hw/mlx5/mlx5_ib.h
Source file repositories/reference/linux-study-clean/drivers/infiniband/hw/mlx5/mlx5_ib.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/hw/mlx5/mlx5_ib.h- Extension
.h- Size
- 50735 bytes
- Lines
- 1764
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/sched.hrdma/ib_verbs.hrdma/ib_umem.hrdma/ib_smi.hlinux/mlx5/driver.hlinux/mlx5/cq.hlinux/mlx5/fs.hlinux/mlx5/qp.hlinux/types.hlinux/mlx5/transobj.hrdma/ib_user_verbs.hrdma/mlx5-abi.hrdma/uverbs_ioctl.hrdma/mlx5_user_ioctl_cmds.hrdma/mlx5_user_ioctl_verbs.hsrq.hqp.hmacsec.h
Detected Declarations
struct mlx5_bfreg_infostruct mlx5_ib_ucontextstruct mlx5_ib_pdstruct mlx5_ib_anchorstruct mlx5_ib_flow_priostruct mlx5_ib_flow_handlerstruct mlx5_ib_flow_matcherstruct mlx5_ib_steering_anchorstruct mlx5_ib_ppstruct mlx5_ib_flow_dbstruct wr_liststruct mlx5_ib_wqstruct mlx5_ib_rwqstruct mlx5_ib_rwq_ind_tablestruct mlx5_ib_ubufferstruct mlx5_ib_qp_basestruct mlx5_ib_qp_transstruct mlx5_ib_rss_qpstruct mlx5_ib_rqstruct mlx5_ib_sqstruct mlx5_ib_raw_packet_qpstruct mlx5_bfstruct mlx5_ib_dctstruct mlx5_ib_gsi_qpstruct mlx5_ib_qpstruct mlx5_ib_cq_bufstruct mlx5_ib_cqstruct mlx5_ib_wcstruct mlx5_ib_srqstruct mlx5_ib_xrcdstruct mlx5_user_mmap_entrystruct mlx5_ib_mkeystruct mlx5_ib_mrstruct mlx5_ib_mwstruct mlx5_ib_umr_contextstruct umr_commonstruct mlx5_ib_port_resourcesstruct mlx5_data_direct_resourcesstruct mlx5_ib_resourcesstruct mlx5_ib_op_fcstruct mlx5_ib_countersstruct mlx5_ib_multiport_infostruct mlx5_ib_multiportstruct mlx5_rocestruct mlx5_ib_portstruct mlx5_ib_dbg_paramstruct mlx5_ib_dbg_cc_paramsstruct mlx5_ib_delay_drop
Annotated Snippet
struct mlx5_bfreg_info {
u32 *sys_pages;
int num_low_latency_bfregs;
unsigned int *count;
/*
* protect bfreg allocation data structs
*/
struct mutex lock;
u32 ver;
u8 lib_uar_4k : 1;
u8 lib_uar_dyn : 1;
u32 num_sys_pages;
u32 num_static_sys_pages;
u32 total_num_bfregs;
u32 num_dyn_bfregs;
};
struct mlx5_ib_ucontext {
struct ib_ucontext ibucontext;
struct list_head db_page_list;
/* protect doorbell record alloc/free
*/
struct mutex db_page_mutex;
struct mlx5_bfreg_info bfregi;
u8 cqe_version;
/* Transport Domain number */
u32 tdn;
u64 lib_caps;
u16 devx_uid;
/* For RoCE LAG TX affinity */
atomic_t tx_port_affinity;
};
static inline struct mlx5_ib_ucontext *to_mucontext(struct ib_ucontext *ibucontext)
{
return container_of(ibucontext, struct mlx5_ib_ucontext, ibucontext);
}
struct mlx5_ib_pd {
struct ib_pd ibpd;
u32 pdn;
u16 uid;
};
enum {
MLX5_IB_FLOW_ACTION_MODIFY_HEADER,
MLX5_IB_FLOW_ACTION_PACKET_REFORMAT,
MLX5_IB_FLOW_ACTION_DECAP,
};
#define MLX5_IB_FLOW_MCAST_PRIO (MLX5_BY_PASS_NUM_PRIOS - 1)
#define MLX5_IB_FLOW_LAST_PRIO (MLX5_BY_PASS_NUM_REGULAR_PRIOS - 1)
#if (MLX5_IB_FLOW_LAST_PRIO <= 0)
#error "Invalid number of bypass priorities"
#endif
#define MLX5_IB_FLOW_LEFTOVERS_PRIO (MLX5_IB_FLOW_MCAST_PRIO + 1)
#define MLX5_IB_NUM_FLOW_FT (MLX5_IB_FLOW_LEFTOVERS_PRIO + 1)
#define MLX5_IB_NUM_SNIFFER_FTS 2
#define MLX5_IB_NUM_EGRESS_FTS 1
#define MLX5_IB_NUM_FDB_FTS MLX5_BY_PASS_NUM_REGULAR_PRIOS
struct mlx5_ib_anchor {
struct mlx5_flow_table *ft;
struct mlx5_flow_group *fg_goto_table;
struct mlx5_flow_group *fg_drop;
struct mlx5_flow_handle *rule_goto_table;
struct mlx5_flow_handle *rule_drop;
unsigned int rule_goto_table_ref;
};
struct mlx5_ib_flow_prio {
struct mlx5_flow_table *flow_table;
struct mlx5_ib_anchor anchor;
unsigned int refcount;
};
struct mlx5_ib_flow_handler {
struct list_head list;
struct ib_flow ibflow;
struct mlx5_ib_flow_prio *prio;
struct mlx5_flow_handle *rule;
struct ib_counters *ibcounters;
struct mlx5_ib_dev *dev;
struct mlx5_ib_flow_matcher *flow_matcher;
};
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/sched.h`, `rdma/ib_verbs.h`, `rdma/ib_umem.h`, `rdma/ib_smi.h`, `linux/mlx5/driver.h`, `linux/mlx5/cq.h`, `linux/mlx5/fs.h`.
- Detected declarations: `struct mlx5_bfreg_info`, `struct mlx5_ib_ucontext`, `struct mlx5_ib_pd`, `struct mlx5_ib_anchor`, `struct mlx5_ib_flow_prio`, `struct mlx5_ib_flow_handler`, `struct mlx5_ib_flow_matcher`, `struct mlx5_ib_steering_anchor`, `struct mlx5_ib_pp`, `struct mlx5_ib_flow_db`.
- 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.