Skip to contentSkip to conversation

PCI: Mark broken INTx masking for Mellanox devices

PATCH Superseded Gavin Shan 2 participants 3 messages Aug 1, 2014 PCI

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Gavin Shan

author
#0 lore raw

PATCH 1/1 PCI: Mark broken INTx masking for Mellanox devices

The VFIO driver is routing LSI interrupts by capturing, masking, and then delivering. When passing though Mallanox adapters from host to guest, interrupt storm was reported from host and guest. That's because we can't mask the LSI interrupt with help of PCI command register.

The patch marks broken INTx masking for Mellanox devices so that the VFIO driver will always mask the interrupt from interrupt controller side to avoid interrupt storm.

---
 drivers/pci/quirks.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/pci/quirks.c +4 -0
index d0f6926..8c2b96f 100644
@@ -2977,6 +2977,10 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CHELSIO, 0x0030,
 			 quirk_broken_intx_masking);
 DECLARE_PCI_FIXUP_HEADER(0x1814, 0x0601, /* Ralink RT2800 802.11n PCI */
 			 quirk_broken_intx_masking);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MELLANOX, 0x1003,
+			 quirk_broken_intx_masking);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MELLANOX, 0x6750,
+			 quirk_broken_intx_masking);
 /*
  * Realtek RTL8169 PCI Gigabit Ethernet Controller (rev 10)
  * Subsystem: Realtek RTL8169/8110 Family PCI Gigabit Ethernet NIC
Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 21 lines · Gavin Shan

The VFIO driver is routing LSI interrupts by capturing, masking, and then delivering. When passing though Mallanox adapters from host to guest, interrupt storm was reported from host and guest. That's because we can't mask the LSI interrupt with help of PCI command register.

The patch marks broken INTx masking for Mellanox devices so that the VFIO driver will always mask the interrupt from interrupt controller side to avoid interrupt storm.

---
 drivers/pci/quirks.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/pci/quirks.c +0 -0
index d0f6926..8c2b96f 100644

drivers/pci/quirks.c DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CHELSIO, 0x0030, · line 2986

Quoted 10 lines
drivers/pci/quirks.c +4 -0
@@ -2977,6 +2977,10 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CHELSIO, 0x0030,
 			 quirk_broken_intx_masking);
 DECLARE_PCI_FIXUP_HEADER(0x1814, 0x0601, /* Ralink RT2800 802.11n PCI */
 			 quirk_broken_intx_masking);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MELLANOX, 0x1003,
+			 quirk_broken_intx_masking);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MELLANOX, 0x6750,
+			 quirk_broken_intx_masking);
 /*
  * Realtek RTL8169 PCI Gigabit Ethernet Controller (rev 10)
  * Subsystem: Realtek RTL8169/8110 Family PCI Gigabit Ethernet NIC

Is there an lspci description for the devices that we can also include? You might also want to cc the driver maintainers to see if they're aware or have any comments. Thanks,

Alex

author
#2 lore raw
Quoted 28 lines · Alex Williamson
Quoted 27 lines · Gavin Shan

The VFIO driver is routing LSI interrupts by capturing, masking, and then delivering. When passing though Mallanox adapters from host to guest, interrupt storm was reported from host and guest. That's because we can't mask the LSI interrupt with help of PCI command register.

The patch marks broken INTx masking for Mellanox devices so that the VFIO driver will always mask the interrupt from interrupt controller side to avoid interrupt storm.

---
 drivers/pci/quirks.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/pci/quirks.c +3 -0
index d0f6926..8c2b96f 100644
@@ -2977,6 +2977,10 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CHELSIO, 0x0030,
 			 quirk_broken_intx_masking);
 DECLARE_PCI_FIXUP_HEADER(0x1814, 0x0601, /* Ralink RT2800 802.11n PCI */
 			 quirk_broken_intx_masking);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MELLANOX, 0x1003,
+			 quirk_broken_intx_masking);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MELLANOX, 0x6750,
Quoted 9 lines

drivers/pci/quirks.c DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CHELSIO, 0x0030, · line 2986

Quoted 4 lines
drivers/pci/quirks.c +1 -0
+			 quirk_broken_intx_masking);
 /*
  * Realtek RTL8169 PCI Gigabit Ethernet Controller (rev 10)
  * Subsystem: Realtek RTL8169/8110 Family PCI Gigabit Ethernet NIC

Is there an lspci description for the devices that we can also include? You might also want to cc the driver maintainers to see if they're aware or have any comments. Thanks,

Yes, I'll include that in next revision and cc driver's maintainer.

Thanks,
Gavin