From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:30:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DA62425; Thu, 18 Sep 2014 20:30:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D548F0E; Thu, 18 Sep 2014 20:30:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKUmvX044930; Thu, 18 Sep 2014 20:30:48 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKUmAw044929; Thu, 18 Sep 2014 20:30:48 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182030.s8IKUmAw044929@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:30:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271815 - head/sys/dev/vge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 20:30:48 -0000 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