rvt_alloc_lkey(9)
π 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:
rvt_driver_mr_init(9)rvt_mr_exit(9)rvt_free_lkey(9)rvt_get_dma_mr(9)rvt_reg_user_mr(9)rvt_dereg_clean_qp_cb(9)rvt_dereg_clean_qps(9)rvt_check_refs(9)rvt_mr_has_lkey(9)rvt_ss_has_lkey(9)rvt_dereg_mr(9)rvt_alloc_mr(9)rvt_set_page(9)rvt_map_mr_sg(9)rvt_fast_reg_mr(9)rvt_invalidate_rkey(9)rvt_sge_adjacent(9)rvt_lkey_ok(9)rvt_rkey_ok(9)
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
- 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