From e40bee48f755d6c81982784ddc2ad489d9e7dee8 Mon Sep 17 00:00:00 2001 From: glebius Date: Wed, 9 Nov 2005 15:23:54 +0000 Subject: - Introduce two more stat counters, counting number of RX overruns and number of watchdog timeouts. - Do not log(9) RX overrun events, since this pessimizes things under load [1]. - Do not increase if->if_oerrors in em_watchdog(), since this leads to counter slipping back, when if->if_oerrors is recalculated in em_update_stats_counters(). Instead increase watchdog counter in em_watchdog() and take it into account in em_update_stats_counters(). Submitted by: ade [1] --- sys/dev/em/if_em.c | 10 +++++++--- sys/dev/em/if_em.h | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c index 5be2db8..3ff8b83 100644 --- a/sys/dev/em/if_em.c +++ b/sys/dev/em/if_em.c @@ -796,7 +796,7 @@ em_watchdog(struct ifnet *ifp) printf("em%d: watchdog timeout -- resetting\n", adapter->unit); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - ifp->if_oerrors++; + adapter->watchdog_events++; em_init_locked(adapter); EM_UNLOCK(adapter); @@ -1019,7 +1019,7 @@ em_intr(void *arg) } if (reg_icr & E1000_ICR_RXO) { - log(LOG_WARNING, "%s: RX overrun\n", ifp->if_xname); + adapter->rx_overruns++; wantinit = 1; } } @@ -3193,7 +3193,8 @@ em_update_stats_counters(struct adapter *adapter) adapter->stats.mpc + adapter->stats.cexterr; /* Tx Errors */ - ifp->if_oerrors = adapter->stats.ecol + adapter->stats.latecol; + ifp->if_oerrors = adapter->stats.ecol + adapter->stats.latecol + + adapter->watchdog_events; } @@ -3272,6 +3273,9 @@ em_print_hw_stats(struct adapter *adapter) (long long)adapter->stats.algnerrc); printf("em%d: Carrier extension errors = %lld\n", unit, (long long)adapter->stats.cexterr); + printf("em%d: RX overruns = %ld\n", unit, adapter->rx_overruns); + printf("em%d: watchdog timeouts = %ld\n", unit, + adapter->watchdog_events); printf("em%d: XON Rcvd = %lld\n", unit, (long long)adapter->stats.xonrxc); diff --git a/sys/dev/em/if_em.h b/sys/dev/em/if_em.h index 2e5ab9e..3c38d84 100644 --- a/sys/dev/em/if_em.h +++ b/sys/dev/em/if_em.h @@ -48,7 +48,6 @@ POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include #include #include @@ -387,6 +386,8 @@ struct adapter { unsigned long no_tx_desc_avail2; unsigned long no_tx_map_avail; unsigned long no_tx_dma_setup; + unsigned long watchdog_events; + unsigned long rx_overruns; /* Used in for 82547 10Mb Half workaround */ #define EM_PBA_BYTES_SHIFT 0xA -- cgit v1.1