drivers/infiniband/sw/rxe/rxe_pool.c
Source file repositories/reference/linux-study-clean/drivers/infiniband/sw/rxe/rxe_pool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/sw/rxe/rxe_pool.c- Extension
.c- Size
- 6093 bytes
- Lines
- 256
- 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
rxe.h
Detected Declarations
function rxe_pool_initfunction rxe_pool_cleanupfunction __rxe_add_to_poolfunction rxe_elem_releasefunction __rxe_cleanupfunction __rxe_getfunction __rxe_putfunction __rxe_finalize
Annotated Snippet
if (!completion_done(&elem->complete)) {
ret = wait_for_completion_timeout(&elem->complete,
msecs_to_jiffies(50000));
/* Shouldn't happen. There are still references to
* the object but, rather than deadlock, free the
* object or pass back to rdma-core.
*/
if (WARN_ON(!ret))
err = -ETIMEDOUT;
}
} else {
unsigned long until = jiffies + RXE_POOL_TIMEOUT;
/* AH objects are unique in that the destroy_ah verb
* can be called in atomic context. This delay
* replaces the wait_for_completion call above
* when the destroy_ah call is not sleepable
*/
while (!completion_done(&elem->complete) &&
time_before(jiffies, until))
mdelay(1);
if (WARN_ON(!completion_done(&elem->complete)))
err = -ETIMEDOUT;
}
if (pool->cleanup)
pool->cleanup(elem);
atomic_dec(&pool->num_elem);
return err;
}
int __rxe_get(struct rxe_pool_elem *elem)
{
return kref_get_unless_zero(&elem->ref_cnt);
}
int __rxe_put(struct rxe_pool_elem *elem)
{
return kref_put(&elem->ref_cnt, rxe_elem_release);
}
void __rxe_finalize(struct rxe_pool_elem *elem)
{
void *xa_ret;
xa_ret = xa_store(&elem->pool->xa, elem->index, elem, GFP_KERNEL);
WARN_ON(xa_err(xa_ret));
}
Annotation
- Immediate include surface: `rxe.h`.
- Detected declarations: `function rxe_pool_init`, `function rxe_pool_cleanup`, `function __rxe_add_to_pool`, `function rxe_elem_release`, `function __rxe_cleanup`, `function __rxe_get`, `function __rxe_put`, `function __rxe_finalize`.
- 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.