drivers/infiniband/hw/hfi1/iowait.h
Source file repositories/reference/linux-study-clean/drivers/infiniband/hw/hfi1/iowait.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/hw/hfi1/iowait.h- Extension
.h- Size
- 10728 bytes
- Lines
- 458
- 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/list.hlinux/workqueue.hlinux/wait.hlinux/sched.hsdma_txreq.h
Detected Declarations
struct sdma_txreqstruct sdma_enginestruct iowaitstruct iowait_workstruct iowaitfunction iowait_schedulefunction iowait_tid_schedulefunction iowait_sdma_drainfunction iowait_sdma_pendingfunction iowait_sdma_incfunction iowait_sdma_addfunction iowait_sdma_decfunction iowait_pio_drainfunction iowait_pio_pendingfunction iowait_pio_incfunction iowait_pio_decfunction iowait_drain_wakeupfunction iowait_get_txheadfunction iowait_get_descfunction iowait_get_all_descfunction iowait_update_priorityfunction iowait_update_all_priorityfunction iowait_init_priorityfunction iowait_get_priorityfunction resourcefunction iowait_starve_clearfunction iowait_packet_queuedfunction iowait_inc_wait_count
Annotated Snippet
struct iowait_work {
struct work_struct iowork;
struct list_head tx_head;
struct iowait *iow;
};
/**
* @list: used to add/insert into QP/PQ wait lists
* @tx_head: overflow list of sdma_txreq's
* @sleep: no space callback
* @wakeup: space callback wakeup
* @sdma_drained: sdma count drained
* @init_priority: callback to manipulate priority
* @lock: lock protected head of wait queue
* @iowork: workqueue overhead
* @wait_dma: wait for sdma_busy == 0
* @wait_pio: wait for pio_busy == 0
* @sdma_busy: # of packets in flight
* @count: total number of descriptors in tx_head'ed list
* @tx_limit: limit for overflow queuing
* @tx_count: number of tx entry's in tx_head'ed list
* @flags: wait flags (one per QP)
* @wait: SE array for multiple legs
*
* This is to be embedded in user's state structure
* (QP or PQ).
*
* The sleep and wakeup members are a
* bit misnamed. They do not strictly
* speaking sleep or wake up, but they
* are callbacks for the ULP to implement
* what ever queuing/dequeuing of
* the embedded iowait and its containing struct
* when a resource shortage like SDMA ring space
* or PIO credit space is seen.
*
* Both potentially have locks help
* so sleeping is not allowed and it is not
* supported to submit txreqs from the wakeup
* call directly because of lock conflicts.
*
* The wait_dma member along with the iow
*
* The lock field is used by waiters to record
* the seqlock_t that guards the list head.
* Waiters explicitly know that, but the destroy
* code that unwaits QPs does not.
*/
struct iowait {
struct list_head list;
int (*sleep)(
struct sdma_engine *sde,
struct iowait_work *wait,
struct sdma_txreq *tx,
uint seq,
bool pkts_sent
);
void (*wakeup)(struct iowait *wait, int reason);
void (*sdma_drained)(struct iowait *wait);
void (*init_priority)(struct iowait *wait);
seqlock_t *lock;
wait_queue_head_t wait_dma;
wait_queue_head_t wait_pio;
atomic_t sdma_busy;
atomic_t pio_busy;
u32 count;
u32 tx_limit;
u32 tx_count;
u8 starved_cnt;
u8 priority;
unsigned long flags;
struct iowait_work wait[IOWAIT_SES];
};
#define SDMA_AVAIL_REASON 0
void iowait_set_flag(struct iowait *wait, u32 flag);
bool iowait_flag_set(struct iowait *wait, u32 flag);
void iowait_clear_flag(struct iowait *wait, u32 flag);
void iowait_init(struct iowait *wait, u32 tx_limit,
void (*func)(struct work_struct *work),
void (*tidfunc)(struct work_struct *work),
int (*sleep)(struct sdma_engine *sde,
struct iowait_work *wait,
struct sdma_txreq *tx,
uint seq,
bool pkts_sent),
void (*wakeup)(struct iowait *wait, int reason),
void (*sdma_drained)(struct iowait *wait),
Annotation
- Immediate include surface: `linux/list.h`, `linux/workqueue.h`, `linux/wait.h`, `linux/sched.h`, `sdma_txreq.h`.
- Detected declarations: `struct sdma_txreq`, `struct sdma_engine`, `struct iowait`, `struct iowait_work`, `struct iowait`, `function iowait_schedule`, `function iowait_tid_schedule`, `function iowait_sdma_drain`, `function iowait_sdma_pending`, `function iowait_sdma_inc`.
- 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.