PCI: Mark broken INTx masking for Mellanox devices
PATCH v2 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.
[root@ncc-1701 ~]# lspci | grep Mellanox
0001:05:00.0 Ethernet controller: Mellanox Technologies MT27500 \
Family [ConnectX-3]
0005:01:00.0 Ethernet controller: Mellanox Technologies MT26448 \
[ConnectX EN 10GigE, PCIe 2.0 5GT/s] (rev b0)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
@@ -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
Quoted 5 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.
Hi Gavin,
What is the problem with masking the interrupts with the PCI command register? I'm asking because I want to understand in which devices we have the problem, and if it could be fixed by firmware guys. What are the implications of having the quirk?
Quoted 23 lines
[root@ncc-1701 ~]# lspci | grep Mellanox
0001:05:00.0 Ethernet controller: Mellanox Technologies MT27500 \
Family [ConnectX-3]0005:01:00.0 Ethernet controller: Mellanox Technologies MT26448 \ [ConnectX EN 10GigE, PCIe 2.0 5GT/s] (rev b0)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.
Cc Amir Vadai <[email protected]>Suggested-by Benjamin Herrenschmidt <[email protected]>Signed-off-by Gavin Shan <[email protected]>--- drivers/pci/quirks.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/pci/quirks.c +0
-0
drivers/pci/quirks.c DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CHELSIO, 0x0030, · line 2983
Quoted 7 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);
I still don't understand what exactly is the problem, but I assume that there are other Mellanox devices that suffer from it.
drivers/pci/quirks.c DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CHELSIO, 0x0030, · line 2986
Quoted 4 lines
drivers/pci/quirks.c +0
-0/* * Realtek RTL8169 PCI Gigabit Ethernet Controller (rev 10) * Subsystem: Realtek RTL8169/8110 Family PCI Gigabit Ethernet NIC
Thanks,
Amir
Quoted 6 lines · Amir Vadai
Quoted 5 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.
Quoted 7 lines
Hi Gavin,
What is the problem with masking the interrupts with the PCI command register? I'm asking because I want to understand in which devices we have the problem, and if it could be fixed by firmware guys. What are the implications of having the quirk?
The way to mask the interrupt through PCI command register isn't taking effect on IBM power platform. So we have to have the quirk so that the interrupt could be masked from interrupt controller side with function disable_irq_nosync().
If the interrupt can't be masked properly, we detect interrupt storm reported from host/guest when passing through those devices via VFIO without suprise.
Quoted 18 lines
Quoted 18 lines
[root@ncc-1701 ~]# lspci | grep Mellanox
0001:05:00.0 Ethernet controller: Mellanox Technologies MT27500 \
Family [ConnectX-3]0005:01:00.0 Ethernet controller: Mellanox Technologies MT26448 \ [ConnectX EN 10GigE, PCIe 2.0 5GT/s] (rev b0)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.
Cc Amir Vadai <[email protected]>Suggested-by Benjamin Herrenschmidt <[email protected]>Signed-off-by Gavin Shan <[email protected]>--- drivers/pci/quirks.c | 4 ++++ 1 file changed, 4 insertions(+)
Quoted 15 lines
drivers/pci/quirks.c DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CHELSIO, 0x0030, · line 2983
Quoted 12 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);I still don't understand what exactly is the problem, but I assume that there are other Mellanox devices that suffer from it.
Yeah, that's possible. I didn't have chance to test other Mellanox devices except the above two.
Quoted 8 lines
drivers/pci/quirks.c DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CHELSIO, 0x0030, · line 2986
Quoted 4 lines
drivers/pci/quirks.c +0
-0/* * Realtek RTL8169 PCI Gigabit Ethernet Controller (rev 10) * Subsystem: Realtek RTL8169/8110 Family PCI Gigabit Ethernet NIC Thanks,
Amir
Thanks,
Gavin
Quoted 10 lines
Quoted 6 lines
What is the problem with masking the interrupts with the PCI command register? I'm asking because I want to understand in which devices we have the problem, and if it could be fixed by firmware guys. What are the implications of having the quirk?
The way to mask the interrupt through PCI command register isn't taking effect on IBM power platform. So we have to have the >quirk so that the interrupt could be masked from interrupt controller side with function
disable_irq_nosync().If the interrupt can't be masked properly, we detect interrupt storm reported from host/guest when passing through those devices >via VFIO without suprise.
Hi Gavin,
Does it have any effect on performance. Also, can you tell in which cases interrupts need to be masked?
Quoted 7 lines · Eli Cohen
Quoted 6 lines
Quoted 6 lines
What is the problem with masking the interrupts with the PCI command register? I'm asking because I want to understand in which devices we have the problem, and if it could be fixed by firmware guys. What are the implications of having the quirk?
Quoted 7 lines
Quoted 3 lines
The way to mask the interrupt through PCI command register isn't taking effect on IBM power platform. So we have to have the >quirk so that the interrupt could be masked from interrupt controller side with function
disable_irq_nosync().If the interrupt can't be masked properly, we detect interrupt storm reported from host/guest when passing through those devices >via VFIO without suprise.
Hi Gavin,
Does it have any effect on performance. Also, can you tell in which cases interrupts need to be masked?
Eli, more code needed to be run for masking the LSI from interrupt controller side than from PCI command register.
I was passing through Mellanox devices from host to guest with VFIO, and I designated to use LSI in the guest side. More details could be found in drivers/vfio/pci/vfio_pci_intrs.c::vfio_intx_handler()
Thanks,
Gavin
Quoted 16 lines · Gavin Shan
Quoted 7 lines · Eli Cohen
Quoted 6 lines
Quoted 6 lines
What is the problem with masking the interrupts with the PCI command register? I'm asking because I want to understand in which devices we have the problem, and if it could be fixed by firmware guys. What are the implications of having the quirk?
Quoted 7 lines
Quoted 3 lines
The way to mask the interrupt through PCI command register isn't taking effect on IBM power platform. So we have to have the >quirk so that the interrupt could be masked from interrupt controller side with function
disable_irq_nosync().If the interrupt can't be masked properly, we detect interrupt storm reported from host/guest when passing through those devices >via VFIO without suprise.
Hi Gavin,
Does it have any effect on performance. Also, can you tell in which cases interrupts need to be masked?
Quoted 6 lines
Eli, more code needed to be run for masking the LSI from interrupt controller side than from PCI command register.
I was passing through Mellanox devices from host to guest with VFIO, and I designated to use LSI in the guest side. More details could be found in drivers/vfio/pci/vfio_pci_intrs.c::vfio_intx_handler()
INTx is relatively high overhead already for device assignment since the interrupt is level triggered and needs to be masked on the host while the guest is processing it. The more important restriction imposed by marking broken INTx masking is that the device needs an exclusive interrupt line in order to be assigned to a guest. That may be common practice on IBM power, but on x86 it can make it much harder to configure the system for this use case. Thanks,
Alex
Quoted 24 lines · Alex Williamson
Quoted 16 lines · Gavin Shan
Quoted 7 lines · Eli Cohen
Quoted 6 lines
Quoted 6 lines
What is the problem with masking the interrupts with the PCI command register? I'm asking because I want to understand in which devices we have the problem, and if it could be fixed by firmware guys. What are the implications of having the quirk?
Quoted 7 lines
Quoted 3 lines
The way to mask the interrupt through PCI command register isn't taking effect on IBM power platform. So we have to have the >quirk so that the interrupt could be masked from interrupt controller side with function
disable_irq_nosync().If the interrupt can't be masked properly, we detect interrupt storm reported from host/guest when passing through those devices >via VFIO without suprise.
Hi Gavin,
Does it have any effect on performance. Also, can you tell in which cases interrupts need to be masked?Quoted 6 lines
Eli, more code needed to be run for masking the LSI from interrupt controller side than from PCI command register.
I was passing through Mellanox devices from host to guest with VFIO, and I designated to use LSI in the guest side. More details could be found in drivers/vfio/pci/vfio_pci_intrs.c::vfio_intx_handler()
Quoted 8 lines
INTx is relatively high overhead already for device assignment since the interrupt is level triggered and needs to be masked on the host while the guest is processing it. The more important restriction imposed by marking broken INTx masking is that the device needs an exclusive interrupt line in order to be assigned to a guest. That may be common practice on IBM power, but on x86 it can make it much harder to configure the system for this use case. Thanks,
Power platform has the similar situation: Each PCI controller has 4 LSIs shared by all child devices attached to the PHB. It would be racy if one LSI is shared by 2 or more devices. So masking LSI with PCI command register is the preferred mechanism. Unfortunately, it doesn't work on those 2 Mellanox devices. With the quirk, it's workable at least.
Thanks,
Gavin
Quoted 3 lines
Alex
Quoted 34 lines · Gavin Shan
Quoted 24 lines · Alex Williamson
Quoted 16 lines · Gavin Shan
Quoted 7 lines · Eli Cohen
Quoted 6 lines
Quoted 6 lines
What is the problem with masking the interrupts with the PCI command register? I'm asking because I want to understand in which devices we have the problem, and if it could be fixed by firmware guys. What are the implications of having the quirk?
Quoted 7 lines
Quoted 3 lines
The way to mask the interrupt through PCI command register isn't taking effect on IBM power platform. So we have to have the >quirk so that the interrupt could be masked from interrupt controller side with function
disable_irq_nosync().If the interrupt can't be masked properly, we detect interrupt storm reported from host/guest when passing through those devices >via VFIO without suprise.
Hi Gavin,
Does it have any effect on performance. Also, can you tell in which cases interrupts need to be masked?Quoted 6 lines
Eli, more code needed to be run for masking the LSI from interrupt controller side than from PCI command register.
I was passing through Mellanox devices from host to guest with VFIO, and I designated to use LSI in the guest side. More details could be found in drivers/vfio/pci/vfio_pci_intrs.c::vfio_intx_handler()
Quoted 8 lines
INTx is relatively high overhead already for device assignment since the interrupt is level triggered and needs to be masked on the host while the guest is processing it. The more important restriction imposed by marking broken INTx masking is that the device needs an exclusive interrupt line in order to be assigned to a guest. That may be common practice on IBM power, but on x86 it can make it much harder to configure the system for this use case. Thanks,
Quoted 7 lines
Power platform has the similar situation: Each PCI controller has 4 LSIs shared by all child devices attached to the PHB. It would be racy if one LSI is shared by 2 or more devices. So masking LSI with PCI command register is the preferred mechanism. Unfortunately, it doesn't work on those 2 Mellanox devices. With the quirk, it's workable at least.
ping, Any more comments on this? :-)
Thanks,
Gavin
Quoted 2 lines · Gavin Shan
The VFIO driver is routing LSI interrupts by capturing, masking, and then delivering. When passing though Mallanox adapters from
one typo Mellanox
Others, looks good to me.
Quoted 43 lines
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.
[root@ncc-1701 ~]# lspci | grep Mellanox
0001:05:00.0 Ethernet controller: Mellanox Technologies MT27500 \
Family [ConnectX-3]0005:01:00.0 Ethernet controller: Mellanox Technologies MT26448 \ [ConnectX EN 10GigE, PCIe 2.0 5GT/s] (rev b0)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.
Cc Amir Vadai <[email protected]>Suggested-by Benjamin Herrenschmidt <[email protected]>Signed-off-by Gavin Shan <[email protected]>---
drivers/pci/quirks.c| 4 ++++1 file changed, 4 insertions(+)drivers/pci/quirks.c +0
-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);drivers/pci/quirks.c +4
-0+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 NICSignature · 6 lines
1.8.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Richard Yang Help you, Help me
Quoted 8 lines · Wei Yang
Quoted 2 lines · Gavin Shan
The VFIO driver is routing LSI interrupts by capturing, masking, and then delivering. When passing though Mallanox adapters from
one typo Mellanox
Others, looks good to me.
Thanks, Richard. I'll correct it in next revision. However, I'm still waiting for comments or ACK from Alex/Eli/Amir.
Thanks,
Gavin
Quoted 47 lines
Quoted 43 lines
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.
[root@ncc-1701 ~]# lspci | grep Mellanox
0001:05:00.0 Ethernet controller: Mellanox Technologies MT27500 \
Family [ConnectX-3]0005:01:00.0 Ethernet controller: Mellanox Technologies MT26448 \ [ConnectX EN 10GigE, PCIe 2.0 5GT/s] (rev b0)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.
Cc Amir Vadai <[email protected]>Suggested-by Benjamin Herrenschmidt <[email protected]>Signed-off-by Gavin Shan <[email protected]>---
drivers/pci/quirks.c| 4 ++++1 file changed, 4 insertions(+)drivers/pci/quirks.c +0
-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);drivers/pci/quirks.c +4
-0+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 NICSignature · 6 lines
1.8.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.htmlSignature · 2 lines
Richard Yang Help you, Help me
Quoted 7 lines · Gavin Shan
Quoted 6 lines · Wei Yang
Quoted 6 lines · Gavin Shan
Quoted 2 lines
Quoted 2 lines
The VFIO driver is routing LSI interrupts by capturing, masking, and then delivering. When passing though Mallanox adapters from
one typo Mellanox
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Others, looks good to me.
Thanks, Richard. I'll correct it in next revision. However, I'm still waiting for comments or ACK from Alex/Eli/Amir.
Thanks,
Gavin
Hi Gavin,
Sorry for the delay - wanted to understand the exact limitations with our Hardware/Firmware guys.
Please change the device to PCI_ANY_ID since all Mellanox devices currently need the quirk.
The issue will be fixed in the next GA firmwares.
Thanks,
Amir
Quoted 17 lines · Amir Vadai
Quoted 7 lines · Gavin Shan
Quoted 6 lines · Wei Yang
Quoted 6 lines · Gavin Shan
Quoted 2 lines
Quoted 2 lines
The VFIO driver is routing LSI interrupts by capturing, masking, and then delivering. When passing though Mallanox adapters from
one typo Mellanox
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Others, looks good to me.
Thanks, Richard. I'll correct it in next revision. However, I'm still waiting for comments or ACK from Alex/Eli/Amir.
Thanks,
Gavin
Quoted 9 lines
Hi Gavin,
Sorry for the delay - wanted to understand the exact limitations with our Hardware/Firmware guys.
Please change the device to
PCI_ANY_IDsince all Mellanox devices currently need the quirk.
The issue will be fixed in the next GA firmwares.
Amir, thanks for confirm. I'll update in next revision accordingly. Please ack next revision if possible.
Thanks,
Gavin
Quoted 3 lines
Thanks,
Amir
Quoted 2 lines · Gavin Shan
Quoted 1 line · Amir Vadai
On 8/12/2014 6:52 AM, Gavin Shan wrote:
[..]
Quoted 3 lines
Amir, thanks for confirm. I'll update in next revision accordingly. Please ack next revision if possible.
Sure.
Amir