tso_dma_map_count(9)
π tso_dma_map_count(9) β like, the kernel API manual, but make it make sense π
okay so bestie, welcome to the Kernel API Manual page for tso_dma_map_count β she lives in the 9 section, and honestly? she's a tiny little function with one job and she does it slayfully. let's get into it β¨
πΈ NAME πΈ
tso_dma_map_count β counts the descriptors for a payload range. that's it. that's the whole vibe check. π
β¨ SYNOPSIS β¨
unsigned int tso_dma_map_count (struct tso_dma_map *map , unsigned int
len );
like yes, she returns an unsigned int, and yes, she takes two args. no cap. π«Ά
π§ ARGUMENTS π§
mapβ the payload map. your main character struct, the one holding all the state. πlenβ number of payload bytes in this segment. just how many bytes you're asking about, bestie. π
π DESCRIPTION π
so what she does is: she counts how many contiguous DMA region chunks the next len bytes are gonna span β and the way that she does it without advancing the iterator?? iconic. she looks, she counts, she leaves everything exactly where she found it. no side effects, no drama, no moving the pointer. π
here's the tea on how the count goes down:
- on the IOVA path, the answer is always
1</>, because it's contiguous. one chunk, one descriptor, done. periodt. β¨ - on the fallback path, she uses the region sizes from the current position to figure it out. so the number genuinely depends on where you're sitting and how big the regions are from there. π₯
β RETURN β
she returns the number of descriptors needed for len bytes of payload. that's your answer, bestie, go spend it wisely. π
π SEE ALSO π
- the kernel file:
./net/core/tso.cπ¦ tso_dma_map_init(9)β the setup bestietso_dma_map_cleanup(9)β the cleanup bestietso_dma_map_next(9)β the one that actually advances the iterator, unlike our girl π
okay that's the whole page, you ate that. and for the cute sign-off: this little gem comes from ./net/core, dated October 2026 β and it's the tso_dma_map_count(9) page, 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