svn commit: r199054 - head/sys/dev/bge

Pyun YongHyeon yongari at
Sun Nov 8 19:59:54 UTC 2009

Author: yongari
Date: Sun Nov  8 19:59:54 2009
New Revision: 199054

  Partially revert r199035.
  Revision 1.158 says only lower ten bits of
  BGE_RXLP_LOCSTAT_IFIN_DROPS register is valid. For BCM5761 case it
  seems the controller maintains 16bits value for the register.
  However 16bits are still too small to count all dropped packets
  happened in a second. To get a correct counter we have to read the
  register in bge_rxeof() which would be too expensive.
  Pointed out by:	bde


Modified: head/sys/dev/bge/if_bge.c
--- head/sys/dev/bge/if_bge.c	Sun Nov  8 19:02:13 2009	(r199053)
+++ head/sys/dev/bge/if_bge.c	Sun Nov  8 19:59:54 2009	(r199054)
@@ -3289,6 +3289,14 @@ bge_rxeof(struct bge_softc *sc)
 		bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, sc->bge_std);
 	if (jumbocnt)
 		bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, sc->bge_jumbo);
+#ifdef notyet
+	/*
+	 * This register wraps very quickly under heavy packet drops.
+	 * If you need correct statistics, you can enable this check.
+	 */
+	if (BGE_IS_5705_PLUS(sc))
+		ifp->if_ierrors += CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_DROPS);
 	return (rx_npkts);

More information about the svn-src-all mailing list