> -----Original Message-----
> From: Michal Swiatkowski <[email protected]>
> Sent: Friday, September 11, 2026 5:49 AM
> To: [email protected]
> Cc: [email protected]; Michal Swiatkowski
> <[email protected]>; Loktionov, Aleksandr
> <[email protected]>; Zaremba, Larysa
> <[email protected]>
> Subject: [PATCH iwl-next v2 05/10] libie, idpf: move irq code to libie
> 
> Management of irqs is the same in idpf and ixd driver. Move the common
> code to separate lib to reuse it in ixd.
> 
> libie_irq keeps the allocated interrupts in an xarray split into two
> index ranges: LIBIE_IRQ_STATIC for the vectors that must exist for the
> device to be functional at all (mailbox, the minimum per default vport,
> RDMA), and LIBIE_IRQ_DYNAMIC for the rest.
> 
> libie_irq_init() allocates the static range with pci_alloc_irq_vectors()
> at probe.  When the platform supports post-enable MSI-X allocation,
> libie_irq_alloc() backs the dynamic range with pci_msix_alloc_irq_at()
> on demand, so vectors are only claimed once a vport actually needs them;
> when it does not, the whole range is allocated up front and
> LIBIE_IRQ_DYNAMIC is transparently served from the static pool.
> 
> libie_irq_reserve() hands out an index without an MSI-X vector behind it,
> for queues that are mapped to a vector but never raise an interrupt
> (the idpf NOIRQ vector used by XDP send queues).
> 
> Move getting irq slot before allocating q_vectors array. Alloc only
> q_vectors for which there is an available interrupt.
> 
> Allocating more lead to the situation where there are unused q_vector
> which can be confused.
> 
> Reviewed-by: Aleksandr Loktionov <[email protected]>
> Reviewed-by: Larysa Zaremba <[email protected]>
> Signed-off-by: Michal Swiatkowski <[email protected]>
> ---
Tested-by: Samuel Salin <[email protected]>

Reply via email to