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
6464 * @msg: The last set MSI message cached for reuse
6565 * @affinity: Optional pointer to a cpu affinity mask for this descriptor
6666 *
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+ *
6771 * @masked: [PCI MSI/X] Mask bits
6872 * @is_msix: [PCI MSI/X] True if MSI-X
6973 * @multiple: [PCI MSI/X] log2 num of messages allocated
@@ -90,6 +94,9 @@ struct msi_desc { · 20 unmodified lines
9094 const void *iommu_cookie;
9195 #endif
9296
97+ void (*write_msi_msg)(struct msi_desc *entry, void *data);
98+ void *write_msi_msg_data;
99+
93100 union {
94101 /* PCI MSI/X specific data */
95102 struct {
@@ -100,6 +107,7 @@ struct msi_desc { · 4 unmodified lines
100107 u8 multi_cap : 3;
101108 u8 maskbit : 1;
102109 u8 is_64 : 1;
110+ u8 is_virtual : 1;
103111 u16 entry_nr;
104112 unsigned default_irq;
105113 } 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
13621362 #define PCI_IRQ_MSI (1 << 1) /* Allow MSI interrupts */
13631363 #define PCI_IRQ_MSIX (1 << 2) /* Allow MSI-X interrupts */
13641364 #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+
13651374 #define PCI_IRQ_ALL_TYPES \
13661375 (PCI_IRQ_LEGACY | PCI_IRQ_MSI | PCI_IRQ_MSIX)
13671376

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