Message ID | 20211126224100.303046749@linutronix.de (mailing list archive) |
---|---|
Headers | show |
Series | genirq/msi, PCI/MSI: Spring cleaning - Part 2 | expand |
On Sat, Nov 27, 2021 at 02:20:06AM +0100, Thomas Gleixner wrote: > This is the second part of [PCI]MSI refactoring which aims to provide the > ability of expanding MSI-X vectors after enabling MSI-X. > > The first part of this work can be found here: > > https://lore.kernel.org/r/20211126222700.862407977@linutronix.de > > This second part has the following important changes: > > 1) Cleanup of the MSI related data in struct device > > struct device contains at the moment various MSI related parts. Some > of them (the irq domain pointer) cannot be moved out, but the rest > can be allocated on first use. This is in preparation of adding more > per device MSI data later on. > > 2) Consolidation of sysfs handling > > As a first step this moves the sysfs pointer from struct msi_desc > into the new per device MSI data structure where it belongs. > > Later changes will cleanup this code further, but that's not possible > at this point. > > 3) Store per device properties in the per device MSI data to avoid > looking up MSI descriptors and analysing their data. Cleanup all > related use cases. > > 4) Provide a function to retrieve the Linux interrupt number for a given > MSI index similar to pci_irq_vector() and cleanup all open coded > variants. > > This second series is based on: > > git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git msi-v1-part-1 > > and also available from git: > > git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git msi-v1-part-2 > Instead of responding to each individual patch, I've read them all, thanks for the cleanups, look good to me: Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
On Sat, Nov 27, 2021 at 02:21:17AM +0100, Thomas Gleixner wrote: > This is the second part of [PCI]MSI refactoring which aims to provide the > ability of expanding MSI-X vectors after enabling MSI-X. > > The first part of this work can be found here: > > https://lore.kernel.org/r/20211126222700.862407977@linutronix.de > > This second part has the following important changes: > > 1) Cleanup of the MSI related data in struct device > > struct device contains at the moment various MSI related parts. Some > of them (the irq domain pointer) cannot be moved out, but the rest > can be allocated on first use. This is in preparation of adding more > per device MSI data later on. > > 2) Consolidation of sysfs handling > > As a first step this moves the sysfs pointer from struct msi_desc > into the new per device MSI data structure where it belongs. > > Later changes will cleanup this code further, but that's not possible > at this point. > > 3) Store per device properties in the per device MSI data to avoid > looking up MSI descriptors and analysing their data. Cleanup all > related use cases. > > 4) Provide a function to retrieve the Linux interrupt number for a given > MSI index similar to pci_irq_vector() and cleanup all open coded > variants. The msi_get_virq() sure does make a big difference.. Though it does highlight there is some asymmetry with how platform and PCI works here where PCI fills some 'struct msix_entry *'. Many drivers would be quite happy to just call msi_get_virq() and avoid the extra memory, so I think the msi_get_virq() version is good. Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Thanks, Jason
On Sat, Nov 27 2021 at 20:39, Jason Gunthorpe wrote: > On Sat, Nov 27, 2021 at 02:21:17AM +0100, Thomas Gleixner wrote: >> 4) Provide a function to retrieve the Linux interrupt number for a given >> MSI index similar to pci_irq_vector() and cleanup all open coded >> variants. > > The msi_get_virq() sure does make a big difference.. Though it does > highlight there is some asymmetry with how platform and PCI works here > where PCI fills some 'struct msix_entry *'. Many drivers would be > quite happy to just call msi_get_virq() and avoid the extra memory, so > I think the msi_get_virq() version is good. struct msix_entry should just go away. 90+% of the use cases fill it with a linear index range 0...N and then use the virq entry for request_irq(). So they can just use pci_alloc_irs_vectors_affinity() and retrieve the interrupt number via pci_irq_vector(). The few drivers which actually use it to allocate a sparse populated MSI index, e.g. 0, 12, 14 can be converted over to alloc vector 0 and then use the dynamic extenstion for the rest. Thanks, tglx