swiotlb_search_pool_area(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ swiotlb_search_pool_area πŸ’…

okay bestie, welcome to the swiotlb_search_pool_area(9) page from the Kernel API Manual β€” yes that's the whole title, we're folding it in here at the top like a little name tag πŸŽ€

Like, the whole entire vibe of this function? Searching, like, one memory area in one pool. That's it. That's the function. And honestly? iconic.


🌸 SYNOPSIS 🌸

int swiotlb_search_pool_area (struct device *dev , struct io_tlb_pool
*pool , int area_index , phys_addr_t orig_addr , dma_addr_t tbl_dma_addr
, size_t alloc_size , unsigned int alloc_align_mask );

no cap, that's the whole signature, character for character, don't come for me 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” the device that's mapping the buffer. main character energy tbh.
  • pool β€” the memory pool we're gonna search through. like digging through your bag for your lip gloss πŸ’„
  • area_index β€” the index of the IO TLB memory area we're searching. yes, an index. a number. specific.
  • orig_addr β€” the original (non-bounced) IO buffer address. the real one. the pre-bounce one. periodt.
  • tbl_dma_addr β€” the DMA address of the bounce buffer.
  • alloc_size β€” total requested size of the bounce buffer, including the initial alignment padding. don't forget the padding bestie, it's part of the size fr fr.
  • alloc_align_mask β€” the required alignment of the allocated buffer. the mask. the alignment. you know how it is ✨

🧚 DESCRIPTION 🧚

So what does it do? It finds a suitable sequence of IO TLB entries for the request and allocates a buffer from the given IO TLB memory area. Literally that. Match made in heaven between your request and some entries πŸ’–

And the best part? This function takes care of locking. like, it handles the locking for you. no need to stress, she's got it πŸ‘‘


⭐ RETURN ⭐

  • The index of the first allocated slot β€” slay πŸ’…
  • Or -1 on error β€” 😭 it happens, we move on

🌈 SEE ALSO 🌈

okay this is the whole squad, everybody's here, no one got left out 🫢

Kernel file ./kernel/dma/swiotlb.c β€” plus, in no particular order but actually yes this exact order:


ok that's the page!! go touch some DMA buffers, stay aligned, and remember: she handles the locking for you πŸ’œ

mwah πŸ’‹ β€” this little number lives in ./kernel/dma, dated October 2026, and it's called swiotlb_search_pool_area(9) if you forgot already (you didn't, you're doing amazing) πŸŽ€

πŸ“¦ where this page comes from