diff options
author | glebius <glebius@FreeBSD.org> | 2005-11-09 15:23:54 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2005-11-09 15:23:54 +0000 |
commit | e40bee48f755d6c81982784ddc2ad489d9e7dee8 (patch) | |
tree | 68db02e2cb60b0cabc24ff446360789365cd57cb /sys/dev | |
parent | e53f1ca06be3db76bd498563937bb0c904879f5a (diff) | |
download | FreeBSD-src-e40bee48f755d6c81982784ddc2ad489d9e7dee8.zip FreeBSD-src-e40bee48f755d6c81982784ddc2ad489d9e7dee8.tar.gz |
- 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]
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/em/if_em.c | 10 | ||||
-rw-r--r-- | sys/dev/em/if_em.h | 3 |
2 files changed, 9 insertions, 4 deletions
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 <sys/socket.h> #include <sys/sockio.h> #include <sys/sysctl.h> -#include <sys/syslog.h> #include <machine/bus.h> #include <sys/rman.h> @@ -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 |