ib_umem_odp_...dma_and_lock(9)
π ib_umem_odp_map_dma_and_lock(9) β a Kernel API Manual moment π
okay bestie, welcome to the Kernel API Manual, page ib_umem_odp_...dma_and_lock(9) β yes the name is a whole mouthful, we're abbreviating it in the title because even the manpage authors were like "girl, that's long" π
this one's about DMA-mapping userspace memory inside an ODP MR and then locking it. no cap, it's giving "plumbing but make it glam" β¨
πΈ NAME πΈ
ib_umem_odp_map_dma_and_lock β DMA maps userspace memory in an ODP MR and locks it. that's the whole job description π«Ά
β¨ SYNOPSIS β¨
int ib_umem_odp_map_dma_and_lock (struct ib_umem_odp *umem_odp , u64
user_virt , u64 bcnt , u64 access_mask , bool fault );
literally just that one call, bestie. five args, one int coming back at you π₯
π ARGUMENTS π
umem_odpβ the umem we're mapping and pinning. main character energy, it's the thing everything else is about πuser_virtβ the address we need to map from. like, where in userspace are we grabbing this from, bestie?bcntβ the minimal number of bytes to pin and map. heads up though: the mapping might end up bigger because of alignment (alignment said "i'm helping" π), and it may also be smaller if pinning or mapping a page errors out. the actual number of pages mapped comes back to you in the return value. iykyk πaccess_maskβ a bit mask of the access permissions requested for the given range. bit-mask era πfaultβ abooltelling us whether faulting is required for the given range. yes or no, no in-between π¦
π DESCRIPTION π
so here's the vibe: this maps the range you passed in to DMA addresses. iconic. upon success, the ODP MR will be locked so the caller can go finish its device page table update β the lock is basically the "do not disturb, updating my page table" sign on the door π
returns the number of pages mapped on success, and a negative error code on failure. that's the whole contract, fr fr β
if you see a negative number coming back, that's not a page count, bestie β that's the universe telling you something went wrong π
π SEE ALSO π
- Kernel file
./drivers/infiniband/core/umem_odp.c ib_umem_odp_alloc_implicit(9)ib_umem_odp_alloc_child(9)ib_umem_odp_get(9)
go read those too, they're the friend group π«Ά
aaaand that's the page!! π living in ./drivers/infiniband/core, dated October 2026 β write that down, bestie, that's the lore β¨ slay, bye π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms