pci_msix_alloc_irq_at(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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, if index == MSI_ANY_INDEX it 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. otherwise NULL. 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:


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