pci_msix_alloc_irq_at(9)
β¨ pci_msix_alloc_irq_at β¨
okay so bestie, welcome to the Kernel API Manual π
β this one is pci_msix_alloc_irq_at, and it does exactly what the vibes suggest: it allocates an MSI-X interrupt after you've already enabled MSI-X, either at a specific MSI-X vector index you pick, or at any free vector index that's just sitting there waiting for its moment πΈ
π SYNOPSIS π
struct msi_map pci_msix_alloc_irq_at (struct pci_dev *dev , unsigned int
index , const struct irq_affinity_desc *affdesc );
that's the whole glow-up. three args, one struct msi_map back. periodt π
π ARGUMENTS π
devβ the PCI device you're operating on. your main character π«Άindexβ the index you wanna allocate. ngl, ifindex == MSI_ANY_INDEXit just allocates the next free index in the MSI-X table β like, the next available seat, no cap π¦affdescβ an optional pointer to an affinity descriptor structure. otherwiseNULL. yeah, optional optional π
β RETURN β
a struct msi_map. that's it, that's the return. π
π DESCRIPTION π
okay so here's the tea, and it's genuinely simple:
on success, msi_map::index contains the allocated index (>= 0), and msi_map::virq contains the allocated Linux interrupt number (> 0). slay, both populated, everything ate π₯
on fail, msi_map::index contains the error code, and msi_map::virq is set to 0. so if you see a zero virq, that's your vibe check saying "bestie no" π
fr fr: check msi_map::index before you assume anything β negative means the error code lives in there, not a vector.
π¦ SEE ALSO π¦
kernel file ./drivers/pci/msi/api.c, plus the whole friend group:
pci_enable_msi(9)pci_disable_msi(9)pci_msix_vec_count(9)pci_enable_msix_range(9)pci_msix_can_alloc_dyn(9)pci_msix_free_irq(9)pci_disable_msix(9)pci_alloc_irq_vectors(9)pci_alloc_irq_vectors_affinity(9)pci_irq_vector(9)pci_irq_get_affinity(9)pci_free_irq_vectors(9)pci_restore_msi_state(9)pci_msi_enabled(9)
and that's the page, bestie π§π β brought to you from ./drivers/pci/msi, dated October 2026, starring pci_msix_alloc_irq_at(9) in the title role πβ¨
π¦ 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