Author: marius
Date: Wed Oct 30 21:49:34 2019
New Revision: 354209
URL: https://svnweb.freebsd.org/changeset/base/354209

Log:
  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.

Modified:
  stable/10/sys/dev/e1000/if_em.c

Modified: stable/10/sys/dev/e1000/if_em.c
==============================================================================
--- stable/10/sys/dev/e1000/if_em.c     Wed Oct 30 21:48:43 2019        
(r354208)
+++ stable/10/sys/dev/e1000/if_em.c     Wed Oct 30 21:49:34 2019        
(r354209)
@@ -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);
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to