ib_alloc_mr(9)
π ib_alloc_mr(9) β the kernel API manual, bestie edition π
okay so real talk: this is a page from the Kernel API Manual, and the star of the show is ib_alloc_mr(9) β literally the function that hands you a memory region. let's get into it β¨
πΈ NAME πΈ
ib_alloc_mr β allocates a memory region. that's it, that's the whole vibe. one job, does it well π
β SYNOPSIS β
struct ib_mr * ib_alloc_mr (struct ib_pd *pd , enum ib_mr_type mr_type ,
u32 max_num_sg );
look at that signature. gorgeous. returns a struct ib_mr * and takes three args, we love a clean three-arg moment π«Ά
π¦ ARGUMENTS π¦
pdβ the protection domain that's associated with the region. like, which PD is this MR even living in? that one πmr_typeβ the type of the memory region. it's anenum ib_mr_type, so pick your flavor β¨max_num_sgβ the maximum number of sg entries available for registration. the ceiling. the limit. the "no more than this, babes" π§
π NOTES π
okay important, listen up π
- Memory registration page/sg lists must not exceed
max_num_sg. that's a hard no-cap limit, fr fr. - For
mr_typeIB_MR_TYPE_MEM_REG, the total length cannot exceedmax_num_sg * used_page_size. do the math before you vibe check your buffers, i'm begging π
ngl, these are the kind of notes you skim and then regret skimming. please read them. π
π SEE ALSO π
kernel file ./drivers/infiniband/core/verbs.c (__ib_alloc_pd(9)), plus the whole friend group:
ib_dealloc_pd_user(9)rdma_copy_ah_attr(9)rdma_replace_ah_attr(9)rdma_move_ah_attr(9)rdma_create_ah(9)rdma_create_user_ah(9)rdma_move_grh_sgid_attr(9)rdma_destroy_ah_attr(9)ib_create_srq_user(9)ib_create_qp_user(9)ib_resolve_eth_dmac(9)ib_modify_qp_with_udata(9)ib_alloc_mr_integrity(9)ib_alloc_xrcd_user(9)ib_dealloc_xrcd_user(9)ib_create_wq(9)ib_destroy_wq_user(9)ib_map_mr_sg_pi(9)ib_map_mr_sg(9)ib_sg_to_pages(9)ib_drain_sq(9)ib_drain_rq(9)ib_drain_qp(9)rdma_alloc_hw_stats_struct(9)rdma_free_hw_stats_struct(9)
like, the entire roster. main character energy from every single one of them π
and that's a wrap, bestie π this little guy lives over in ./drivers/infiniband/core and this edition is dated October 2026 β see you in the next kernel cycle, 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