From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:09:36 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 605BDE8E; Thu, 18 Sep 2014 20:09:36 +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 41395CBB; Thu, 18 Sep 2014 20:09:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IK9a1G034050; Thu, 18 Sep 2014 20:09:36 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IK9asR034049; Thu, 18 Sep 2014 20:09:36 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182009.s8IK9asR034049@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:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271805 - head/sys/dev/sis 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:09:36 -0000 Author: glebius Date: Thu Sep 18 20:09:35 2014 New Revision: 271805 URL: http://svnweb.freebsd.org/changeset/base/271805 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/sis/if_sis.c Modified: head/sys/dev/sis/if_sis.c ============================================================================== --- head/sys/dev/sis/if_sis.c Thu Sep 18 20:06:10 2014 (r271804) +++ head/sys/dev/sis/if_sis.c Thu Sep 18 20:09:35 2014 (r271805) @@ -1509,9 +1509,9 @@ sis_rxeof(struct sis_softc *sc) ETHER_CRC_LEN)) rxstat &= ~SIS_RXSTAT_GIANT; if (SIS_RXSTAT_ERROR(rxstat) != 0) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); if (rxstat & SIS_RXSTAT_COLL) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); sis_discard_rxbuf(rxd); continue; } @@ -1519,7 +1519,7 @@ sis_rxeof(struct sis_softc *sc) /* Add a new receive buffer to the ring. */ m = rxd->rx_m; if (sis_newbuf(sc, rxd) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); sis_discard_rxbuf(rxd); continue; } @@ -1535,7 +1535,7 @@ sis_rxeof(struct sis_softc *sc) */ sis_fixup_rx(m); #endif - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = ifp; SIS_UNLOCK(sc); @@ -1593,15 +1593,15 @@ sis_txeof(struct sis_softc *sc) m_freem(txd->tx_m); txd->tx_m = NULL; if ((txstat & SIS_CMDSTS_PKT_OK) != 0) { - ifp->if_opackets++; - ifp->if_collisions += - (txstat & SIS_TXSTAT_COLLCNT) >> 16; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, + (txstat & SIS_TXSTAT_COLLCNT) >> 16); } else { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (txstat & SIS_TXSTAT_EXCESSCOLLS) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); if (txstat & SIS_TXSTAT_OUTOFWINCOLL) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); } } sc->sis_tx_cnt--; @@ -1664,7 +1664,7 @@ sis_poll(struct ifnet *ifp, enum poll_cm status = CSR_READ_4(sc, SIS_ISR); if (status & (SIS_ISR_RX_ERR|SIS_ISR_RX_OFLOW)) - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); if (status & (SIS_ISR_RX_IDLE)) SIS_SETBIT(sc, SIS_CSR, SIS_CSR_RX_ENABLE); @@ -1722,7 +1722,7 @@ sis_intr(void *arg) sis_rxeof(sc); if (status & SIS_ISR_RX_OFLOW) - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); if (status & (SIS_ISR_RX_IDLE)) SIS_SETBIT(sc, SIS_CSR, SIS_CSR_RX_ENABLE); @@ -2197,7 +2197,7 @@ sis_watchdog(struct sis_softc *sc) return; device_printf(sc->sis_dev, "watchdog timeout\n"); - sc->sis_ifp->if_oerrors++; + if_inc_counter(sc->sis_ifp, IFCOUNTER_OERRORS, 1); sc->sis_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sis_initl(sc);