aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2005-11-09 15:23:54 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2005-11-09 15:23:54 +0000
commit7d62e533fb7e8836b929e4782cdd32472334fe6c (patch)
tree68db02e2cb60b0cabc24ff446360789365cd57cb
parent26b7bd707c38a698a4c176ae07422a0a9c5c34ee (diff)
downloadsrc-7d62e533fb7e8836b929e4782cdd32472334fe6c.tar.gz
src-7d62e533fb7e8836b929e4782cdd32472334fe6c.zip
- 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]
Notes
Notes: svn path=/head/; revision=152247
-rw-r--r--sys/dev/em/if_em.c10
-rw-r--r--sys/dev/em/if_em.h3
2 files changed, 9 insertions, 4 deletions
diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c
index 5be2db8d16e0..3ff8b835fb3e 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 2e5ab9e8f739..3c38d840ae50 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