[pci] Map all MSI-X interrupts to a dummy target address by default

Interrupts as such are not used in iPXE, which operates in polling
mode.  However, some network cards (such as the Intel 40GbE and 100GbE
NICs) will defer writing out completions until the point of asserting
an MSI-X interrupt.

From the point of view of the PCI device, asserting an MSI-X interrupt
is just a 32-bit DMA write of an opaque value to an opaque target
address.  The PCI device has no know to know whether or not the target
address corresponds to a real APIC.

We can therefore trick the PCI device into believing that it is
asserting an MSI-X interrupt, by configuring it to write an opaque
32-bit value to a dummy target address in host memory.  This is
sufficient to trigger the associated write of the completions to host
memory.

Allocate a dummy target address when enabling MSI-X on a PCI device,
and map all interrupts to this target address by default.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-10-09 16:01:51 +01:00
parent ce30ba14fc
commit 4224f574da
2 changed files with 56 additions and 0 deletions

View File

@@ -40,6 +40,10 @@ struct pci_msix {
void *table;
/** Pending bit array */
void *pba;
/** Dummy message target */
uint32_t *msg;
/** Dummy message target mapping */
struct dma_mapping map;
};
extern int pci_msix_enable ( struct pci_device *pci, struct pci_msix *msix );