powerpc64/powernv: Don't mask MSIs in OPAL

Summary:
Discussing with Benjamin Herrenschmidt, MSIs, and edge-triggered
interrupts in general, must not be masked in XICS and XIVE, else
subsequent interrupts may be ignored.

Testing locally on my Talos II (single CPU, 18-core POWER9), NVMe now
works with MSI, improving read throughput by ~70% (900MB/s -> 1.67GB/s,
with 64MB block size) over INTx interrupts, and snd_hda(4) now will
actually play music with MSI.  Previously, snd_hda(4) would not receive
interrupts, timing out, and declaring the channels dead.

This has also been tested by Kevin Bowling, and others, with great
success.  Kevin reported NVMe unusable on his Talos II prior to this
patch.

Reviewed by:	nwhitehorn, kbowling
Approved by:	re(rgrimes)
Differential Revision: https://reviews.freebsd.org/D17356
This commit is contained in:
Justin Hibbits 2018-10-06 03:20:26 +00:00
parent 08b4333399
commit 013cc176c9

View File

@ -95,8 +95,6 @@ static int opalpci_route_interrupt(device_t bus, device_t dev, int pin);
*/
static void opalpic_pic_enable(device_t dev, u_int irq, u_int vector);
static void opalpic_pic_eoi(device_t dev, u_int irq);
static void opalpic_pic_mask(device_t dev, u_int irq);
static void opalpic_pic_unmask(device_t dev, u_int irq);
/*
* Commands
@ -143,8 +141,6 @@ static device_method_t opalpci_methods[] = {
/* PIC interface for MSIs */
DEVMETHOD(pic_enable, opalpic_pic_enable),
DEVMETHOD(pic_eoi, opalpic_pic_eoi),
DEVMETHOD(pic_mask, opalpic_pic_mask),
DEVMETHOD(pic_unmask, opalpic_pic_unmask),
DEVMETHOD_END
};
@ -650,7 +646,10 @@ opalpci_map_msi(device_t dev, device_t child, int irq, uint64_t *addr,
static void
opalpic_pic_enable(device_t dev, u_int irq, u_int vector)
{
struct opalpci_softc *sc = device_get_softc(dev);
PIC_ENABLE(root_pic, irq, vector);
opal_call(OPAL_PCI_MSI_EOI, sc->phb_id, irq);
}
static void opalpic_pic_eoi(device_t dev, u_int irq)
@ -662,21 +661,3 @@ static void opalpic_pic_eoi(device_t dev, u_int irq)
PIC_EOI(root_pic, irq);
}
static void opalpic_pic_mask(device_t dev, u_int irq)
{
PIC_MASK(root_pic, irq);
}
static void opalpic_pic_unmask(device_t dev, u_int irq)
{
struct opalpci_softc *sc;
sc = device_get_softc(dev);
PIC_UNMASK(root_pic, irq);
opal_call(OPAL_PCI_MSI_EOI, sc->phb_id, irq);
}