Re: [PATCH v17 net-next 07/11] net/nebula-matrix: add intr resource implementation
From: Paolo Abeni
Date: Thu Jun 04 2026 - 06:39:33 EST
On 6/1/26 11:31 AM, illusion.wang wrote:
> This patch adds the nbl_interrupt module for management of driver-private
> MSI-X indices, plus hw_ops callbacks to program the function MSI-X mapping
> registers, configure MSI-X info, and enable mailbox interrupts.
>
> Key interfaces:
> - configure_msix_map: Allocates driver-private global MSI-X indices
> (interrupt_net_bitmap / interrupt_others_bitmap)
> and programs the hardware MSI-X mapping registers
> (NBL_PCOMPLETER_FUNCTION_MSIX_MAP).
> The actual PCI MSI-X vector allocation is done
> by nbl_dev_alloc_msix_intr().
> - destroy_msix_map: Releases MSI-X indices and tears down the mapping.
> - set_mailbox_irq: Enables/disables a specific mailbox interrupt.
> - configure_msix_info: Programs PADPT_HOST_MSIX_INFO and
> PCOMPLETER_HOST_MSIX_FID_TABLE.
>
> The patch does not use kernel MSI-X allocation primitives
> (pci_alloc_irq_vectors, pci_msix_alloc_irq_at, irq_domain). It manages
> a driver-private global index space and programs vendor-specific
> MSI-X mapping registers.
>
> Note: Mutual exclusion for configure_msix_map, destroy_msix_map, and
> enable_mailbox_irq is handled by the dispatch layer; these functions
> assume the caller already holds the necessary lock.
Adding assertion based on mutex_is_locked() would make the above obvious
and will prevent locking issues.
/P