diff options
author | yongari <yongari@FreeBSD.org> | 2009-11-08 19:59:54 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2009-11-08 19:59:54 +0000 |
commit | ff8940c7c7df8ff8fda10c9b907363bb10fc1fcf (patch) | |
tree | 5f0350156c9887253577250d8bbf3f0cd78c48bc | |
parent | 8cad35127a89189a6ea7233767281695887cc3d8 (diff) | |
download | FreeBSD-src-ff8940c7c7df8ff8fda10c9b907363bb10fc1fcf.zip FreeBSD-src-ff8940c7c7df8ff8fda10c9b907363bb10fc1fcf.tar.gz |
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
-rw-r--r-- | sys/dev/bge/if_bge.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index f2352a9..c0ef5dc 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -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); +#endif return (rx_npkts); } |