msi_next_desc(9)
β¨ msi_next_desc β¨
Okay bestie, welcome to msi_next_desc(9) from the Kernel API Manual β literally the "gimme the next one" function for MSI descriptors, and she is very particular about how you call her. π
π NAME π
msi_next_desc β get the next MSI descriptor of a device. That's it, that's the whole vibe. π¦
πΈ SYNOPSIS πΈ
struct msi_desc * msi_next_desc (struct device *dev , unsigned int domid , enum msi_desc_filter filter );
π ARGUMENTS π
devβ the device you're operating on. Your main character. πdomidβ the id of the interrupt domain that should be walked. Like, which neighborhood we're strolling through.filterβ the descriptor state filter. This is the vibe check: only descriptors matching your criteria get to come through. β¨
π₯ DESCRIPTION π₯
Okay so here's the tea, and you need to hear it. β
The first time you call msi_next_desc, you must have already called __msi_first_desc successfully first β no cap. Like, you can't just show up to the function without an invitation. Consecutive invocations are only valid if the previous one was successful. So it's a chain: if a link breaks, the whole thing breaks, and that's on you. π
And the biggest rule of all: all of these operations have to be done within the same MSI mutex held region. Same region, bestie. Don't be out here unlocking mid-walk. That's giving undefined behavior energy and we do not stan. π
π RETURN π
A pointer to the next MSI descriptor that matches the search criteria. π«Ά And if nothing matches? You get NULL. None found, no descriptor, go home. π
β SEE ALSO β
Kernel file ./kernel/irq/msi.c, plus this whole squad right here β she keeps good company:
struct msi_device_data(9)struct msi_ctrl(9)msi_alloc_desc(9)msi_domain_insert_msi_desc(9)msi_domain_free_msi_descs_range(9)msi_domain_add_simple_msi_descs(9)msi_setup_device_data(9)__msi_lock_descs(9)__msi_unlock_descs(9)msi_domain_first_desc(9)msi_domain_get_virq(9)msi_device_populate_sysfs(9)msi_device_destroy_sysfs(9)msi_domain_set_affinity(9)msi_create_irq_domain(9)msi_create_parent_irq_domain(9)msi_parent_init_dev_msi_info(9)msi_create_device_irq_domain(9)msi_remove_device_irq_domain(9)msi_match_device_irq_domain(9)msi_domain_alloc_irqs_range_locked(9)msi_domain_alloc_irqs_range(9)msi_domain_alloc_irqs_all_locked(9)msi_domain_alloc_irq_at(9)msi_device_domain_alloc_wired(9)msi_domain_free_irqs_range_locked(9)msi_domain_free_irqs_range(9)msi_domain_free_irqs_all_locked(9)msi_domain_free_irqs_all(9)msi_device_domain_free_wired(9)msi_get_domain_info(9)msi_device_has_isolated_msi(9)
Sources say this one lives in ./kernel/irq and got her glow-up in October 2026 β go off, queen. πβ¨ Slay, and remember: lock the mutex. π«Άπ
π¦ 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