Mechanically convert to if_inc_counter().
This commit is contained in:
parent
dde47b5589
commit
1209989c6a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271828
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user