ib_umem_odp_...dma_and_lock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 β€” a bool telling 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 πŸ’œ

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