Author: glebius
Date: Thu Sep 18 21:01:41 2014
New Revision: 271828
URL: http://svnweb.freebsd.org/changeset/base/271828

Log:
  Mechanically convert to if_inc_counter().

Modified:
  head/sys/dev/age/if_age.c

Modified: head/sys/dev/age/if_age.c
==============================================================================
--- head/sys/dev/age/if_age.c   Thu Sep 18 20:59:59 2014        (r271827)
+++ head/sys/dev/age/if_age.c   Thu Sep 18 21:01:41 2014        (r271828)
@@ -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 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 r
                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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to