pci_alloc_irq_vectors(9)
β¨ NAME β¨
pci_alloc_irq_vectors β Allocate multiple device interrupt vectors
Okay bestie, this page is from the Kernel API Manual and it's all about snagging multiple interrupt vectors for your PCI device. It's giving "I need several IRQs and I need them now" energy. π
π SYNOPSIS π
int pci_alloc_irq_vectors (struct pci_dev *dev , unsigned int min_vecs ,
unsigned int max_vecs , unsigned int flags );
π ARGUMENTS π
devβ the PCI device to operate on. It's the main character here, the device you're about to bless with interrupts. πmin_vecsβ minimum required number of vectors. Must be>= 1. Like, you can't ask for zero, that's not a vibe. πmax_vecsβ maximum desired number of vectors. Shoot your shot, queen. πflagsβ One or more of: (and the actual list is in DESCRIPTION, keep scrolling bestie)
π¦ DESCRIPTION π¦
PCI_IRQ_MSIXβ Allow trying MSI-X vector allocations. This is the fancy one, the VIP. β¨PCI_IRQ_MSIβ Allow trying MSI vector allocations. Still cute, still valid. πPCI_IRQ_INTXβ Allow trying INTx interrupts, if and only ifmin_vecs == 1. This is the legacy one and it's lowkey picky. πPCI_IRQ_AFFINITYβ Auto-manage IRQs affinity by spreading the vectors around available CPUs. It's giving "work smarter not harder" energy. π§
Allocate up to max_vecs interrupt vectors on device. MSI-X irq vector allocation has a higher precedence over plain MSI, which has a higher precedence over legacy INTx emulation. So like, MSI-X > MSI > INTx, no cap. π
Upon a successful allocation, the caller should use pci_irq_vector to get the Linux IRQ number to be passed to request_threaded_irq. The driver must call pci_free_irq_vectors on cleanup. Don't forget the cleanup, bestie, that's not slay behavior. π§Ήβ¨
π RETURN π
number of allocated vectors (which might be smaller than max_vecs), -ENOSPC if less than min_vecs interrupt vectors are available, other errnos otherwise.
So like, you might not get all the vectors you wanted, and that's okay. But if you get less than your minimum? -ENOSPC, which is the "no space" error. And other random errnos can happen too. It's a whole vibe check. π
πΈ SEE ALSO πΈ
Kernel file ./drivers/pci/msi/api.c 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_alloc_irq_at(9), pci_msix_free_irq(9), pci_disable_msix(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)
Okay that's the vibe! The source is ./drivers/pci/msi, dated October 2026, and it's all about pci_alloc_irq_vectors(9). Periodt. πβ¨
π¦ 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