rvt_alloc_lkey(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… rvt_alloc_lkey β€” allocate an lkey ✨

okay so bestie, welcome to the kernel API manual (that's the section 9 energy, we love her), and today's main character is rvt_alloc_lkey. she's a little function with a big job and honestly? she ate. πŸŽ€


✨ NAME ✨

rvt_alloc_lkey β€” allocate an lkey πŸ¦‹

like, literally, she allocates an lkey. that's the whole vibe. no cap.


🌸 SYNOPSIS 🌸

int rvt_alloc_lkey (struct rvt_mregion *mr , int dma_region );

so she takes two lil friends and hands you back an int. that's it, that's the signature. copy it exactly, don't be cute with it πŸ”₯


πŸŽ€ ARGUMENTS πŸŽ€

  • mr β€” the memory region that this lkey protects πŸ›‘οΈ like, the lkey is her bodyguard, ok? this is who she's guarding.
  • dma_region β€” a little switch, and the values matter: 0 β†’ normal key, 1 β†’ restricted DMA key. two moods, both iconic πŸ’…

🧚 DESCRIPTION 🧚

so here's the tea, bestie:

returns 0 if successful, otherwise returns -errno. classic kernel behavior β€” zero means slay, negative means 😭.

she increments the mr reference count as required. yes, refcounting. yes, she's being responsible. we love a lowkey responsible queen πŸ‘‘

and she sets the lkey field mr for non-dma regions. note it: non-dma regions only. don't come for her about the rest πŸ™ˆ

fr fr, this is one of those functions where the entire description is three lines β€” so don't go inventing extra behavior, she doesn't need you to write her fanfic. πŸ’€

🌈 SEE ALSO 🌈

okay this is the group chat of related functions and i need you to know ALL of them, because the manpage said so and we do not skip parts in this house 🫢

the kernel file they live in is ./drivers/infiniband/sw/rdmavt/mr.c, and the whole squad is:

nineteen besties. count 'em. iykyk ⭐


and that's the page, bestie β€” brought to you by the rvt_alloc_lkey(9) corner of the Kernel API Manual, sourced from ./drivers/infiniband/sw/rdmavt, dated October 2026. mwah, go allocate something πŸ’–βœ¨

πŸ“¦ where this page comes from