drivers/infiniband/ulp/srpt/ib_srpt.h
Source file repositories/reference/linux-study-clean/drivers/infiniband/ulp/srpt/ib_srpt.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/ulp/srpt/ib_srpt.h- Extension
.h- Size
- 15762 bytes
- Lines
- 470
- 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/types.hlinux/list.hlinux/wait.hrdma/ib_verbs.hrdma/ib_sa.hrdma/ib_cm.hrdma/rdma_cm.hrdma/rw.hscsi/srp.hib_dm_mad.h
Detected Declarations
struct srpt_nexusstruct srpt_ioctxstruct srpt_recv_ioctxstruct srpt_rw_ctxstruct srpt_send_ioctxstruct srpt_rdma_chstruct srpt_nexusstruct srpt_port_attribstruct srpt_tpgstruct srpt_port_idstruct srpt_portstruct srpt_deviceenum srpt_command_stateenum rdma_ch_state
Annotated Snippet
struct srpt_ioctx {
struct ib_cqe cqe;
void *buf;
dma_addr_t dma;
uint32_t offset;
uint32_t index;
};
/**
* struct srpt_recv_ioctx - SRPT receive I/O context
* @ioctx: See above.
* @wait_list: Node for insertion in srpt_rdma_ch.cmd_wait_list.
* @byte_len: Number of bytes in @ioctx.buf.
*/
struct srpt_recv_ioctx {
struct srpt_ioctx ioctx;
struct list_head wait_list;
int byte_len;
};
struct srpt_rw_ctx {
struct rdma_rw_ctx rw;
struct scatterlist *sg;
unsigned int nents;
};
/**
* struct srpt_send_ioctx - SRPT send I/O context
* @ioctx: See above.
* @ch: Channel pointer.
* @recv_ioctx: Receive I/O context associated with this send I/O context.
* Only used for processing immediate data.
* @s_rw_ctx: @rw_ctxs points here if only a single rw_ctx is needed.
* @rw_ctxs: RDMA read/write contexts.
* @imm_sg: Scatterlist for immediate data.
* @rdma_cqe: RDMA completion queue element.
* @state: I/O context state.
* @cmd: Target core command data structure.
* @sense_data: SCSI sense data.
* @n_rdma: Number of work requests needed to transfer this ioctx.
* @n_rw_ctx: Size of rw_ctxs array.
* @queue_status_only: Send a SCSI status back to the initiator but no data.
* @sense_data: Sense data to be sent to the initiator.
*/
struct srpt_send_ioctx {
struct srpt_ioctx ioctx;
struct srpt_rdma_ch *ch;
struct srpt_recv_ioctx *recv_ioctx;
struct srpt_rw_ctx s_rw_ctx;
struct srpt_rw_ctx *rw_ctxs;
struct scatterlist imm_sg;
struct ib_cqe rdma_cqe;
enum srpt_command_state state;
struct se_cmd cmd;
u8 n_rdma;
u8 n_rw_ctx;
bool queue_status_only;
u8 sense_data[TRANSPORT_SENSE_BUFFER];
};
/**
* enum rdma_ch_state - SRP channel state
* @CH_CONNECTING: QP is in RTR state; waiting for RTU.
* @CH_LIVE: QP is in RTS state.
* @CH_DISCONNECTING: DREQ has been sent and waiting for DREP or DREQ has
* been received.
* @CH_DRAINING: DREP has been received or waiting for DREP timed out
* and last work request has been queued.
* @CH_DISCONNECTED: Last completion has been received.
*/
enum rdma_ch_state {
CH_CONNECTING,
CH_LIVE,
CH_DISCONNECTING,
CH_DRAINING,
CH_DISCONNECTED,
};
/**
* struct srpt_rdma_ch - RDMA channel
* @nexus: I_T nexus this channel is associated with.
* @qp: IB queue pair used for communicating over this channel.
* @ib_cm: See below.
* @ib_cm.cm_id: IB CM ID associated with the channel.
* @rdma_cm: See below.
* @rdma_cm.cm_id: RDMA CM ID associated with the channel.
* @cq: IB completion queue for this channel.
Annotation
- Immediate include surface: `linux/types.h`, `linux/list.h`, `linux/wait.h`, `rdma/ib_verbs.h`, `rdma/ib_sa.h`, `rdma/ib_cm.h`, `rdma/rdma_cm.h`, `rdma/rw.h`.
- Detected declarations: `struct srpt_nexus`, `struct srpt_ioctx`, `struct srpt_recv_ioctx`, `struct srpt_rw_ctx`, `struct srpt_send_ioctx`, `struct srpt_rdma_ch`, `struct srpt_nexus`, `struct srpt_port_attrib`, `struct srpt_tpg`, `struct srpt_port_id`.
- 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.