History

PCI/MSI: Support allocating virtual MSI interrupts

For NTB devices, we want to be able to trigger MSI interrupts through a memory window. In these cases we may want to use more interrupts than the NTB PCI device has available in its MSI-X table. We allow for this by creating a new 'virtual' interrupt. These interrupts are allocated as usual but are not programmed into the MSI-X table (as there may not be space for them). The MSI address and data will then handled through an NTB MSI library introduced later in this series.

Logan Gunthorpe committed 7 years ago

Commit d7cc6091 parent a944ccc3 files · +62 −9Browse files

Showing the changes to include/linux (2 of 3 files). Show all

Unified · Split

2 files
  1. include/linux/msi.h +8 −0
  2. include/linux/pci.h +9 −0
include/linux/msi.h+8−0
@@ -64,6 +64,10 @@ struct ti_sci_inta_msi_desc { · 63 unmodified lines
64 * @msg: The last set MSI message cached for reuse64 * @msg: The last set MSI message cached for reuse
65 * @affinity: Optional pointer to a cpu affinity mask for this descriptor65 * @affinity: Optional pointer to a cpu affinity mask for this descriptor
66 *66 *
67 * @write_msi_msg: Callback that may be called when the MSI message
68 * address or data changes
69 * @write_msi_msg_data: Data parameter for the callback.
70 *
67 * @masked: [PCI MSI/X] Mask bits71 * @masked: [PCI MSI/X] Mask bits
68 * @is_msix: [PCI MSI/X] True if MSI-X72 * @is_msix: [PCI MSI/X] True if MSI-X
69 * @multiple: [PCI MSI/X] log2 num of messages allocated73 * @multiple: [PCI MSI/X] log2 num of messages allocated
@@ -90,6 +94,9 @@ struct msi_desc { · 20 unmodified lines
90 const void *iommu_cookie;94 const void *iommu_cookie;
91#endif95#endif
92 96
97 void (*write_msi_msg)(struct msi_desc *entry, void *data);
98 void *write_msi_msg_data;
99
93 union {100 union {
94 /* PCI MSI/X specific data */101 /* PCI MSI/X specific data */
95 struct {102 struct {
@@ -100,6 +107,7 @@ struct msi_desc { · 4 unmodified lines
100 u8 multi_cap : 3;107 u8 multi_cap : 3;
101 u8 maskbit : 1;108 u8 maskbit : 1;
102 u8 is_64 : 1;109 u8 is_64 : 1;
110 u8 is_virtual : 1;
103 u16 entry_nr;111 u16 entry_nr;
104 unsigned default_irq;112 unsigned default_irq;
105 } msi_attrib;113 } msi_attrib;
include/linux/pci.h+9−0
@@ -1362,6 +1362,15 @@ int pci_set_vga_state(struct pci_dev *pdev, bool decode, · 1361 unmodified lines
1362#define PCI_IRQ_MSI (1 << 1) /* Allow MSI interrupts */1362#define PCI_IRQ_MSI (1 << 1) /* Allow MSI interrupts */
1363#define PCI_IRQ_MSIX (1 << 2) /* Allow MSI-X interrupts */1363#define PCI_IRQ_MSIX (1 << 2) /* Allow MSI-X interrupts */
1364#define PCI_IRQ_AFFINITY (1 << 3) /* Auto-assign affinity */1364#define PCI_IRQ_AFFINITY (1 << 3) /* Auto-assign affinity */
1365
1366/*
1367 * Virtual interrupts allow for more interrupts to be allocated
1368 * than the device has interrupts for. These are not programmed
1369 * into the device's MSI-X table and must be handled by some
1370 * other driver means.
1371 */
1372#define PCI_IRQ_VIRTUAL (1 << 4)
1373
1365#define PCI_IRQ_ALL_TYPES \1374#define PCI_IRQ_ALL_TYPES \
1366 (PCI_IRQ_LEGACY | PCI_IRQ_MSI | PCI_IRQ_MSIX)1375 (PCI_IRQ_LEGACY | PCI_IRQ_MSI | PCI_IRQ_MSIX)
1367 1376

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t