drivers/infiniband/sw/rxe/rxe_req.c
Source file repositories/reference/linux-study-clean/drivers/infiniband/sw/rxe/rxe_req.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/sw/rxe/rxe_req.c- Extension
.c- Size
- 20392 bytes
- Lines
- 852
- 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/skbuff.hrxe.hrxe_loc.hrxe_queue.h
Detected Declarations
function retry_first_write_sendfunction req_retryfunction rnr_nak_timerfunction req_check_sq_drain_donefunction rxe_wqe_is_fencedfunction next_opcode_rcfunction next_opcode_ucfunction next_opcodefunction check_init_depthfunction get_mtufunction finish_packetfunction update_wqe_statefunction update_wqe_psnfunction update_statefunction rxe_do_local_opsfunction rxe_requesterfunction rxe_sender
Annotated Snippet
if (wqe->wr.send_flags & IB_SEND_INLINE) {
wqe->dma.resid -= to_send;
wqe->dma.sge_offset += to_send;
} else {
advance_dma_data(&wqe->dma, to_send);
}
}
}
static void req_retry(struct rxe_qp *qp)
{
struct rxe_send_wqe *wqe;
unsigned int wqe_index;
unsigned int mask;
int npsn;
int first = 1;
struct rxe_queue *q = qp->sq.queue;
unsigned int cons;
unsigned int prod;
cons = queue_get_consumer(q, QUEUE_TYPE_FROM_CLIENT);
prod = queue_get_producer(q, QUEUE_TYPE_FROM_CLIENT);
qp->req.wqe_index = cons;
qp->req.psn = qp->comp.psn;
qp->req.opcode = -1;
for (wqe_index = cons; wqe_index != prod;
wqe_index = queue_next_index(q, wqe_index)) {
wqe = queue_addr_from_index(qp->sq.queue, wqe_index);
mask = wr_opcode_mask(wqe->wr.opcode, qp);
if (wqe->state == wqe_state_posted)
break;
if (wqe->state == wqe_state_done)
continue;
wqe->iova = (mask & WR_ATOMIC_MASK) ?
wqe->wr.wr.atomic.remote_addr :
(mask & WR_READ_OR_WRITE_MASK) ?
wqe->wr.wr.rdma.remote_addr :
0;
if (!first || (mask & WR_READ_MASK) == 0) {
wqe->dma.resid = wqe->dma.length;
wqe->dma.cur_sge = 0;
wqe->dma.sge_offset = 0;
}
if (first) {
first = 0;
if (mask & WR_WRITE_OR_SEND_MASK) {
npsn = (qp->comp.psn - wqe->first_psn) &
BTH_PSN_MASK;
retry_first_write_send(qp, wqe, npsn);
}
if (mask & WR_READ_MASK) {
npsn = (wqe->dma.length - wqe->dma.resid) /
qp->mtu;
wqe->iova += npsn * qp->mtu;
}
}
wqe->state = wqe_state_posted;
}
}
void rnr_nak_timer(struct timer_list *t)
{
struct rxe_qp *qp = timer_container_of(qp, t, rnr_nak_timer);
unsigned long flags;
rxe_dbg_qp(qp, "nak timer fired\n");
if (!rxe_get(qp))
return;
spin_lock_irqsave(&qp->state_lock, flags);
if (qp->valid) {
/* request a send queue retry */
qp->req.need_retry = 1;
qp->req.wait_for_rnr_timer = 0;
rxe_sched_task(&qp->send_task);
}
spin_unlock_irqrestore(&qp->state_lock, flags);
rxe_put(qp);
}
Annotation
- Immediate include surface: `linux/skbuff.h`, `rxe.h`, `rxe_loc.h`, `rxe_queue.h`.
- Detected declarations: `function retry_first_write_send`, `function req_retry`, `function rnr_nak_timer`, `function req_check_sq_drain_done`, `function rxe_wqe_is_fenced`, `function next_opcode_rc`, `function next_opcode_uc`, `function next_opcode`, `function check_init_depth`, `function get_mtu`.
- 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.