From 56817577a6dbe4a5800b1257d9bc9797c04a64cb Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Wed, 24 May 2017 14:30:37 +0800 Subject: [PATCH] em: Enable MSI by default on devices has PCI advanced features capability. Some versions of I219 does not PCI express capability, but only PCI advanced features capability. Dragonfly-bug: http://bugs.dragonflybsd.org/issues/3038 --- sys/dev/netif/em/if_em.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/dev/netif/em/if_em.c b/sys/dev/netif/em/if_em.c index 6c5a755d94..71105f8781 100644 --- a/sys/dev/netif/em/if_em.c +++ b/sys/dev/netif/em/if_em.c @@ -2264,7 +2264,7 @@ em_alloc_pci_res(struct adapter *adapter) { device_t dev = adapter->dev; u_int intr_flags; - int val, rid, msi_enable; + int val, rid, msi_enable, cap; /* Enable bus mastering */ pci_enable_busmaster(dev); @@ -2327,10 +2327,13 @@ em_alloc_pci_res(struct adapter *adapter) * * Don't enable MSI on 82571/82572, see: * 82571/82572 specification update errata #63 + * + * Some versions of I219 only have PCI AF. */ msi_enable = em_msi_enable; if (msi_enable && - (!pci_is_pcie(dev) || + (!(pci_is_pcie(dev) || + pci_find_extcap(dev, PCIY_PCIAF, &cap) == 0) || adapter->hw.mac.type == e1000_82571 || adapter->hw.mac.type == e1000_82572)) msi_enable = 0; -- 2.11.4.GIT