Module Name: src Committed By: skrll Date: Tue Feb 4 07:36:55 UTC 2020
Modified Files: src/sys/dev/marvell: if_gfe.c if_mvxpe.c Log Message: Adopt <net/if_stats.h> To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/sys/dev/marvell/if_gfe.c cvs rdiff -u -r1.31 -r1.32 src/sys/dev/marvell/if_mvxpe.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/marvell/if_gfe.c diff -u src/sys/dev/marvell/if_gfe.c:1.54 src/sys/dev/marvell/if_gfe.c:1.55 --- src/sys/dev/marvell/if_gfe.c:1.54 Tue May 28 07:41:49 2019 +++ src/sys/dev/marvell/if_gfe.c Tue Feb 4 07:36:55 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_gfe.c,v 1.54 2019/05/28 07:41:49 msaitoh Exp $ */ +/* $NetBSD: if_gfe.c,v 1.55 2020/02/04 07:36:55 skrll Exp $ */ /* * Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_gfe.c,v 1.54 2019/05/28 07:41:49 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_gfe.c,v 1.55 2020/02/04 07:36:55 skrll Exp $"); #include "opt_inet.h" @@ -747,7 +747,7 @@ gfe_ifwatchdog(struct ifnet *ifp) GE_TXDPRESYNC(sc, txq, curtxdnum); } aprint_error("\n"); - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); (void) gfe_whack(sc, GE_WHACK_RESTART); GE_FUNC_EXIT(sc, ""); } @@ -907,7 +907,7 @@ gfe_rx_get(struct gfe_softc *sc, enum gf GE_DPRINTF(sc, ("!")); --rxq->rxq_active; ifp->if_ipackets++; - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); goto give_it_back; } @@ -1008,7 +1008,7 @@ gfe_rx_process(struct gfe_softc *sc, uin sc->sc_tickflags |= GE_TICK_RX_RESTART; callout_reset(&sc->sc_co, 1, gfe_tick, sc); } - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); GE_DPRINTF(sc, ("%s: rx queue %d filled at %u\n", device_xname(sc->sc_dev), rxprio, rxq->rxq_fi)); memset(masks, 0, sizeof(masks)); @@ -1249,9 +1249,9 @@ gfe_tx_enqueue(struct gfe_softc *sc, enu txq->txq_nactive--; /* statistics */ - ifp->if_opackets++; + if_statinc(ifp, if_opackets); if (cmdsts & TX_STS_ES) - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); GE_DPRINTF(sc, ("%%")); } @@ -1424,9 +1424,9 @@ gfe_tx_done(struct gfe_softc *sc, enum g txq->txq_inptr += roundup(pktlen, dcache_line_size); /* statistics */ - ifp->if_opackets++; + if_statinc(ifp, if_opackets); if (cmdsts & TX_STS_ES) - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); /* txd->ed_bufptr = 0; */ Index: src/sys/dev/marvell/if_mvxpe.c diff -u src/sys/dev/marvell/if_mvxpe.c:1.31 src/sys/dev/marvell/if_mvxpe.c:1.32 --- src/sys/dev/marvell/if_mvxpe.c:1.31 Sat Dec 28 03:07:18 2019 +++ src/sys/dev/marvell/if_mvxpe.c Tue Feb 4 07:36:55 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_mvxpe.c,v 1.31 2019/12/28 03:07:18 gutteridge Exp $ */ +/* $NetBSD: if_mvxpe.c,v 1.32 2020/02/04 07:36:55 skrll Exp $ */ /* * Copyright (c) 2015 Internet Initiative Japan Inc. * All rights reserved. @@ -25,7 +25,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_mvxpe.c,v 1.31 2019/12/28 03:07:18 gutteridge Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_mvxpe.c,v 1.32 2020/02/04 07:36:55 skrll Exp $"); #include "opt_multiprocessor.h" @@ -1709,7 +1709,7 @@ mvxpe_start(struct ifnet *ifp) sc->sc_tx_ring[q].tx_queue_len); DPRINTIFNET(ifp, 1, "a packet is added to tx ring\n"); sc->sc_tx_pending++; - ifp->if_opackets++; + if_statinc(ifp, if_opackets); ifp->if_timer = 1; sc->sc_wdogsoft = 1; bpf_mtap(ifp, m, BPF_D_OUT); @@ -1937,7 +1937,7 @@ mvxpe_watchdog(struct ifnet *ifp) MVXPE_EVCNT_INCR(&sc->sc_ev.ev_drv_wdogsoft); } else { aprint_error_ifnet(ifp, "watchdog timeout\n"); - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); mvxpe_linkreset(sc); mvxpe_sc_unlock(sc); @@ -3270,7 +3270,7 @@ mvxpe_update_mib(struct mvxpe_softc *sc) ifp->if_ierrors += val; break; case MVXPE_MIBEXT_IF_COLLISIONS: - ifp->if_collisions += val; + if_statadd(ifp, if_collisions, val); break; default: break;