ib_map_mr_sg_pi(9)
π ib_map_mr_sg_pi(9) β the Kernel API Manual page, bestie edition
okay so picture this: it's a page from the Kernel API Manual, and today's main character is ib_map_mr_sg_pi(9). yes, that name is a mouthful, no, we're not abbreviating it. it's about mapping dma-mapped SG lists for PI (that's protection information, iykyk) and setting up an appropriate memory region so it's ready for registration. that's the whole vibe. π¦
β¨ SYNOPSIS β¨
int ib_map_mr_sg_pi (struct ib_mr *mr , struct scatterlist *data_sg ,
int data_sg_nents , unsigned int *data_sg_offset , struct scatterlist
*meta_sg , int meta_sg_nents , unsigned int *meta_sg_offset , unsigned
int page_size );
look at that signature. nine whole parameters. it ate and left no crumbs. π
π ARGUMENTS π
every single one of them, in order, no skips:
mrβ the memory region. it's giving "main character energy" because literally everything happens to it. πdata_sgβ the dma mapped scatterlist for the data. like the actual payload bestie.data_sg_nentsβ how many entries are indata_sg. the count. the headcount. πdata_sg_offsetβ offset in bytes intodata_sg. yes, bytes. don't @ me.meta_sgβ the dma mapped scatterlist for the metadata. the sidecar. the little friend that comes along. πmeta_sg_nentsβ how many entries are inmeta_sg. another headcount, another day.meta_sg_offsetβ offset in bytes intometa_sg. also bytes. consistency slay. β¨page_sizeβ the page vector's desired page size. it's the vibe setter for pages, fr fr.
πΈ DESCRIPTION πΈ
so here are the Constraints β and when I say constraints I mean the rules you do not break, no cap:
- The MR must be allocated with type
IB_MR_TYPE_INTEGRITY. that's it, that's the constraint. if you didn't do that, it's not gonna work, and that's on you bestie. π
After this completes successfully, the memory region is ready for registration. so like, do the call, get the good result, and your MR is all dressed up and ready to be registered. iconic behavior only. π
β RETURN β
0 on success. that's the whole section. zero means yay. π«Ά
π SEE ALSO π
okay this is the group chat roster and every single member is here:
Kernel file ./drivers/infiniband/core/verbs.c
__ib_alloc_pd(9)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(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(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)
quick vibe check before you go: IB_MR_TYPE_INTEGRITY is not optional. it's not a suggestion. it's the law. π₯
and that's the page!! this little manual lives in ./drivers/infiniband/core and it's dated October 2026 β so go forth, map those SG lists for PI, and remember: the MR was ready for registration all along. π§π bye bestie!!
π¦ 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