drivers/infiniband/core/mr_pool.c
Source file repositories/reference/linux-study-clean/drivers/infiniband/core/mr_pool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/core/mr_pool.c- Extension
.c- Size
- 1928 bytes
- Lines
- 83
- Domain
- Driver Families
- Bucket
- drivers/infiniband
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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
rdma/ib_verbs.hrdma/mr_pool.h
Detected Declarations
function Copyrightfunction ib_mr_pool_putfunction ib_mr_pool_initfunction ib_mr_pool_destroyexport ib_mr_pool_getexport ib_mr_pool_putexport ib_mr_pool_initexport ib_mr_pool_destroy
Annotated Snippet
if (IS_ERR(mr)) {
ret = PTR_ERR(mr);
goto out;
}
spin_lock_irqsave(&qp->mr_lock, flags);
list_add_tail(&mr->qp_entry, list);
spin_unlock_irqrestore(&qp->mr_lock, flags);
}
return 0;
out:
ib_mr_pool_destroy(qp, list);
return ret;
}
EXPORT_SYMBOL(ib_mr_pool_init);
void ib_mr_pool_destroy(struct ib_qp *qp, struct list_head *list)
{
struct ib_mr *mr;
unsigned long flags;
spin_lock_irqsave(&qp->mr_lock, flags);
while (!list_empty(list)) {
mr = list_first_entry(list, struct ib_mr, qp_entry);
list_del(&mr->qp_entry);
spin_unlock_irqrestore(&qp->mr_lock, flags);
ib_dereg_mr(mr);
spin_lock_irqsave(&qp->mr_lock, flags);
}
spin_unlock_irqrestore(&qp->mr_lock, flags);
}
EXPORT_SYMBOL(ib_mr_pool_destroy);
Annotation
- Immediate include surface: `rdma/ib_verbs.h`, `rdma/mr_pool.h`.
- Detected declarations: `function Copyright`, `function ib_mr_pool_put`, `function ib_mr_pool_init`, `function ib_mr_pool_destroy`, `export ib_mr_pool_get`, `export ib_mr_pool_put`, `export ib_mr_pool_init`, `export ib_mr_pool_destroy`.
- Atlas domain: Driver Families / drivers/infiniband.
- Implementation status: integration 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.