drivers/infiniband/core/mad_priv.h
Source file repositories/reference/linux-study-clean/drivers/infiniband/core/mad_priv.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/core/mad_priv.h- Extension
.h- Size
- 8092 bytes
- Lines
- 296
- 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/completion.hlinux/err.hlinux/workqueue.hrdma/ib_mad.hrdma/ib_smi.hrdma/opa_smi.h
Detected Declarations
struct ib_mad_list_headstruct ib_mad_private_headerstruct ib_mad_privatestruct ib_rmpp_segmentstruct ib_mad_agent_privatestruct ib_mad_snoop_privatestruct ib_mad_send_wr_privatestruct ib_mad_local_privatestruct ib_mad_mgmt_method_tablestruct ib_mad_mgmt_class_tablestruct ib_mad_mgmt_vendor_classstruct ib_mad_mgmt_vendor_class_tablestruct ib_mad_mgmt_version_tablestruct ib_mad_queuestruct ib_mad_qp_infostruct ib_mad_port_privateenum ib_mad_statefunction expect_mad_statefunction expect_mad_state2function expect_mad_state3function not_expect_mad_state
Annotated Snippet
struct ib_mad_list_head {
struct list_head list;
struct ib_cqe cqe;
struct ib_mad_queue *mad_queue;
};
struct ib_mad_private_header {
struct ib_mad_list_head mad_list;
struct ib_mad_recv_wc recv_wc;
struct ib_wc wc;
u64 mapping;
} __packed;
struct ib_mad_private {
struct ib_mad_private_header header;
size_t mad_size;
struct ib_grh grh;
u8 mad[];
} __packed;
struct ib_rmpp_segment {
struct list_head list;
u32 num;
u8 data[];
};
struct ib_mad_agent_private {
struct ib_mad_agent agent;
struct ib_mad_reg_req *reg_req;
struct ib_mad_qp_info *qp_info;
spinlock_t lock;
struct list_head send_list;
unsigned int sol_fc_send_count;
struct list_head wait_list;
unsigned int sol_fc_wait_count;
struct delayed_work timed_work;
unsigned long timeout;
struct list_head local_list;
struct work_struct local_work;
struct list_head rmpp_list;
unsigned int sol_fc_max;
struct list_head backlog_list;
refcount_t refcount;
union {
struct completion comp;
struct rcu_head rcu;
};
};
struct ib_mad_snoop_private {
struct ib_mad_agent agent;
struct ib_mad_qp_info *qp_info;
int snoop_index;
int mad_snoop_flags;
struct completion comp;
};
enum ib_mad_state {
/* MAD is in the making and is not yet in any list */
IB_MAD_STATE_INIT,
/* MAD is in backlog list */
IB_MAD_STATE_QUEUED,
/*
* MAD was sent to the QP and is waiting for completion
* notification in send list.
*/
IB_MAD_STATE_SEND_START,
/*
* MAD send completed successfully, waiting for a response
* in wait list.
*/
IB_MAD_STATE_WAIT_RESP,
/*
* Response came early, before send completion notification,
* in send list.
*/
IB_MAD_STATE_EARLY_RESP,
/* MAD was canceled while in wait or send list */
IB_MAD_STATE_CANCELED,
/* MAD processing completed, MAD in no list */
IB_MAD_STATE_DONE
};
struct ib_mad_send_wr_private {
struct ib_mad_list_head mad_list;
struct list_head agent_list;
struct ib_mad_agent_private *mad_agent_priv;
struct ib_mad_send_buf send_buf;
Annotation
- Immediate include surface: `linux/completion.h`, `linux/err.h`, `linux/workqueue.h`, `rdma/ib_mad.h`, `rdma/ib_smi.h`, `rdma/opa_smi.h`.
- Detected declarations: `struct ib_mad_list_head`, `struct ib_mad_private_header`, `struct ib_mad_private`, `struct ib_rmpp_segment`, `struct ib_mad_agent_private`, `struct ib_mad_snoop_private`, `struct ib_mad_send_wr_private`, `struct ib_mad_local_private`, `struct ib_mad_mgmt_method_table`, `struct ib_mad_mgmt_class_table`.
- 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.