Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci - Count Receive error, CRC error, Alignment erro...
details: https://anonhg.NetBSD.org/src/rev/5418baf4206c
branches: trunk
changeset: 751441:5418baf4206c
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Thu Feb 04 09:13:23 2010 +0000
description:
- Count Receive error, CRC error, Alignment error, Symbol error, Sequence
error, Carrier extension error and Receive length error into ierror.
Fixes PR#30349 reported by UMEZAWA Takeshi.
- Count Missed packet (rx fifo overflow) and Receive no buffers (rx ring full)
into iqdrops.
diffstat:
sys/dev/pci/if_wm.c | 15 +++++++++++----
sys/dev/pci/if_wmreg.h | 12 ++++++++++--
2 files changed, 21 insertions(+), 6 deletions(-)
diffs (75 lines):
diff -r 871b83aad915 -r 5418baf4206c sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c Thu Feb 04 09:12:55 2010 +0000
+++ b/sys/dev/pci/if_wm.c Thu Feb 04 09:13:23 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wm.c,v 1.195 2010/01/22 08:56:06 martin Exp $ */
+/* $NetBSD: if_wm.c,v 1.196 2010/02/04 09:13:23 msaitoh Exp $ */
/*
* Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.195 2010/01/22 08:56:06 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.196 2010/02/04 09:13:23 msaitoh Exp $");
#include "rnd.h"
@@ -2830,7 +2830,6 @@
*/
if (errors &
(WRX_ER_CE|WRX_ER_SE|WRX_ER_SEQ|WRX_ER_CXE|WRX_ER_RXE)) {
- ifp->if_ierrors++;
if (errors & WRX_ER_SE)
log(LOG_WARNING, "%s: symbol error\n",
device_xname(sc->sc_dev));
@@ -3083,7 +3082,15 @@
}
ifp->if_collisions += CSR_READ(sc, WMREG_COLC);
- ifp->if_ierrors += CSR_READ(sc, WMREG_RXERRC);
+ ifp->if_ierrors += 0ULL + /* ensure quad_t */
+ + CSR_READ(sc, WMREG_CRCERRS)
+ + CSR_READ(sc, WMREG_ALGNERRC)
+ + CSR_READ(sc, WMREG_SYMERRC)
+ + CSR_READ(sc, WMREG_RXERRC)
+ + CSR_READ(sc, WMREG_SEC)
+ + CSR_READ(sc, WMREG_CEXTERR)
+ + CSR_READ(sc, WMREG_RLEC);
+ ifp->if_iqdrops += CSR_READ(sc, WMREG_MPC) + CSR_READ(sc, WMREG_RNBC);
if (sc->sc_flags & WM_F_HAS_MII)
mii_tick(&sc->sc_mii);
diff -r 871b83aad915 -r 5418baf4206c sys/dev/pci/if_wmreg.h
--- a/sys/dev/pci/if_wmreg.h Thu Feb 04 09:12:55 2010 +0000
+++ b/sys/dev/pci/if_wmreg.h Thu Feb 04 09:13:23 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wmreg.h,v 1.35 2010/01/14 18:56:02 msaitoh Exp $ */
+/* $NetBSD: if_wmreg.h,v 1.36 2010/02/04 09:13:23 msaitoh Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -642,13 +642,21 @@
#define RXCSUM_TUOFL (1U << 9) /* TCP/UDP checksum offload */
#define RXCSUM_IPV6OFL (1U << 10) /* IPv6 checksum offload */
-#define WMREG_RXERRC 0x400C /* receive error Count - R/clr */
+#define WMREG_CRCERRS 0x4000 /* CRC Error Count */
+#define WMREG_ALGNERRC 0x4004 /* Alignment Error Count */
+#define WMREG_SYMERRC 0x4008 /* Symbol Error Count */
+#define WMREG_RXERRC 0x400c /* receive error Count - R/clr */
+#define WMREG_MPC 0x4010 /* Missed Packets Count - R/clr */
#define WMREG_COLC 0x4028 /* collision Count - R/clr */
+#define WMREG_SEC 0x4038 /* Sequence Error Count */
+#define WMREG_CEXTERR 0x403c /* Carrier Extension Error Count */
+#define WMREG_RLEC 0x4040 /* Receive Length Error Count */
#define WMREG_XONRXC 0x4048 /* XON Rx Count - R/clr */
#define WMREG_XONTXC 0x404c /* XON Tx Count - R/clr */
#define WMREG_XOFFRXC 0x4050 /* XOFF Rx Count - R/clr */
#define WMREG_XOFFTXC 0x4054 /* XOFF Tx Count - R/clr */
#define WMREG_FCRUC 0x4058 /* Flow Control Rx Unsupported Count - R/clr */
+#define WMREG_RNBC 0x40a0 /* Receive No Buffers Count */
#define WMREG_KUMCTRLSTA 0x0034 /* MAC-PHY interface - RW */
#define KUMCTRLSTA_MASK 0x0000FFFF
Home |
Main Index |
Thread Index |
Old Index