msi_for_each_desc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… msi_for_each_desc(9) β€” a lil' field guide from the Kernel API Manual πŸŽ€

okay so bestie, picture this: you're deep in ./include/linux/msi.h and you need to walk every single MSI descriptor in the default irqdomain. that's it. that's the whole vibe of this macro. lowkey iconic, highkey essential πŸ¦‹


✨ NAME ✨

msi_for_each_desc β€” iterate the MSI descriptors in the default irqdomain πŸŒ€

like, a lil' for-loop but make it kernel. main character energy fr fr.


🌸 SYNOPSIS 🌸

msi_for_each_desc (desc , dev , filter );

that's the whole thing. three args, no cap. copy it exactly like that, spacing and all, she's picky πŸ’…


🧚 ARGUMENTS 🧚

  • desc β€” a struct msi_desc pointer that you're using as the iterator. she's the lil' cursor that hops from descriptor to descriptor, one at a time, minding her own business 🐾
  • dev β€” a struct device pointer, i.e. the device you're iterating over. this is the "who am I looking at" of the whole operation πŸ‘€
  • filter β€” the filter for descriptor selection. yeah, you get to be picky about which descriptors show up to the party β€” filter decides who makes the guest list 🎟️

πŸ”₯ NOTES πŸ”₯

okay this part is NOT optional, bestie. read it twice. 🚨
  • the loop must be protected with a msi_lock_descs/msi_unlock_descs pair. like, lock first, unlock after. do not skip this. do not "forget". do not "it'll probably be fine". it will not be fine πŸ’€
  • it is safe to remove a retrieved MSI descriptor in the loop. yes, inside the loop, while you're iterating. go off king, delete her mid-stride πŸ‘‘βœ¨ β€” that one's actually sanctioned, unlike the lock thing.

πŸ¦‹ SEE ALSO πŸ¦‹

the whole squad, gathered for you, in the kernel file ./include/linux/msi.h:

not me listing all sixteen of them because every single one matters πŸ’–


and that's the page!! this lil' gem lives under ./include/linux, dated October 2026, straight from the Kernel API Manual β€” catch you on the next loop iteration, bestie πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from