Author: glebius Date: Thu Sep 18 21:16:05 2014 New Revision: 271837 URL: http://svnweb.freebsd.org/changeset/base/271837
Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/stge/if_stge.c Modified: head/sys/dev/stge/if_stge.c ============================================================================== --- head/sys/dev/stge/if_stge.c Thu Sep 18 21:14:46 2014 (r271836) +++ head/sys/dev/stge/if_stge.c Thu Sep 18 21:16:05 2014 (r271837) @@ -1236,7 +1236,7 @@ stge_watchdog(struct stge_softc *sc) ifp = sc->sc_ifp; if_printf(sc->sc_ifp, "device timeout\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; stge_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -1684,7 +1684,7 @@ stge_rxeof(struct stge_softc *sc) * Add a new receive buffer to the ring. */ if (stge_newbuf(sc, cons) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); stge_discard_rxbuf(sc, cons); if (sc->sc_cdata.stge_rxhead != NULL) { m_freem(sc->sc_cdata.stge_rxhead); @@ -1874,22 +1874,22 @@ stge_stats_update(struct stge_softc *sc) CSR_READ_4(sc,STGE_OctetRcvOk); - ifp->if_ipackets += CSR_READ_4(sc, STGE_FramesRcvdOk); + if_inc_counter(ifp, IFCOUNTER_IPACKETS, CSR_READ_4(sc, STGE_FramesRcvdOk)); - ifp->if_ierrors += CSR_READ_2(sc, STGE_FramesLostRxErrors); + if_inc_counter(ifp, IFCOUNTER_IERRORS, CSR_READ_2(sc, STGE_FramesLostRxErrors)); CSR_READ_4(sc, STGE_OctetXmtdOk); - ifp->if_opackets += CSR_READ_4(sc, STGE_FramesXmtdOk); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, CSR_READ_4(sc, STGE_FramesXmtdOk)); - ifp->if_collisions += + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, CSR_READ_4(sc, STGE_LateCollisions) + CSR_READ_4(sc, STGE_MultiColFrames) + - CSR_READ_4(sc, STGE_SingleColFrames); + CSR_READ_4(sc, STGE_SingleColFrames)); - ifp->if_oerrors += + if_inc_counter(ifp, IFCOUNTER_OERRORS, CSR_READ_2(sc, STGE_FramesAbortXSColls) + - CSR_READ_2(sc, STGE_FramesWEXDeferal); + CSR_READ_2(sc, STGE_FramesWEXDeferal)); } /* _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"