Mechanically convert to if_inc_counter().

This commit is contained in:
Gleb Smirnoff 2014-09-18 21:13:12 +00:00
parent d94ca7cf07
commit 499986541b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271835

View file

@ -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 count)
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;
}