svn commit: r271835 - head/sys/dev/ale
Gleb Smirnoff
glebius at FreeBSD.org
Thu Sep 18 21:13:13 UTC 2014
Author: glebius
Date: Thu Sep 18 21:13:12 2014
New Revision: 271835
URL: http://svnweb.freebsd.org/changeset/base/271835
Log:
Mechanically convert to if_inc_counter().
Modified:
head/sys/dev/ale/if_ale.c
Modified: head/sys/dev/ale/if_ale.c
==============================================================================
--- head/sys/dev/ale/if_ale.c Thu Sep 18 21:13:03 2014 (r271834)
+++ head/sys/dev/ale/if_ale.c Thu Sep 18 21:13:12 2014 (r271835)
@@ -1953,13 +1953,13 @@ ale_watchdog(struct ale_softc *sc)
ifp = sc->ale_ifp;
if ((sc->ale_flags & ALE_FLAG_LINK) == 0) {
if_printf(sc->ale_ifp, "watchdog timeout (lost link)\n");
- ifp->if_oerrors++;
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
ale_init_locked(sc);
return;
}
if_printf(sc->ale_ifp, "watchdog timeout -- resetting\n");
- ifp->if_oerrors++;
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
ale_init_locked(sc);
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
@@ -2206,11 +2206,11 @@ ale_stats_update(struct ale_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 * 2 + smb->tx_late_colls +
- smb->tx_abort * HDPX_CFG_RETRY_DEFAULT;
+ smb->tx_abort * HDPX_CFG_RETRY_DEFAULT);
/*
* XXX
@@ -2219,15 +2219,16 @@ ale_stats_update(struct ale_softc *sc)
* the counter name is not correct one so I've removed the
* counter in output errors.
*/
- ifp->if_oerrors += smb->tx_abort + smb->tx_late_colls +
- smb->tx_underrun;
+ if_inc_counter(ifp, IFCOUNTER_OERRORS,
+ smb->tx_abort + smb->tx_late_colls + smb->tx_underrun);
- ifp->if_ipackets += smb->rx_frames;
+ if_inc_counter(ifp, IFCOUNTER_IPACKETS, smb->rx_frames);
- ifp->if_ierrors += smb->rx_crcerrs + smb->rx_lenerrs +
+ 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_rrs_errs +
- smb->rx_alignerrs;
+ smb->rx_alignerrs);
}
static int
@@ -2549,7 +2550,7 @@ ale_rxeof(struct ale_softc *sc, int coun
m = m_devget((char *)(rs + 1), length - ETHER_CRC_LEN,
ETHER_ALIGN, ifp, NULL);
if (m == NULL) {
- ifp->if_iqdrops++;
+ if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
ale_rx_update_page(sc, &rx_page, length, &prod);
continue;
}
More information about the svn-src-all
mailing list