drivers/infiniband/ulp/srp/ib_srp.h
Source file repositories/reference/linux-study-clean/drivers/infiniband/ulp/srp/ib_srp.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/ulp/srp/ib_srp.h- Extension
.h- Size
- 8844 bytes
- Lines
- 351
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/list.hlinux/mutex.hlinux/scatterlist.hscsi/scsi_host.hscsi/scsi_cmnd.hrdma/ib_verbs.hrdma/ib_sa.hrdma/ib_cm.hrdma/rdma_cm.h
Detected Declarations
struct srp_devicestruct srp_hoststruct srp_requeststruct srp_rdma_chstruct ib_cmstruct rdma_cmstruct srp_target_portstruct srp_iustruct srp_fr_descstruct srp_fr_poolstruct srp_map_stateenum srp_target_stateenum srp_iu_type
Annotated Snippet
struct srp_device {
struct list_head dev_list;
struct ib_device *dev;
struct ib_pd *pd;
u32 global_rkey;
u64 mr_page_mask;
int mr_page_size;
int mr_max_size;
int max_pages_per_mr;
bool has_fr;
bool use_fast_reg;
};
/*
* One port of an RDMA adapter in the initiator system.
*
* @target_list: List of connected target ports (struct srp_target_port).
* @target_lock: Protects @target_list.
*/
struct srp_host {
struct srp_device *srp_dev;
u32 port;
struct device dev;
struct list_head target_list;
spinlock_t target_lock;
struct list_head list;
struct mutex add_target_mutex;
};
struct srp_request {
struct scsi_cmnd *scmnd;
struct srp_iu *cmd;
struct srp_fr_desc **fr_list;
struct srp_direct_buf *indirect_desc;
dma_addr_t indirect_dma_addr;
short nmdesc;
struct ib_cqe reg_cqe;
};
/**
* struct srp_rdma_ch
* @comp_vector: Completion vector used by this RDMA channel.
* @max_it_iu_len: Maximum initiator-to-target information unit length.
* @max_ti_iu_len: Maximum target-to-initiator information unit length.
*/
struct srp_rdma_ch {
/* These are RW in the hot path, and commonly used together */
struct list_head free_tx;
spinlock_t lock;
s32 req_lim;
/* These are read-only in the hot path */
struct srp_target_port *target ____cacheline_aligned_in_smp;
struct ib_cq *send_cq;
struct ib_cq *recv_cq;
struct ib_qp *qp;
struct srp_fr_pool *fr_pool;
uint32_t max_it_iu_len;
uint32_t max_ti_iu_len;
u8 max_imm_sge;
bool use_imm_data;
/* Everything above this point is used in the hot path of
* command processing. Try to keep them packed into cachelines.
*/
struct completion done;
int status;
union {
struct ib_cm {
struct sa_path_rec path;
struct ib_sa_query *path_query;
int path_query_id;
struct ib_cm_id *cm_id;
} ib_cm;
struct rdma_cm {
struct rdma_cm_id *cm_id;
} rdma_cm;
};
struct srp_iu **tx_ring;
struct srp_iu **rx_ring;
int comp_vector;
u64 tsk_mgmt_tag;
struct completion tsk_mgmt_done;
u8 tsk_mgmt_status;
bool connected;
};
Annotation
- Immediate include surface: `linux/types.h`, `linux/list.h`, `linux/mutex.h`, `linux/scatterlist.h`, `scsi/scsi_host.h`, `scsi/scsi_cmnd.h`, `rdma/ib_verbs.h`, `rdma/ib_sa.h`.
- Detected declarations: `struct srp_device`, `struct srp_host`, `struct srp_request`, `struct srp_rdma_ch`, `struct ib_cm`, `struct rdma_cm`, `struct srp_target_port`, `struct srp_iu`, `struct srp_fr_desc`, `struct srp_fr_pool`.
- Atlas domain: Driver Families / drivers/infiniband.
- Implementation status: source implementation candidate.
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.