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
This commit is contained in:
erj 2019-10-16 17:16:32 +00:00
parent fe09f9c176
commit 9da68e5236

View File

@ -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,16 +1423,25 @@ 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
* broadcasts, so for now we subtract those.