1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

Mechanically convert to if_inc_counter().

This commit is contained in:
Gleb Smirnoff 2014-09-18 21:11:42 +00:00
parent ecc70d3f9e
commit 9bce9009cd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271833

View File

@ -2323,13 +2323,13 @@ alc_watchdog(struct alc_softc *sc)
ifp = sc->alc_ifp; ifp = sc->alc_ifp;
if ((sc->alc_flags & ALC_FLAG_LINK) == 0) { if ((sc->alc_flags & ALC_FLAG_LINK) == 0) {
if_printf(sc->alc_ifp, "watchdog timeout (lost link)\n"); if_printf(sc->alc_ifp, "watchdog timeout (lost link)\n");
ifp->if_oerrors++; if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
alc_init_locked(sc); alc_init_locked(sc);
return; return;
} }
if_printf(sc->alc_ifp, "watchdog timeout -- resetting\n"); if_printf(sc->alc_ifp, "watchdog timeout -- resetting\n");
ifp->if_oerrors++; if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
alc_init_locked(sc); alc_init_locked(sc);
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
@ -2608,11 +2608,11 @@ alc_stats_update(struct alc_softc *sc)
stat->tx_mcast_bytes += smb->tx_mcast_bytes; stat->tx_mcast_bytes += smb->tx_mcast_bytes;
/* Update counters in ifnet. */ /* 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_multi_colls * 2 + smb->tx_late_colls +
smb->tx_abort * HDPX_CFG_RETRY_DEFAULT; smb->tx_abort * HDPX_CFG_RETRY_DEFAULT);
/* /*
* XXX * XXX
@ -2621,15 +2621,16 @@ alc_stats_update(struct alc_softc *sc)
* the counter name is not correct one so I've removed the * the counter name is not correct one so I've removed the
* counter in output errors. * counter in output errors.
*/ */
ifp->if_oerrors += smb->tx_abort + smb->tx_late_colls + if_inc_counter(ifp, IFCOUNTER_OERRORS,
smb->tx_underrun; 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_runts + smb->rx_pkts_truncated +
smb->rx_fifo_oflows + smb->rx_rrs_errs + smb->rx_fifo_oflows + smb->rx_rrs_errs +
smb->rx_alignerrs; smb->rx_alignerrs);
if ((sc->alc_flags & ALC_FLAG_SMB_BUG) == 0) { if ((sc->alc_flags & ALC_FLAG_SMB_BUG) == 0) {
/* Update done, clear. */ /* Update done, clear. */
@ -2921,7 +2922,7 @@ alc_fixup_rx(struct ifnet *ifp, struct mbuf *m)
*/ */
MGETHDR(n, M_NOWAIT, MT_DATA); MGETHDR(n, M_NOWAIT, MT_DATA);
if (n == NULL) { if (n == NULL) {
ifp->if_iqdrops++; if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
m_freem(m); m_freem(m);
return (NULL); return (NULL);
} }
@ -2977,7 +2978,7 @@ alc_rxeof(struct alc_softc *sc, struct rx_rdesc *rrd)
mp = rxd->rx_m; mp = rxd->rx_m;
/* Add a new receive buffer to the ring. */ /* Add a new receive buffer to the ring. */
if (alc_newbuf(sc, rxd) != 0) { if (alc_newbuf(sc, rxd) != 0) {
ifp->if_iqdrops++; if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
/* Reuse Rx buffers. */ /* Reuse Rx buffers. */
if (sc->alc_cdata.alc_rxhead != NULL) if (sc->alc_cdata.alc_rxhead != NULL)
m_freem(sc->alc_cdata.alc_rxhead); m_freem(sc->alc_cdata.alc_rxhead);