vfio/pci: Prepare for dynamic interrupt context storage
authorReinette Chatre <reinette.chatre@intel.com>
Thu, 11 May 2023 15:44:30 +0000 (08:44 -0700)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 23 May 2023 21:49:03 +0000 (15:49 -0600)
commitd977e0f7663961368f6442589e52d27484c2f5c2
tree4d34624267c3b996a4e245d82c37f0f519b0fe93
parent6578ed85c7d63693669bfede01e0237d0e24211a
vfio/pci: Prepare for dynamic interrupt context storage

Interrupt context storage is statically allocated at the time
interrupts are allocated. Following allocation, the interrupt
context is managed by directly accessing the elements of the
array using the vector as index.

It is possible to allocate additional MSI-X vectors after
MSI-X has been enabled. Dynamic storage of interrupt context
is needed to support adding new MSI-X vectors after initial
allocation.

Replace direct access of array elements with pointers to the
array elements. Doing so reduces impact of moving to a new data
structure. Move interactions with the array to helpers to
mostly contain changes needed to transition to a dynamic
data structure.

No functional change intended.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/eab289693c8325ede9aba99380f8b8d5143980a4.1683740667.git.reinette.chatre@intel.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/pci/vfio_pci_intrs.c