Skip to content

genirq/msi, PCI/MSI: Support for dynamic MSI-X vector expansion - Part 4

Thomas Gleixner linux-pci lkml xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10genirq/msi: Add range argument to alloc/free MSI domain opsarch/powerpc/platforms/pseries/msi.c arch/x86/pci/xen.c include/linux/msi.h +1 more+37 -210 replies
2/10genirq/msi: Add range argument to msi_domain_alloc/free_descs_locked()drivers/pci/msi/irqdomain.c include/linux/msi.h kernel/irq/msi.c+18 -140 replies
3/10genirq/msi: Make MSI descriptor alloc/free ready for range allocationsdrivers/base/platform-msi.c include/linux/msi.h kernel/irq/msi.c+25 -233 replies
4/10genirq/msi: Prepare MSI domain alloc/free for range irq allocationkernel/irq/msi.c+10 -20 replies
5/10genirq/msi: Add domain info flag MSI_FLAG_CAN_EXPANDinclude/linux/msi.h+2 -00 replies
6/10PCI/MSI: Use range in allocation pathdrivers/pci/msi/irqdomain.c drivers/pci/msi/msi.c drivers/pci/msi/msi.h+25 -180 replies
7/10PCI/MSI: Make free related functions range baseddrivers/pci/msi/irqdomain.c drivers/pci/msi/msi.c drivers/pci/msi/msi.h+19 -120 replies
8/10PCI/MSI: Provide pci_msi_domain_supports_expand()drivers/pci/msi/irqdomain.c include/linux/msi.h+25 -60 replies
9/10PCI/MSI: Provide pci_msix_expand_vectors[_at]()drivers/pci/msi/msi.c include/linux/pci.h+54 -06 replies
10/10x86/apic/msi: Support MSI-X vector expansionarch/x86/kernel/apic/msi.c+2 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [patch 00/10] genirq/msi, PCI/MSI: Support for dynamic MSI-X vector expansion - Part 4

This is finally the point where dynamically expanding MSI-X vectors after enabling MSI-X is implemented.

The first three parts of this work can be found here:

    https://lore.kernel.org/r/[email protected]
    https://lore.kernel.org/r/[email protected]
    https://lore.kernel.org/r/[email protected]

This last and smallest part of the overall series contains the following changes:

1) Prepare the core MSI irq domain code to handle range based allocation and free

2) Prepare the PCI/MSI code to handle range based allocation and free

3) Implement a new interface which allows to expand the MSI-X vector space after initialization

4) Enable support for the X86 PCI/MSI irq domains

This is unfortunate, but some PCI/MSI irq domain implementations, e.g. powerpc and the x86/XEN irqdomain wrappers are not really ready to support this out of the box.

I looked at the 30 places which implement PCI/MSI irq domains and many of them look like they could support it out of the box, but as we have two which definitely don't, making this opt-in is the only safe option.

I've tested this by hacking up the XHCI driver and it works like a charm.

There is certainly some more room for consolidating the PCI/MSI-X usage in drivers, i.e. getting rid of pci_enable_msix*(), but this would have made this overall series even larger and is an orthogonal issue.

This fourth series is based on:

git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git msi-v1-part-3

and also available from git:

git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git msi-v1-part-4

Thanks,

tglx

---
 arch/powerpc/platforms/pseries/msi.c |    6 +-
 arch/x86/kernel/apic/msi.c           |    4 -
 arch/x86/pci/xen.c                   |   10 +--
 drivers/base/platform-msi.c          |    3 -
 drivers/pci/msi/irqdomain.c          |   39 ++++++++++----
 drivers/pci/msi/msi.c                |   97 +++++++++++++++++++++++++++--------
 drivers/pci/msi/msi.h                |    4 -
 include/linux/msi.h                  |   46 +++++++++++-----
 include/linux/pci.h                  |   13 ++++
 kernel/irq/msi.c                     |   75 +++++++++++++++------------
 10 files changed, 208 insertions(+), 89 deletions(-)