Date: Sun, 8 Nov 2009 19:59:54 +0000 (UTC) From: Pyun YongHyeon <yongari@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r199054 - head/sys/dev/bge Message-ID: <200911081959.nA8Jxso0096200@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: yongari Date: Sun Nov 8 19:59:54 2009 New Revision: 199054 URL: http://svn.freebsd.org/changeset/base/199054 Log: 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 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); +#endif return (rx_npkts); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911081959.nA8Jxso0096200>