Date: Thu, 18 Sep 2014 20:06:10 +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: r271804 - head/sys/dev/tx Message-ID: <201409182006.s8IK6A0X033433@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409182006.s8IK6A0X033433>