From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:06:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE926BCA; Thu, 18 Sep 2014 20:06:10 +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 99569C8D; Thu, 18 Sep 2014 20:06:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IK6ADb033434; Thu, 18 Sep 2014 20:06:10 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IK6A0X033433; Thu, 18 Sep 2014 20:06:10 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182006.s8IK6A0X033433@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:06:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271804 - head/sys/dev/tx 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:06:10 -0000 Author: glebius Date: Thu Sep 18 20:06:10 2014 New Revision: 271804 URL: http://svnweb.freebsd.org/changeset/base/271804 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/tx/if_tx.c Modified: head/sys/dev/tx/if_tx.c ============================================================================== --- head/sys/dev/tx/if_tx.c Thu Sep 18 20:03:45 2014 (r271803) +++ head/sys/dev/tx/if_tx.c Thu Sep 18 20:06:10 2014 (r271804) @@ -671,7 +671,7 @@ epic_ifstart_locked(struct ifnet * ifp) if (error && error != EFBIG) { m_freem(m0); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } @@ -683,7 +683,7 @@ epic_ifstart_locked(struct ifnet * ifp) m = m_defrag(m0, M_NOWAIT); if (m == NULL) { m_freem(m0); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } m_freem(m0); @@ -693,7 +693,7 @@ epic_ifstart_locked(struct ifnet * ifp) epic_dma_map_txbuf, flist, 0); if (error) { m_freem(m); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } } @@ -748,7 +748,7 @@ epic_rx_done(epic_softc_t *sc) * RXE interrupt usually. */ if ((desc->status & 1) == 0) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); desc->status = 0x8000; continue; } @@ -763,7 +763,7 @@ epic_rx_done(epic_softc_t *sc) if (buf->mbuf == NULL) { buf->mbuf = m; desc->status = 0x8000; - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); continue; } buf->mbuf->m_len = buf->mbuf->m_pkthdr.len = MCLBYTES; @@ -775,7 +775,7 @@ epic_rx_done(epic_softc_t *sc) if (error) { buf->mbuf = m; desc->status = 0x8000; - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); continue; } @@ -796,7 +796,7 @@ epic_rx_done(epic_softc_t *sc) EPIC_LOCK(sc); /* Successfuly received frame */ - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); } bus_dmamap_sync(sc->rtag, sc->rmap, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); @@ -838,10 +838,10 @@ epic_tx_done(epic_softc_t *sc) /* Check for errors and collisions. */ if (status & 0x0001) - sc->ifp->if_opackets++; + if_inc_counter(sc->ifp, IFCOUNTER_OPACKETS, 1); else - sc->ifp->if_oerrors++; - sc->ifp->if_collisions += (status >> 8) & 0x1F; + if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, 1); + if_inc_counter(sc->ifp, IFCOUNTER_COLLISIONS, (status >> 8) & 0x1F); #ifdef EPIC_DIAG if ((status & 0x1001) == 0x1001) device_printf(sc->dev, @@ -881,7 +881,7 @@ epic_intr(void *arg) #endif if ((CSR_READ_4(sc, COMMAND) & COMMAND_RXQUEUED) == 0) CSR_WRITE_4(sc, COMMAND, COMMAND_RXQUEUED); - sc->ifp->if_ierrors++; + if_inc_counter(sc->ifp, IFCOUNTER_IERRORS, 1); } } @@ -911,12 +911,12 @@ epic_intr(void *arg) #ifdef EPIC_DIAG device_printf(sc->dev, "CRC/Alignment error\n"); #endif - sc->ifp->if_ierrors++; + if_inc_counter(sc->ifp, IFCOUNTER_IERRORS, 1); } if (status & INTSTAT_TXU) { epic_tx_underrun(sc); - sc->ifp->if_oerrors++; + if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, 1); } } } @@ -981,7 +981,7 @@ epic_timer(void *arg) /* If not successful. */ if (sc->pending_txs > 0) { - ifp->if_oerrors += sc->pending_txs; + if_inc_counter(ifp, IFCOUNTER_OERRORS, sc->pending_txs); /* Reinitialize board. */ device_printf(sc->dev, "reinitialization\n");