ib_sg_to_pages(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ib_sg_to_pages(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so picture this: you're deep in the Kernel API Manual (the 9 is the section, iykyk) and you've got a scatterlist that's way too long and a page vector that's way too empty. This little icon right here is the glow-up in between ✨


πŸ¦‹ NAME πŸ¦‹

ib_sg_to_pages β€” converts the largest prefix of a sg list into a page vector. literally that's the whole job, and she ate πŸ’…


🌸 SYNOPSIS 🌸

int ib_sg_to_pages (struct ib_mr *mr , struct scatterlist *sgl , int
sg_nents , unsigned int *sg_offset_p , int (*set_page)(struct ib_mr *,
u64) );

πŸŽ€ ARGUMENTS πŸŽ€

  • mr β€” the memory region, bestie. that's the main character of this function πŸ’–
  • sgl β€” a dma mapped scatterlist πŸ¦‹
  • sg_nents β€” how many entries are in the sg. the count. the census. the roster count πŸ“‹
  • sg_offset_p β€” a pointer to an offset, and she's both an input and an output, so pay attention:
    • IN β€” start offset in bytes into sg 🌸
    • OUT β€” offset in bytes for element n of the sg of the first byte that has not been processed, where n is the return value of this function πŸ‘‘
  • set_page β€” the driver's page assignment function pointer πŸ”₯

✨ DESCRIPTION ✨

So this is a core service helper, right? For drivers 🫢 Her whole thing is converting the largest prefix of a given sg list into a page vector. And when I say "the largest prefix," I mean the prefix that meets the requirements of ib_map_mr_sg β€” no cap, that's the exact bar she's clearing πŸ’―

She returns the number of sg elements that were assigned to a page vector. that's it, that's the return value, that's the vibe check βœ…

ngl bestie, if you were hoping for a whole separate RETURN VALUE section β€” she doesn't have one. the return value lives right here in DESCRIPTION and we respect her choices πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/infiniband/core/verbs.c β€” go read the source, it's giving main character energy πŸ“– And while you're in there, these besties are all in the same friend group:


and that's the page, bestie 🧚 this cutie lives in ./drivers/infiniband/core and she's dated October 2026 β€” so she's fresh, she's current, she's iconic 🌈⭐ stay hydrated and go map some sg lists πŸ’œ

πŸ“¦ where this page comes from