sgl_len(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… sgl_len β€” a Gen Z girl's guide to the kernel API manual, bestie ✨

okay so real talk, this is a page from the Kernel API Manual (that's the manual name, iykyk 🫢), and it's about one tiny little function that does one tiny little math thing. but we're gonna understand it properly, because that's just how we are. 🌸


✨ NAME ✨

sgl_len β€” lowkey just calculates the size of an SGL of the given capacity, and honestly? that's the whole vibe. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

unsigned int sgl_len (unsigned int n );

πŸŽ€ ARGUMENTS πŸŽ€

  • n β€” the number of SGL entries. that's it. that's the whole argument bestie, she's a simple queen πŸ‘‘

🌈 DESCRIPTION 🌈

okay so here's the tea, no cap: sgl_len calculates the number of flits needed for a Direct Scatter/Gather List that can hold the given number of entries. 🧚

and a flit, before you even ask, is an 8-byte unit. literally eight bytes. that's the unit of measurement. periodt. ⭐

so like… you give it n (how many entries your SGL needs to hold), it hands back how many 8-byte units of space the Direct Scatter/Gather List is gonna take up. it's giving capacity planning main character energy. πŸ’–


πŸ‘‘ SEE ALSO πŸ‘‘

honey. buckle up. πŸ“

first up, the kernel file this whole thing lives near:

Kernel file ./drivers/net/ethernet/chelsio/cxgb4vf/sge.c

and then the entire friend group, every single one, in order, don't skip a single bestie 😭:

like… that's 43 functions. forty-three. an entire friend group chat and they ALL ate. πŸ”₯

ngl if you're reading this page to understand one of those you're already in the cxgb4vf/sge.c cinematic universe, so maybe just go read the file too. kudos to whoever kept this index this tidy though, fr fr πŸ’€

and that's the page, bestie!! the source line at the bottom is a cute little truncated path β€” ./drivers/net/ethernet/chelsio... β€” and the version/date stamp says October 2026, so this manual page is basically from the future and we respect her for it. πŸŽ€βœ¨πŸ«Ά

πŸ“¦ where this page comes from