Date: Thu, 18 Sep 2014 20:30:48 +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: r271815 - head/sys/dev/vge Message-ID: <201409182030.s8IKUmAw044929@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Thu Sep 18 20:30:47 2014 New Revision: 271815 URL: http://svnweb.freebsd.org/changeset/base/271815 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Thu Sep 18 20:29:17 2014 (r271814) +++ head/sys/dev/vge/if_vge.c Thu Sep 18 20:30:47 2014 (r271815) @@ -1400,7 +1400,7 @@ vge_freebufs(struct vge_softc *sc) txd->tx_dmamap); m_freem(txd->tx_m); txd->tx_m = NULL; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } } } @@ -1467,7 +1467,7 @@ vge_rxeof(struct vge_softc *sc, int coun */ if ((rxstat & VGE_RXPKT_SOF) != 0) { if (vge_newbuf(sc, prod) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); VGE_CHAIN_RESET(sc); vge_discard_rxbuf(sc, prod); continue; @@ -1498,7 +1498,7 @@ vge_rxeof(struct vge_softc *sc, int coun if ((rxstat & VGE_RDSTS_RXOK) == 0 && (rxstat & (VGE_RDSTS_VIDM | VGE_RDSTS_RLERR | VGE_RDSTS_CSUMERR)) == 0) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); /* * If this is part of a multi-fragment packet, * discard all the pieces. @@ -1509,7 +1509,7 @@ vge_rxeof(struct vge_softc *sc, int coun } if (vge_newbuf(sc, prod) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); VGE_CHAIN_RESET(sc); vge_discard_rxbuf(sc, prod); continue; @@ -2380,7 +2380,7 @@ vge_watchdog(void *arg) ifp = sc->vge_ifp; if_printf(ifp, "watchdog timeout\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); vge_txeof(sc); vge_rxeof(sc, VGE_RX_DESC_CNT); @@ -2706,24 +2706,25 @@ reset_idx: stats->tx_latecolls += mib[VGE_MIB_TX_LATECOLLS]; /* Update counters in ifnet. */ - ifp->if_opackets += mib[VGE_MIB_TX_GOOD_FRAMES]; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, mib[VGE_MIB_TX_GOOD_FRAMES]); - ifp->if_collisions += mib[VGE_MIB_TX_COLLS] + - mib[VGE_MIB_TX_LATECOLLS]; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, + mib[VGE_MIB_TX_COLLS] + mib[VGE_MIB_TX_LATECOLLS]); - ifp->if_oerrors += mib[VGE_MIB_TX_COLLS] + - mib[VGE_MIB_TX_LATECOLLS]; + if_inc_counter(ifp, IFCOUNTER_OERRORS, + mib[VGE_MIB_TX_COLLS] + mib[VGE_MIB_TX_LATECOLLS]); - ifp->if_ipackets += mib[VGE_MIB_RX_GOOD_FRAMES]; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, mib[VGE_MIB_RX_GOOD_FRAMES]); - ifp->if_ierrors += mib[VGE_MIB_RX_FIFO_OVERRUNS] + + if_inc_counter(ifp, IFCOUNTER_IERRORS, + mib[VGE_MIB_RX_FIFO_OVERRUNS] + mib[VGE_MIB_RX_RUNTS] + mib[VGE_MIB_RX_RUNTS_ERRS] + mib[VGE_MIB_RX_CRCERRS] + mib[VGE_MIB_RX_ALIGNERRS] + mib[VGE_MIB_RX_NOBUFS] + mib[VGE_MIB_RX_SYMERRS] + - mib[VGE_MIB_RX_LENERRS]; + mib[VGE_MIB_RX_LENERRS]); } static void
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409182030.s8IKUmAw044929>