msi_for_each_desc(9)
π 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β astruct msi_descpointer 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β astruct devicepointer, 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 βfilterdecides 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_descspair. 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:
struct msi_msg(9)struct pci_msi_desc(9)union msi_domain_cookie(9)struct msi_desc_data(9)struct msi_desc(9)struct msi_dev_domain(9)msi_first_desc(9)msi_domain_for_each_desc(9)msi_msg_set_addr(9)msi_insert_msi_desc(9)msi_free_msi_descs_range(9)msi_free_msi_descs(9)struct msi_domain_ops(9)struct msi_domain_info(9)struct msi_domain_template(9)struct msi_parent_ops(9)
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
- 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