Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Oct 2019 17:16:33 +0000 (UTC)
From:      Eric Joyner <erj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r353657 - head/sys/dev/ixgbe
Message-ID:  <201910161716.x9GHGXH5068350@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: erj
Date: Wed Oct 16 17:16:32 2019
New Revision: 353657
URL: https://svnweb.freebsd.org/changeset/base/353657

Log:
  ix: report isc_pause_frames during stat update
  
  From Jake:
  Notify the iflib stack of whether we received any pause frames during
  the timer window. This allows the stack to avoid reporting a Tx hang due
  to the device being paused.
  
  Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
  
  Submitted by:	Jacob Keller <jacob.e.keller@intel.com>
  Reviewed by:	gallatin@
  Sponsored by:	Intel Corporation
  Differential Revision:	https://reviews.freebsd.org/D21869

Modified:
  head/sys/dev/ixgbe/if_ix.c

Modified: head/sys/dev/ixgbe/if_ix.c
==============================================================================
--- head/sys/dev/ixgbe/if_ix.c	Wed Oct 16 17:13:46 2019	(r353656)
+++ head/sys/dev/ixgbe/if_ix.c	Wed Oct 16 17:16:32 2019	(r353657)
@@ -1393,6 +1393,7 @@ ixgbe_update_stats_counters(struct adapter *adapter)
 	struct ixgbe_hw       *hw = &adapter->hw;
 	struct ixgbe_hw_stats *stats = &adapter->stats.pf;
 	u32                   missed_rx = 0, bprc, lxon, lxoff, total;
+	u32                   lxoffrxc;
 	u64                   total_missed_rx = 0;
 
 	stats->crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS);
@@ -1422,15 +1423,24 @@ ixgbe_update_stats_counters(struct adapter *adapter)
 		stats->tor += IXGBE_READ_REG(hw, IXGBE_TORL) +
 		    ((u64)IXGBE_READ_REG(hw, IXGBE_TORH) << 32);
 		stats->lxonrxc += IXGBE_READ_REG(hw, IXGBE_LXONRXCNT);
-		stats->lxoffrxc += IXGBE_READ_REG(hw, IXGBE_LXOFFRXCNT);
+		lxoffrxc = IXGBE_READ_REG(hw, IXGBE_LXOFFRXCNT);
+		stats->lxoffrxc += lxoffrxc;
 	} else {
 		stats->lxonrxc += IXGBE_READ_REG(hw, IXGBE_LXONRXC);
-		stats->lxoffrxc += IXGBE_READ_REG(hw, IXGBE_LXOFFRXC);
+		lxoffrxc = IXGBE_READ_REG(hw, IXGBE_LXOFFRXC);
+		stats->lxoffrxc += lxoffrxc;
 		/* 82598 only has a counter in the high register */
 		stats->gorc += IXGBE_READ_REG(hw, IXGBE_GORCH);
 		stats->gotc += IXGBE_READ_REG(hw, IXGBE_GOTCH);
 		stats->tor += IXGBE_READ_REG(hw, IXGBE_TORH);
 	}
+
+	/*
+	 * For watchdog management we need to know if we have been paused
+	 * during the last interval, so capture that here.
+	*/
+	if (lxoffrxc)
+		adapter->shared->isc_pause_frames = 1;
 
 	/*
 	 * Workaround: mprc hardware is incorrectly counting



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910161716.x9GHGXH5068350>