summaryrefslogtreecommitdiffstats
path: root/sys/dev/age
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2014-09-18 21:01:41 +0000
committerglebius <glebius@FreeBSD.org>2014-09-18 21:01:41 +0000
commit25bbf4092ebc1ceab5bc249d400dc9d8bd41aef1 (patch)
tree5133c31cb96c8ca7ecadb161e71a11303d095847 /sys/dev/age
parentf8546b8f0d327e5228a0275bec79ebd29536c8d9 (diff)
downloadFreeBSD-src-25bbf4092ebc1ceab5bc249d400dc9d8bd41aef1.zip
FreeBSD-src-25bbf4092ebc1ceab5bc249d400dc9d8bd41aef1.tar.gz
Mechanically convert to if_inc_counter().
Diffstat (limited to 'sys/dev/age')
-rw-r--r--sys/dev/age/if_age.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/sys/dev/age/if_age.c b/sys/dev/age/if_age.c
index d5f387c..c3a8962 100644
--- a/sys/dev/age/if_age.c
+++ b/sys/dev/age/if_age.c
@@ -1792,7 +1792,7 @@ age_watchdog(struct age_softc *sc)
ifp = sc->age_ifp;
if ((sc->age_flags & AGE_FLAG_LINK) == 0) {
if_printf(sc->age_ifp, "watchdog timeout (missed link)\n");
- ifp->if_oerrors++;
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
age_init_locked(sc);
return;
@@ -1805,7 +1805,7 @@ age_watchdog(struct age_softc *sc)
return;
}
if_printf(sc->age_ifp, "watchdog timeout\n");
- ifp->if_oerrors++;
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
age_init_locked(sc);
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
@@ -2087,22 +2087,22 @@ age_stats_update(struct age_softc *sc)
stat->tx_mcast_bytes += smb->tx_mcast_bytes;
/* Update counters in ifnet. */
- ifp->if_opackets += smb->tx_frames;
+ if_inc_counter(ifp, IFCOUNTER_OPACKETS, smb->tx_frames);
- ifp->if_collisions += smb->tx_single_colls +
+ if_inc_counter(ifp, IFCOUNTER_COLLISIONS, smb->tx_single_colls +
smb->tx_multi_colls + smb->tx_late_colls +
- smb->tx_excess_colls * HDPX_CFG_RETRY_DEFAULT;
+ smb->tx_excess_colls * HDPX_CFG_RETRY_DEFAULT);
- ifp->if_oerrors += smb->tx_excess_colls +
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, smb->tx_excess_colls +
smb->tx_late_colls + smb->tx_underrun +
- smb->tx_pkts_truncated;
+ smb->tx_pkts_truncated);
- ifp->if_ipackets += smb->rx_frames;
+ if_inc_counter(ifp, IFCOUNTER_IPACKETS, smb->rx_frames);
- ifp->if_ierrors += smb->rx_crcerrs + smb->rx_lenerrs +
- smb->rx_runts + smb->rx_pkts_truncated +
+ if_inc_counter(ifp, IFCOUNTER_IERRORS, smb->rx_crcerrs +
+ smb->rx_lenerrs + smb->rx_runts + smb->rx_pkts_truncated +
smb->rx_fifo_oflows + smb->rx_desc_oflows +
- smb->rx_alignerrs;
+ smb->rx_alignerrs);
/* Update done, clear. */
smb->updated = 0;
@@ -2291,7 +2291,7 @@ age_fixup_rx(struct ifnet *ifp, struct mbuf *m)
*/
MGETHDR(n, M_NOWAIT, MT_DATA);
if (n == NULL) {
- ifp->if_iqdrops++;
+ if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
m_freem(m);
return (NULL);
}
@@ -2347,7 +2347,7 @@ age_rxeof(struct age_softc *sc, struct rx_rdesc *rxrd)
mp = rxd->rx_m;
/* Add a new receive buffer to the ring. */
if (age_newbuf(sc, rxd) != 0) {
- ifp->if_iqdrops++;
+ if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
/* Reuse Rx buffers. */
if (sc->age_cdata.age_rxhead != NULL)
m_freem(sc->age_cdata.age_rxhead);
OpenPOWER on IntegriCloud