Date: Thu, 18 Sep 2014 21:03:13 +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: r271829 - head/sys/dev/bfe Message-ID: <201409182103.s8IL3DoM063932@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Thu Sep 18 21:03:13 2014 New Revision: 271829 URL: http://svnweb.freebsd.org/changeset/base/271829 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/bfe/if_bfe.c Modified: head/sys/dev/bfe/if_bfe.c ============================================================================== --- head/sys/dev/bfe/if_bfe.c Thu Sep 18 21:01:41 2014 (r271828) +++ head/sys/dev/bfe/if_bfe.c Thu Sep 18 21:03:13 2014 (r271829) @@ -1310,22 +1310,22 @@ bfe_stats_update(struct bfe_softc *sc) stats->rx_control_frames += mib[MIB_RX_NPAUSE]; /* Update counters in ifnet. */ - ifp->if_opackets += (u_long)mib[MIB_TX_GOOD_P]; - ifp->if_collisions += (u_long)mib[MIB_TX_TCOLS]; - ifp->if_oerrors += (u_long)mib[MIB_TX_URUNS] + + if_inc_counter(ifp, IFCOUNTER_OPACKETS, (u_long)mib[MIB_TX_GOOD_P]); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, (u_long)mib[MIB_TX_TCOLS]); + if_inc_counter(ifp, IFCOUNTER_OERRORS, (u_long)mib[MIB_TX_URUNS] + (u_long)mib[MIB_TX_ECOLS] + (u_long)mib[MIB_TX_DEFERED] + - (u_long)mib[MIB_TX_CLOST]; + (u_long)mib[MIB_TX_CLOST]); - ifp->if_ipackets += (u_long)mib[MIB_RX_GOOD_P]; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, (u_long)mib[MIB_RX_GOOD_P]); - ifp->if_ierrors += mib[MIB_RX_JABBER] + + if_inc_counter(ifp, IFCOUNTER_IERRORS, mib[MIB_RX_JABBER] + mib[MIB_RX_MISS] + mib[MIB_RX_CRCA] + mib[MIB_RX_USIZE] + mib[MIB_RX_CRC] + mib[MIB_RX_ALIGN] + - mib[MIB_RX_SYM]; + mib[MIB_RX_SYM]); } static void @@ -1403,7 +1403,7 @@ bfe_rxeof(struct bfe_softc *sc) * reuse mapped buffer from errored frame. */ if (bfe_list_newbuf(sc, cons) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); bfe_discard_buf(sc, cons); continue; } @@ -1818,7 +1818,7 @@ bfe_watchdog(struct bfe_softc *sc) device_printf(sc->bfe_dev, "watchdog timeout -- resetting\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; bfe_init_locked(sc);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409182103.s8IL3DoM063932>