Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/ixgbe/if_ix.c
Show First 20 Lines • Show All 1,387 Lines • ▼ Show 20 Lines | |||||
* ixgbe_update_stats_counters - Update board statistics counters. | * ixgbe_update_stats_counters - Update board statistics counters. | ||||
************************************************************************/ | ************************************************************************/ | ||||
static void | static void | ||||
ixgbe_update_stats_counters(struct adapter *adapter) | ixgbe_update_stats_counters(struct adapter *adapter) | ||||
{ | { | ||||
struct ixgbe_hw *hw = &adapter->hw; | struct ixgbe_hw *hw = &adapter->hw; | ||||
struct ixgbe_hw_stats *stats = &adapter->stats.pf; | struct ixgbe_hw_stats *stats = &adapter->stats.pf; | ||||
u32 missed_rx = 0, bprc, lxon, lxoff, total; | u32 missed_rx = 0, bprc, lxon, lxoff, total; | ||||
u32 lxoffrxc; | |||||
u64 total_missed_rx = 0; | u64 total_missed_rx = 0; | ||||
stats->crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS); | stats->crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS); | ||||
stats->illerrc += IXGBE_READ_REG(hw, IXGBE_ILLERRC); | stats->illerrc += IXGBE_READ_REG(hw, IXGBE_ILLERRC); | ||||
stats->errbc += IXGBE_READ_REG(hw, IXGBE_ERRBC); | stats->errbc += IXGBE_READ_REG(hw, IXGBE_ERRBC); | ||||
stats->mspdc += IXGBE_READ_REG(hw, IXGBE_MSPDC); | stats->mspdc += IXGBE_READ_REG(hw, IXGBE_MSPDC); | ||||
stats->mpc[0] += IXGBE_READ_REG(hw, IXGBE_MPC(0)); | stats->mpc[0] += IXGBE_READ_REG(hw, IXGBE_MPC(0)); | ||||
Show All 13 Lines | ixgbe_update_stats_counters(struct adapter *adapter) | ||||
if (hw->mac.type != ixgbe_mac_82598EB) { | if (hw->mac.type != ixgbe_mac_82598EB) { | ||||
stats->gorc += IXGBE_READ_REG(hw, IXGBE_GORCL) + | stats->gorc += IXGBE_READ_REG(hw, IXGBE_GORCL) + | ||||
((u64)IXGBE_READ_REG(hw, IXGBE_GORCH) << 32); | ((u64)IXGBE_READ_REG(hw, IXGBE_GORCH) << 32); | ||||
stats->gotc += IXGBE_READ_REG(hw, IXGBE_GOTCL) + | stats->gotc += IXGBE_READ_REG(hw, IXGBE_GOTCL) + | ||||
((u64)IXGBE_READ_REG(hw, IXGBE_GOTCH) << 32); | ((u64)IXGBE_READ_REG(hw, IXGBE_GOTCH) << 32); | ||||
stats->tor += IXGBE_READ_REG(hw, IXGBE_TORL) + | stats->tor += IXGBE_READ_REG(hw, IXGBE_TORL) + | ||||
((u64)IXGBE_READ_REG(hw, IXGBE_TORH) << 32); | ((u64)IXGBE_READ_REG(hw, IXGBE_TORH) << 32); | ||||
stats->lxonrxc += IXGBE_READ_REG(hw, IXGBE_LXONRXCNT); | 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 { | } else { | ||||
stats->lxonrxc += IXGBE_READ_REG(hw, IXGBE_LXONRXC); | 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 */ | /* 82598 only has a counter in the high register */ | ||||
stats->gorc += IXGBE_READ_REG(hw, IXGBE_GORCH); | stats->gorc += IXGBE_READ_REG(hw, IXGBE_GORCH); | ||||
stats->gotc += IXGBE_READ_REG(hw, IXGBE_GOTCH); | stats->gotc += IXGBE_READ_REG(hw, IXGBE_GOTCH); | ||||
stats->tor += IXGBE_READ_REG(hw, IXGBE_TORH); | 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 | * Workaround: mprc hardware is incorrectly counting | ||||
* broadcasts, so for now we subtract those. | * broadcasts, so for now we subtract those. | ||||
*/ | */ | ||||
bprc = IXGBE_READ_REG(hw, IXGBE_BPRC); | bprc = IXGBE_READ_REG(hw, IXGBE_BPRC); | ||||
stats->bprc += bprc; | stats->bprc += bprc; | ||||
stats->mprc += IXGBE_READ_REG(hw, IXGBE_MPRC); | stats->mprc += IXGBE_READ_REG(hw, IXGBE_MPRC); | ||||
▲ Show 20 Lines • Show All 3,108 Lines • Show Last 20 Lines |