Theo and I predicted this would happen. When Windows would start
using message signalled interrupts (MSIs), support for APIC interrupts
in BIOSen for new machines would get broken. On a HP Pavillion
Sleekbook 15 I have here the ACPI tables claim the network controller
is connected to pin 16 on the APIC, but in reality it is connected to
pin 17. Funnily enough the BIOS also defines a table with the right
mappings, but nothing is referencing that table. Telltale signs of
shoddy engineering and a total lack of quality control. OK, this was
pretty much the cheapest laptop I could find last June.
Anyway, I expect to see more and more issues like these as time goes
by. The solution is to be more aggressive with using MSIs in our
drivers. So here is a diff that switches re(4) over to use MSIs on
the RTL8101E "fast" Ethernet variants. These chips are fairly new so
there isn't a gazillion different variants of them, so it's very
likely that MSI will work on all of them. We can take a look at the
other variants later.
ok?
Index: if_re_pci.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_re_pci.c,v
retrieving revision 1.37
diff -u -p -r1.37 if_re_pci.c
--- if_re_pci.c 16 Jan 2013 04:42:44 -0000 1.37
+++ if_re_pci.c 3 Aug 2013 11:52:31 -0000
@@ -136,6 +136,11 @@ re_pci_attach(struct device *parent, str
pci_intr_handle_t ih;
const char *intrstr = NULL;
+ /* Only enable MSI on RT8101E for now. */
+ if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_REALTEK ||
+ PCI_PRODUCT(pa->pa_id) != PCI_PRODUCT_REALTEK_RT8101E)
+ pa->pa_flags &= ~PCI_FLAGS_MSI_ENABLED;
+
pci_set_powerstate(pa->pa_pc, pa->pa_tag, PCI_PMCSR_STATE_D0);
#ifndef SMALL_KERNEL
@@ -156,7 +161,7 @@ re_pci_attach(struct device *parent, str
}
/* Allocate interrupt */
- if (pci_intr_map(pa, &ih)) {
+ if (pci_intr_map_msi(pa, &ih) != 0 && pci_intr_map(pa, &ih) != 0) {
printf(": couldn't map interrupt\n");
return;
}