svn commit: r354208 - stable/11/sys/dev/e1000

Marius Strobl marius at FreeBSD.org
Wed Oct 30 21:48:44 UTC 2019


Author: marius
Date: Wed Oct 30 21:48:43 2019
New Revision: 354208
URL: https://svnweb.freebsd.org/changeset/base/354208

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/11/sys/dev/e1000/if_em.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/e1000/if_em.c
==============================================================================
--- stable/11/sys/dev/e1000/if_em.c	Wed Oct 30 20:45:12 2019	(r354207)
+++ stable/11/sys/dev/e1000/if_em.c	Wed Oct 30 21:48:43 2019	(r354208)
@@ -1760,6 +1760,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;
 	if_t ifp = adapter->ifp;
 
@@ -1770,8 +1771,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);


More information about the svn-src-all mailing list