Date: Thu, 18 Sep 2014 21:16:05 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271837 - head/sys/dev/stge Message-ID: <201409182116.s8ILG6wr069750@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409182116.s8ILG6wr069750>