summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-11-13 03:48:09 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-11-13 03:48:09 +0000
commit5636dc0324d1e8486b701dea8f8cbbd8e3d9f3f3 (patch)
tree3c2db0a271cc79c7cacf0dbfe3eee7481053d17b /sys/dev/pci
parentafd062b7b153ae05c36a62b3b6fb7e6bd7953bb1 (diff)
- Introduce two more stat counters, counting number of RX
overruns and number of watchdog timeouts. - 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(). From glebius FreeBSD ok dlg@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/if_em.c48
-rw-r--r--sys/dev/pci/if_em.h6
2 files changed, 31 insertions, 23 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index 9a753743e5f..4bf1370055d 100644
--- a/sys/dev/pci/if_em.c
+++ b/sys/dev/pci/if_em.c
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_em.c,v 1.84 2005/11/08 01:33:19 brad Exp $ */
+/* $OpenBSD: if_em.c,v 1.85 2005/11/13 03:48:07 brad Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -579,7 +579,7 @@ em_watchdog(struct ifnet *ifp)
em_init(sc);
- ifp->if_oerrors++;
+ sc->watchdog_events++;
}
/*********************************************************************
@@ -738,7 +738,7 @@ em_intr(void *arg)
}
if (reg_icr & E1000_ICR_RXO) {
- ifp->if_ierrors++;
+ sc->rx_overruns++;
wantinit = 1;
}
}
@@ -2770,10 +2770,12 @@ em_update_stats_counters(struct em_softc *sc)
sc->stats.crcerrs +
sc->stats.algnerrc +
sc->stats.rlec + sc->stats.rnbc +
- sc->stats.mpc + sc->stats.cexterr;
+ sc->stats.mpc + sc->stats.cexterr +
+ sc->rx_overruns;
/* Tx Errors */
- ifp->if_oerrors = sc->stats.ecol + sc->stats.latecol;
+ ifp->if_oerrors = sc->stats.ecol + sc->stats.latecol +
+ sc->watchdog_events;
}
/**********************************************************************
@@ -2831,38 +2833,42 @@ em_print_hw_stats(struct em_softc *sc)
printf("%s: Excessive collisions = %lld\n", unit,
(long long)sc->stats.ecol);
printf("%s: Symbol errors = %lld\n", unit,
- (long long)sc->stats.symerrs);
+ (long long)sc->stats.symerrs);
printf("%s: Sequence errors = %lld\n", unit,
- (long long)sc->stats.sec);
+ (long long)sc->stats.sec);
printf("%s: Defer count = %lld\n", unit,
- (long long)sc->stats.dc);
+ (long long)sc->stats.dc);
printf("%s: Missed Packets = %lld\n", unit,
- (long long)sc->stats.mpc);
+ (long long)sc->stats.mpc);
printf("%s: Receive No Buffers = %lld\n", unit,
- (long long)sc->stats.rnbc);
+ (long long)sc->stats.rnbc);
printf("%s: Receive length errors = %lld\n", unit,
- (long long)sc->stats.rlec);
+ (long long)sc->stats.rlec);
printf("%s: Receive errors = %lld\n", unit,
- (long long)sc->stats.rxerrc);
+ (long long)sc->stats.rxerrc);
printf("%s: Crc errors = %lld\n", unit,
- (long long)sc->stats.crcerrs);
+ (long long)sc->stats.crcerrs);
printf("%s: Alignment errors = %lld\n", unit,
- (long long)sc->stats.algnerrc);
+ (long long)sc->stats.algnerrc);
printf("%s: Carrier extension errors = %lld\n", unit,
- (long long)sc->stats.cexterr);
+ (long long)sc->stats.cexterr);
+ printf("%s: RX overruns = %ld\n", unit,
+ sc->rx_overruns);
+ printf("%s: watchdog timeouts = %ld\n", unit,
+ sc->watchdog_events);
printf("%s: XON Rcvd = %lld\n", unit,
- (long long)sc->stats.xonrxc);
+ (long long)sc->stats.xonrxc);
printf("%s: XON Xmtd = %lld\n", unit,
- (long long)sc->stats.xontxc);
+ (long long)sc->stats.xontxc);
printf("%s: XOFF Rcvd = %lld\n", unit,
- (long long)sc->stats.xoffrxc);
+ (long long)sc->stats.xoffrxc);
printf("%s: XOFF Xmtd = %lld\n", unit,
- (long long)sc->stats.xofftxc);
+ (long long)sc->stats.xofftxc);
printf("%s: Good Packets Rcvd = %lld\n", unit,
- (long long)sc->stats.gprc);
+ (long long)sc->stats.gprc);
printf("%s: Good Packets Xmtd = %lld\n", unit,
- (long long)sc->stats.gptc);
+ (long long)sc->stats.gptc);
}
diff --git a/sys/dev/pci/if_em.h b/sys/dev/pci/if_em.h
index c5211b4f76e..77e4ff46867 100644
--- a/sys/dev/pci/if_em.h
+++ b/sys/dev/pci/if_em.h
@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
/* $FreeBSD: if_em.h,v 1.26 2004/09/01 23:22:41 pdeuskar Exp $ */
-/* $OpenBSD: if_em.h,v 1.17 2005/10/24 21:42:34 brad Exp $ */
+/* $OpenBSD: if_em.h,v 1.18 2005/11/13 03:48:08 brad Exp $ */
#ifndef _EM_H_DEFINED_
#define _EM_H_DEFINED_
@@ -368,7 +368,9 @@ struct em_softc {
unsigned long no_tx_desc_avail1;
unsigned long no_tx_desc_avail2;
unsigned long no_tx_map_avail;
- unsigned long no_tx_dma_setup;
+ 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