From 12e6fd657a8b1d4f695d9030c7137e13234ffa69 Mon Sep 17 00:00:00 2001 From: marius Date: Wed, 30 Oct 2019 21:49:34 +0000 Subject: [PATCH] MFC: r353778 (partial) In em_handle_link(), only re-arm the link state change interrupt for 82574 and also only if such a device uses MSI-X, i. e. takes advantage of autoclearing. In case of INTx and MSI re-arming isn't appropriate here and setting EM_MSIX_LINK isn't either. git-svn-id: svn://svn.freebsd.org/base/stable/10@354209 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/dev/e1000/if_em.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 679b430c5..33cad5c2e 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1774,6 +1774,7 @@ static void em_handle_link(void *context, int pending) { struct adapter *adapter = context; + struct e1000_hw *hw = &adapter->hw; struct tx_ring *txr = adapter->tx_rings; struct ifnet *ifp = adapter->ifp; @@ -1784,8 +1785,8 @@ em_handle_link(void *context, int pending) callout_stop(&adapter->timer); em_update_link_status(adapter); callout_reset(&adapter->timer, hz, em_local_timer, adapter); - E1000_WRITE_REG(&adapter->hw, E1000_IMS, - EM_MSIX_LINK | E1000_IMS_LSC); + if (hw->mac.type == e1000_82574 && adapter->msix_mem != NULL) + E1000_WRITE_REG(hw, E1000_IMS, EM_MSIX_LINK | E1000_IMS_LSC); if (adapter->link_active) { for (int i = 0; i < adapter->num_queues; i++, txr++) { EM_TX_LOCK(txr); -- 2.42.0