rvt_lkey_ok(9)
π rvt_lkey_ok β the kernel API manual, bestie edition β¨
okay so before we even start: this is a page from the Kernel API Manual, and it's called rvt_lkey_ok(9). yes, the (9) means "kernel interfaces," we love a section-9 moment. π
β¨ NAME β¨
rvt_lkey_ok β check IB SGE for validity and initialize π
like literally, that's the whole job. it checks stuff and then it initializes stuff. main character behaviour fr fr.
πΈ SYNOPSIS πΈ
int rvt_lkey_ok (struct rvt_lkey_table *rkt , struct rvt_pd *pd , struct
rvt_sge *isge , struct rvt_sge *last_sge , struct ib_sge *sge , int acc
);
look at that signature. six arguments. she's thorough. π
π¦ ARGUMENTS π¦
rktβ the table that contains the lkey we're checking the SGE against. your lookup source, your reference point, your girl.pdβ protection domain. yes queen, protect it. π‘οΈisgeβ the outgoing internal SGE. this is ours, bestie.last_sgeβ the last outgoing SGE that got written. keeping track of the previous one, respectful. π«Άsgeβ the SGE to check. the one on trial. vibe check time.accβ access flags. permissions, boundaries, all of it. π₯
π DESCRIPTION π
so what does she actually do? she checks the IB SGE for validity and then initializes our internal version of it. that's it. that's the arc. β¨
and here's the detail you can't skip: she increments the reference count when a new sge is stored. not me being obsessed with refcounts π but like, this matters. count goes up, sge is stored:
- new sge gets stored β reference count goes β¬οΈ
periodt. no leaks, no drama. π
π RETURN π
0β if compressed π«§1β if added π- otherwise β returns
-errnoπ (translation: something went wrong, go read the errno)
π§ SEE ALSO π§
all the sisters in the family, no cap, they're all here:
kernel file ./drivers/infiniband/sw/rdmavt/mr.c, plus rvt_driver_mr_init(9), rvt_mr_exit(9), rvt_alloc_lkey(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_rkey_ok(9)
like, the whole friend group showed up to the function. iykyk πΈ
if you're readingrvt_lkey_ok(9)you should probably also readrvt_rkey_ok(9)β they're literally siblings, don't be weird about it π
and that's the page!! π sourced from ./drivers/infiniband/sw/rdmavt, version vibes dated October 2026 β stay slaying, kernel besties, mwah πβ¨π
π¦ 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