diff --git a/sys/arch/acorn32/podulebus/if_ie.c b/sys/arch/acorn32/podulebus/if_ie.c index e688fe33a054..b1ab5663b404 100644 --- a/sys/arch/acorn32/podulebus/if_ie.c +++ b/sys/arch/acorn32/podulebus/if_ie.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ie.c,v 1.44 2019/09/13 07:55:05 msaitoh Exp $ */ +/* $NetBSD: if_ie.c,v 1.45 2020/02/04 07:35:21 skrll Exp $ */ /* * Copyright (c) 1995 Melvin Tang-Richardson. @@ -53,7 +53,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.44 2019/09/13 07:55:05 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.45 2020/02/04 07:35:21 skrll Exp $"); #define IGNORE_ETHER1_IDROM_CHECKSUM @@ -1274,7 +1274,7 @@ ie_read_frame(struct ie_softc *sc, int num) } if ( m==0 ) { - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); return; } @@ -1529,10 +1529,10 @@ ietint(struct ie_softc *sc) printf ( "ietint: command still busy!\n" ); if ( status & IE_STAT_OK ) { - ifp->if_opackets++; - ifp->if_collisions += status & IE_XS_MAXCOLL; + if_statinc(ifp, if_opackets); + if_statadd(ifp, if_collisions, status & IE_XS_MAXCOLL); } else { - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); if ( status & IE_STAT_ABORT ) printf ( "ie: send aborted\n" ); if ( status & IE_XS_LATECOLL ) diff --git a/sys/arch/arm/at91/at91emac.c b/sys/arch/arm/at91/at91emac.c index afaf41be2cb4..cb4e12ded81e 100644 --- a/sys/arch/arm/at91/at91emac.c +++ b/sys/arch/arm/at91/at91emac.c @@ -1,4 +1,4 @@ -/* $NetBSD: at91emac.c,v 1.29 2019/05/28 07:41:46 msaitoh Exp $ */ +/* $NetBSD: at91emac.c,v 1.30 2020/02/04 07:35:34 skrll Exp $ */ /* * Copyright (c) 2007 Embedtronics Oy @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.29 2019/05/28 07:41:46 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.30 2020/02/04 07:35:34 skrll Exp $"); #include #include @@ -245,13 +245,13 @@ emac_intr(void *arg) EMAC_WRITE(ETH_CTL, ctl & ~ETH_CTL_RE); // disable receiver EMAC_WRITE(ETH_RSR, ETH_RSR_BNA); // clear BNA bit EMAC_WRITE(ETH_CTL, ctl | ETH_CTL_RE); // re-enable receiver - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); ifp->if_ipackets++; DPRINTFN(1,("%s: out of receive buffers\n", __FUNCTION__)); } if (isr & ETH_ISR_ROVR) { EMAC_WRITE(ETH_RSR, ETH_RSR_OVR); // clear interrupt - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); ifp->if_ipackets++; DPRINTFN(1,("%s: receive overrun\n", __FUNCTION__)); } @@ -306,7 +306,7 @@ emac_intr(void *arg) if (m != NULL) { m_freem(m); } - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); } sc->rxqi++; } @@ -587,7 +587,7 @@ emac_tick(void *arg) int s; uint32_t misses; - ifp->if_collisions += EMAC_READ(ETH_SCOL) + EMAC_READ(ETH_MCOL); + if_statadd(ifp, if_collisions, EMAC_READ(ETH_SCOL) + EMAC_READ(ETH_MCOL)); /* These misses are ok, they will happen if the RAM/CPU can't keep up */ misses = EMAC_READ(ETH_DRFC); if (misses > 0) diff --git a/sys/arch/arm/gemini/gemini_gmac.c b/sys/arch/arm/gemini/gemini_gmac.c index 293b8961c093..704ca72dbae4 100644 --- a/sys/arch/arm/gemini/gemini_gmac.c +++ b/sys/arch/arm/gemini/gemini_gmac.c @@ -1,4 +1,4 @@ -/* $NetBSD: gemini_gmac.c,v 1.18 2019/10/30 10:12:37 msaitoh Exp $ */ +/* $NetBSD: gemini_gmac.c,v 1.19 2020/02/04 07:35:34 skrll Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. * All rights reserved. @@ -49,7 +49,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: gemini_gmac.c,v 1.18 2019/10/30 10:12:37 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gemini_gmac.c,v 1.19 2020/02/04 07:35:34 skrll Exp $"); #define SWFREEQ_DESCS 256 /* one page worth */ #define HWFREEQ_DESCS 256 /* one page worth */ @@ -546,8 +546,8 @@ gmac_hwqueue_txconsume(gmac_hwqueue_t *hwq, const gmac_desc_t *d) gmac_mapcache_put(hqm->hqm_mc, map); ifp = hwq->hwq_ifp; - ifp->if_opackets++; - ifp->if_obytes += m->m_pkthdr.len; + if_statinc(ifp, if_opackets); + if_statiadd(ifp, if_obytes, m->m_pkthdr.len); aprint_debug("gmac_hwqueue_txconsume(%p): %zu@%p: %s m=%p\n", hwq, d - hwq->hwq_base, d, ifp->if_xname, m); @@ -859,7 +859,7 @@ gmac_hwqueue_rxconsume(gmac_hwqueue_t *hwq, const gmac_desc_t *d) if_percpuq_enqueue(ifp->if_percpuq, m); break; default: - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); m_freem(m); break; } diff --git a/sys/arch/arm/omap/if_cpsw.c b/sys/arch/arm/omap/if_cpsw.c index 504cc5b465ee..d3271ee82e31 100644 --- a/sys/arch/arm/omap/if_cpsw.c +++ b/sys/arch/arm/omap/if_cpsw.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_cpsw.c,v 1.27 2020/02/04 05:15:44 thorpej Exp $ */ +/* $NetBSD: if_cpsw.c,v 1.28 2020/02/04 07:35:34 skrll Exp $ */ /* * Copyright (c) 2013 Jonathan A. Kollasch @@ -53,7 +53,7 @@ */ #include -__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.27 2020/02/04 05:15:44 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.28 2020/02/04 07:35:34 skrll Exp $"); #include #include @@ -621,7 +621,7 @@ cpsw_start(struct ifnet *ifp) device_printf(sc->sc_dev, "won't fit\n"); IFQ_DEQUEUE(&ifp->if_snd, m); m_freem(m); - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); continue; } else if (error != 0) { device_printf(sc->sc_dev, "error\n"); @@ -731,7 +731,7 @@ cpsw_watchdog(struct ifnet *ifp) device_printf(sc->sc_dev, "device timeout\n"); - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); cpsw_init(ifp); cpsw_start(ifp); } @@ -1161,7 +1161,7 @@ cpsw_rxintr(void *arg) if (cpsw_new_rxbuf(sc, i) != 0) { /* drop current packet, reuse buffer for new */ - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); goto next; } @@ -1266,7 +1266,7 @@ cpsw_txintr(void *arg) m_freem(rdp->tx_mb[sc->sc_txhead]); rdp->tx_mb[sc->sc_txhead] = NULL; - ifp->if_opackets++; + if_statinc(ifp, if_opackets); handled = true; diff --git a/sys/arch/emips/ebus/if_le_ebus.c b/sys/arch/emips/ebus/if_le_ebus.c index 6e77a20d19dd..a20dcb18733b 100644 --- a/sys/arch/emips/ebus/if_le_ebus.c +++ b/sys/arch/emips/ebus/if_le_ebus.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_le_ebus.c,v 1.21 2019/12/05 05:28:09 msaitoh Exp $ */ +/* $NetBSD: if_le_ebus.c,v 1.22 2020/02/04 07:35:45 skrll Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.21 2019/12/05 05:28:09 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.22 2020/02/04 07:35:45 skrll Exp $"); #include "opt_inet.h" @@ -693,7 +693,7 @@ enic_rint(struct enic_softc *sc, uint32_t saf, paddr_t phys) /* uhu?? */ printf("%s: bad recv phys %llx\n", device_xname(sc->sc_dev), (long long)phys); - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); return; /* got it, pop it */ @@ -714,7 +714,7 @@ enic_rint(struct enic_softc *sc, uint32_t saf, paddr_t phys) len > ((sc->sc_ethercom.ec_capenable & ETHERCAP_VLAN_MTU) ? ETHER_VLAN_ENCAP_LEN + ETHERMTU + sizeof(struct ether_header) : ETHERMTU + sizeof(struct ether_header))) { - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); /* reuse it */ enic_post_recv(sc, m); @@ -755,7 +755,7 @@ void enic_tint(struct enic_softc *sc, uint32_t saf, paddr_t phys) /* uhu?? */ printf("%s: bad xmit phys %llx\n", device_xname(sc->sc_dev), (long long)phys); - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); return; /* got it, pop it */ @@ -771,7 +771,7 @@ void enic_tint(struct enic_softc *sc, uint32_t saf, paddr_t phys) sc->bxh++; #endif m_freem(m); - ifp->if_opackets++; + if_statinc(ifp, if_opackets); if (--sc->sc_no_td == 0) ifp->if_timer = 0; diff --git a/sys/arch/evbppc/virtex/dev/if_temac.c b/sys/arch/evbppc/virtex/dev/if_temac.c index fb25287be80c..c0a50406d9fe 100644 --- a/sys/arch/evbppc/virtex/dev/if_temac.c +++ b/sys/arch/evbppc/virtex/dev/if_temac.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_temac.c,v 1.15 2019/05/29 06:21:57 msaitoh Exp $ */ +/* $NetBSD: if_temac.c,v 1.16 2020/02/04 07:36:04 skrll Exp $ */ /* * Copyright (c) 2006 Jachym Holecek @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_temac.c,v 1.15 2019/05/29 06:21:57 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_temac.c,v 1.16 2020/02/04 07:36:04 skrll Exp $"); #include @@ -1212,7 +1212,7 @@ temac_rxreap(struct temac_softc *sc) (TEMAC_ISINTR(tail) ? CDMAC_STAT_INTR : 0) | (TEMAC_ISLAST(tail) ? CDMAC_STAT_STOP : 0); - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); continue; } diff --git a/sys/arch/mac68k/nubus/if_netdock_nubus.c b/sys/arch/mac68k/nubus/if_netdock_nubus.c index 59d8a262b349..78881f2e201a 100644 --- a/sys/arch/mac68k/nubus/if_netdock_nubus.c +++ b/sys/arch/mac68k/nubus/if_netdock_nubus.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_netdock_nubus.c,v 1.32 2020/01/29 05:25:42 thorpej Exp $ */ +/* $NetBSD: if_netdock_nubus.c,v 1.33 2020/02/04 07:36:28 skrll Exp $ */ /* * Copyright (C) 2000,2002 Daishi Kato @@ -43,7 +43,7 @@ /***********************/ #include -__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.32 2020/01/29 05:25:42 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.33 2020/02/04 07:36:28 skrll Exp $"); #include #include @@ -674,9 +674,9 @@ netdock_txint(struct netdock_softc *sc) NIC_GET_2(sc, REG_ISR); regdata = NIC_GET_2(sc, REG_DATA); if ((regdata & REG_DATA_BIT_08) == 0) { - /* ifp->if_collisions++; */ + /* if_statinc(ifp, if_collisions); */ if (regdata & REG_DATA_BIT_07) - /* ifp->if_oerrors++; */ + /* if_statinc(ifp, if_oerrors); */ NIC_PUT_2(sc, REG_000E, 0); NIC_ORW(sc, REG_0000, 0x0100); NIC_PUT_2(sc, REG_000E, 0x0200); diff --git a/sys/arch/macppc/dev/am79c950.c b/sys/arch/macppc/dev/am79c950.c index ca4fe906ac94..4be8e5c53c62 100644 --- a/sys/arch/macppc/dev/am79c950.c +++ b/sys/arch/macppc/dev/am79c950.c @@ -1,4 +1,4 @@ -/* $NetBSD: am79c950.c,v 1.47 2019/12/27 09:32:10 msaitoh Exp $ */ +/* $NetBSD: am79c950.c,v 1.48 2020/02/04 07:36:36 skrll Exp $ */ /*- * Copyright (c) 1997 David Huang @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: am79c950.c,v 1.47 2019/12/27 09:32:10 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: am79c950.c,v 1.48 2020/02/04 07:36:36 skrll Exp $"); #include "opt_inet.h" @@ -271,7 +271,7 @@ mcstart(struct ifnet *ifp) ifp->if_flags |= IFF_OACTIVE; maceput(sc, m); - ifp->if_opackets++; /* # of pkts */ + if_statinc(ifp, if_opackets); /* # of pkts */ } } @@ -570,13 +570,13 @@ mace_read(struct mc_softc *sc, uint8_t *pkt, int len) printf("%s: invalid packet size %d; dropping\n", device_xname(sc->sc_dev), len); #endif - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); return; } m = mace_get(sc, pkt, len); if (m == NULL) { - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); return; } diff --git a/sys/arch/macppc/dev/if_bm.c b/sys/arch/macppc/dev/if_bm.c index 1549441d0b47..5e89bf7e6102 100644 --- a/sys/arch/macppc/dev/if_bm.c +++ b/sys/arch/macppc/dev/if_bm.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_bm.c,v 1.61 2019/11/10 21:16:29 chs Exp $ */ +/* $NetBSD: if_bm.c,v 1.62 2020/02/04 07:36:36 skrll Exp $ */ /*- * Copyright (C) 1998, 1999, 2000 Tsubai Masanari. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_bm.c,v 1.61 2019/11/10 21:16:29 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bm.c,v 1.62 2020/02/04 07:36:36 skrll Exp $"); #include "opt_inet.h" @@ -490,7 +490,7 @@ bmac_rint(void *v) m = bmac_get(sc, data, datalen); if (m == NULL) { - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); goto next; } @@ -576,7 +576,7 @@ bmac_start(struct ifnet *ifp) /* 5 seconds to watch for failing to transmit */ ifp->if_timer = 5; - ifp->if_opackets++; /* # of pkts */ + if_statinc(ifp, if_opackets); /* # of pkts */ bmac_transmit_packet(sc, sc->sc_txbuf, tlen); } @@ -680,7 +680,7 @@ bmac_watchdog(struct ifnet *ifp) bmac_reset_bits(sc, TXCFG, TxMACEnable); printf("%s: device timeout\n", ifp->if_xname); - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); bmac_reset(sc); } diff --git a/sys/arch/macppc/dev/if_gm.c b/sys/arch/macppc/dev/if_gm.c index 14bd91bd1462..e82daf94d658 100644 --- a/sys/arch/macppc/dev/if_gm.c +++ b/sys/arch/macppc/dev/if_gm.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_gm.c,v 1.56 2019/11/10 21:16:29 chs Exp $ */ +/* $NetBSD: if_gm.c,v 1.57 2020/02/04 07:36:36 skrll Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_gm.c,v 1.56 2019/11/10 21:16:29 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_gm.c,v 1.57 2020/02/04 07:36:36 skrll Exp $"); #include "opt_inet.h" @@ -362,13 +362,13 @@ gmac_rint(struct gmac_softc *sc) len -= 4; /* CRC */ if (le32toh(dp->cmd_hi) & 0x40000000) { - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); goto next; } m = gmac_get(sc, sc->sc_rxbuf[i], len); if (m == NULL) { - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); goto next; } @@ -458,7 +458,7 @@ gmac_start(struct ifnet *ifp) /* 5 seconds to watch for failing to transmit */ ifp->if_timer = 5; - ifp->if_opackets++; /* # of pkts */ + if_statinc(ifp, if_opackets); /* # of pkts */ i = sc->sc_txnext; buff = sc->sc_txbuf[i]; @@ -823,7 +823,7 @@ gmac_watchdog(struct ifnet *ifp) struct gmac_softc *sc = ifp->if_softc; printf("%s: device timeout\n", ifp->if_xname); - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); gmac_reset(sc); gmac_init(sc); diff --git a/sys/arch/newsmips/apbus/if_sn.c b/sys/arch/newsmips/apbus/if_sn.c index cf97c797a147..76bc0e910df6 100644 --- a/sys/arch/newsmips/apbus/if_sn.c +++ b/sys/arch/newsmips/apbus/if_sn.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_sn.c,v 1.46 2019/09/13 07:55:06 msaitoh Exp $ */ +/* $NetBSD: if_sn.c,v 1.47 2020/02/04 07:36:42 skrll Exp $ */ /* * National Semiconductor DP8393X SONIC Driver @@ -16,7 +16,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.46 2019/09/13 07:55:06 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.47 2020/02/04 07:36:42 skrll Exp $"); #include "opt_inet.h" @@ -347,7 +347,7 @@ outloop: sc->mtd_prev = sc->mtd_free; sc->mtd_free = mtd_next; - ifp->if_opackets++; /* # of pkts */ + if_statinc(ifp, if_opackets); /* # of pkts */ /* Jump back for possibly more punishment. */ goto outloop; @@ -916,11 +916,11 @@ sonictxint(struct sn_softc *sc) txp_status = SRO(sc->bitmode, txp, TXP_STATUS); - ifp->if_collisions += (txp_status & TCR_EXC) ? 16 : - ((txp_status & TCR_NC) >> 12); + if_statadd(ifp, if_collisions, (txp_status & TCR_EXC) ? 16 : + ((txp_status & TCR_NC) >> 12)); if ((txp_status & TCR_PTX) == 0) { - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); printf("%s: Tx packet status=0x%x\n", device_xname(sc->sc_dev), txp_status); diff --git a/sys/dev/ic/am79900.c b/sys/dev/ic/am79900.c index 6b578c70987d..4b480d0b6797 100644 --- a/sys/dev/ic/am79900.c +++ b/sys/dev/ic/am79900.c @@ -1,4 +1,4 @@ -/* $NetBSD: am79900.c,v 1.28 2018/06/26 06:48:00 msaitoh Exp $ */ +/* $NetBSD: am79900.c,v 1.29 2020/02/04 07:36:50 skrll Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -103,7 +103,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: am79900.c,v 1.28 2018/06/26 06:48:00 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: am79900.c,v 1.29 2020/02/04 07:36:50 skrll Exp $"); #include #include @@ -278,12 +278,12 @@ am79900_rint(struct lance_softc *sc) if (rmd.rmd1 & LE_R1_BUFF) printf("%s: receive buffer error\n", device_xname(sc->sc_dev)); - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); } else if ((rmd.rmd1 & (LE_R1_STP | LE_R1_ENP)) != (LE_R1_STP | LE_R1_ENP)) { printf("%s: dropping chained buffer\n", device_xname(sc->sc_dev)); - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); } else { #ifdef LEDEBUG if (sc->sc_debug) @@ -360,22 +360,22 @@ am79900_tint(struct lance_softc *sc) device_xname(sc->sc_dev)); } if (tmd.tmd2 & LE_T2_LCOL) - ifp->if_collisions++; + if_statinc(ifp, if_collisions); if (tmd.tmd2 & LE_T2_RTRY) { #ifdef LEDEBUG printf("%s: excessive collisions\n", device_xname(sc->sc_dev)); #endif - ifp->if_collisions += 16; + if_statadd(ifp, if_collisions, 16); } - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); } else { if (tmd.tmd1 & LE_T1_ONE) - ifp->if_collisions++; + if_statinc(ifp, if_collisions); else if (tmd.tmd1 & LE_T1_MORE) /* Real number is unknown. */ - ifp->if_collisions += 2; - ifp->if_opackets++; + if_statadd(ifp, if_collisions, 2); + if_statinc(ifp, if_opackets); } if (++bix == sc->sc_ntbuf) @@ -419,20 +419,20 @@ am79900_intr(void *arg) #ifdef LEDEBUG printf("%s: babble\n", device_xname(sc->sc_dev)); #endif - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); } #if 0 if (isr & LE_C0_CERR) { printf("%s: collision error\n", device_xname(sc->sc_dev)); - ifp->if_collisions++; + if_statinc(ifp, if_collisions); } #endif if (isr & LE_C0_MISS) { #ifdef LEDEBUG printf("%s: missed packet\n", device_xname(sc->sc_dev)); #endif - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); } if (isr & LE_C0_MERR) { printf("%s: memory error\n", device_xname(sc->sc_dev)); @@ -443,13 +443,13 @@ am79900_intr(void *arg) if ((isr & LE_C0_RXON) == 0) { printf("%s: receiver disabled\n", device_xname(sc->sc_dev)); - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); lance_reset(sc); return (1); } if ((isr & LE_C0_TXON) == 0) { printf("%s: transmitter disabled\n", device_xname(sc->sc_dev)); - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); lance_reset(sc); return (1); } diff --git a/sys/dev/marvell/if_gfe.c b/sys/dev/marvell/if_gfe.c index d415dff2b1a3..f9ff0326e4a5 100644 --- a/sys/dev/marvell/if_gfe.c +++ b/sys/dev/marvell/if_gfe.c @@ -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 -__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 gfe_rxprio rxprio) 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, uint32_t cause, uint32_t intrmask) 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, enum gfe_txprio txprio) 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 gfe_txprio txprio, uint32_t intrmask) 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; */ diff --git a/sys/dev/marvell/if_mvxpe.c b/sys/dev/marvell/if_mvxpe.c index 67f6d302b46b..c7dce6c18a5c 100644 --- a/sys/dev/marvell/if_mvxpe.c +++ b/sys/dev/marvell/if_mvxpe.c @@ -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 -__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; diff --git a/sys/dev/pci/if_kse.c b/sys/dev/pci/if_kse.c index 868c08b84f0b..112b2414cc0a 100644 --- a/sys/dev/pci/if_kse.c +++ b/sys/dev/pci/if_kse.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_kse.c,v 1.47 2020/01/06 07:57:06 nisimura Exp $ */ +/* $NetBSD: if_kse.c,v 1.48 2020/02/04 07:37:00 skrll Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1.47 2020/01/06 07:57:06 nisimura Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1.48 2020/02/04 07:37:00 skrll Exp $"); #include #include @@ -934,7 +934,7 @@ kse_watchdog(struct ifnet *ifp) aprint_error_dev(sc->sc_dev, "device timeout (txfree %d txsfree %d txnext %d)\n", sc->sc_txfree, sc->sc_txsfree, sc->sc_txnext); - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); /* Reset the interface. */ kse_init(ifp); @@ -1269,7 +1269,7 @@ rxintr(struct kse_softc *sc) /* R0_FS | R0_LS must have been marked for this desc */ if (rxstat & R0_ES) { - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); #define PRINTERR(bit, str) \ if (rxstat & (bit)) \ aprint_error_dev(sc->sc_dev, \ @@ -1292,7 +1292,7 @@ rxintr(struct kse_softc *sc) m = rxs->rxs_mbuf; if (add_rxbuf(sc, i) != 0) { - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); KSE_INIT_RXDESC(sc, i); bus_dmamap_sync(sc->sc_dmat, rxs->rxs_dmamap, 0, @@ -1347,7 +1347,7 @@ txreap(struct kse_softc *sc) /* There is no way to tell transmission status per frame */ - ifp->if_opackets++; + if_statinc(ifp, if_opackets); sc->sc_txfree += txs->txs_ndesc; bus_dmamap_sync(sc->sc_dmat, txs->txs_dmamap, diff --git a/sys/dev/pci/if_rge.c b/sys/dev/pci/if_rge.c index 4877b5ef85cf..0e7ef7417b2f 100644 --- a/sys/dev/pci/if_rge.c +++ b/sys/dev/pci/if_rge.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_rge.c,v 1.3 2020/01/12 23:22:12 sevan Exp $ */ +/* $NetBSD: if_rge.c,v 1.4 2020/02/04 07:37:00 skrll Exp $ */ /* $OpenBSD: if_rge.c,v 1.2 2020/01/02 09:00:45 kevlo Exp $ */ /* @@ -18,7 +18,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.3 2020/01/12 23:22:12 sevan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.4 2020/02/04 07:37:00 skrll Exp $"); /* #include "bpfilter.h" Sevan */ /* #include "vlan.h" Sevan */ @@ -599,7 +599,7 @@ rge_watchdog(struct ifnet *ifp) struct rge_softc *sc = ifp->if_softc; printf("%s: watchdog timeout\n", sc->sc_dev.dv_xname); - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); rge_init(ifp); } @@ -1189,7 +1189,7 @@ rge_rxeof(struct rge_softc *sc) } if (rxstat & RGE_RDCMDSTS_RXERRSUM) { - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); /* * If this is part of a multi-fragment packet, * discard all the pieces. @@ -1307,9 +1307,9 @@ rge_txeof(struct rge_softc *sc) txq->txq_mbuf = NULL; if (txstat & (RGE_TDCMDSTS_EXCESSCOLL | RGE_TDCMDSTS_COLL)) - ifp->if_collisions++; + if_statinc(ifp, if_collisions); if (txstat & RGE_TDCMDSTS_TXERR) - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); bus_dmamap_sync(sc->sc_dmat, sc->rge_ldata.rge_tx_list_map, idx * sizeof(struct rge_tx_desc), diff --git a/sys/dev/ppbus/if_plip.c b/sys/dev/ppbus/if_plip.c index 8994e7270781..17fef84e0b71 100644 --- a/sys/dev/ppbus/if_plip.c +++ b/sys/dev/ppbus/if_plip.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_plip.c,v 1.34 2019/11/10 21:16:37 chs Exp $ */ +/* $NetBSD: if_plip.c,v 1.35 2020/02/04 07:37:06 skrll Exp $ */ /*- * Copyright (c) 1997 Poul-Henning Kamp @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_plip.c,v 1.34 2019/11/10 21:16:37 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_plip.c,v 1.35 2020/02/04 07:37:06 skrll Exp $"); /* * Parallel port TCP/IP interfaces added. I looked at the driver from @@ -656,7 +656,7 @@ end: err: /* Return to idle state */ ppbus_wdtr(ppbus, 0); - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); sc->sc_iferrs++; LP_PRINTF("R"); /* Disable interface if there are too many errors */ @@ -735,7 +735,7 @@ lpoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, if ((ifp->if_flags & IFF_OACTIVE) == 0) lpstart(ifp); } else { - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); sc->sc_iferrs++; LP_PRINTF("Q"); @@ -908,7 +908,7 @@ nend: /* Go quiescent */ ppbus_wdtr(ppbus, 0); - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); lp->sc_iferrs++; LP_PRINTF("X"); @@ -925,8 +925,8 @@ nend: IFQ_DEQUEUE(&ifp->if_snd, m); if(ifp->if_bpf) lptap(ifp, m, BPF_D_OUT); - ifp->if_opackets++; - ifp->if_obytes += m->m_pkthdr.len; + if_statinc(ifp, if_opackets); + if_statadd(ifp, if_obytes, m->m_pkthdr.len); m_freem(m); } } diff --git a/sys/dev/qbus/if_dmc.c b/sys/dev/qbus/if_dmc.c index a8997037bcf2..083ab3c208df 100644 --- a/sys/dev/qbus/if_dmc.c +++ b/sys/dev/qbus/if_dmc.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_dmc.c,v 1.26 2016/07/20 07:37:51 ozaki-r Exp $ */ +/* $NetBSD: if_dmc.c,v 1.27 2020/02/04 07:37:11 skrll Exp $ */ /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_dmc.c,v 1.26 2016/07/20 07:37:51 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_dmc.c,v 1.27 2020/02/04 07:37:11 skrll Exp $"); #undef DMCDEBUG /* for base table dump on fatal error */ @@ -595,7 +595,7 @@ dmcxint(void *a) len = (arg & DMC_CCOUNT) - sizeof (struct dmc_header); if (len < 0 || len > DMCMTU) { - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); #ifdef DMCDEBUG printd("%s: bad rcv pkt addr 0x%x len 0x%x\n", device_xname(sc->sc_dev), pkaddr, len); @@ -653,7 +653,7 @@ dmcxint(void *a) * A write has completed, start another * transfer if there is more data to send. */ - ifp->if_opackets++; + if_statinc(ifp, if_opackets); /* find associated dmcbuf structure */ ifxp = &sc->sc_ifw[0]; for (rp = &sc->sc_xbufs[0]; rp < &sc->sc_xbufs[NXMT]; rp++) { @@ -704,7 +704,7 @@ dmcxint(void *a) /* ACCUMULATE STATISTICS */ switch(arg) { case DMC_NOBUFS: - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); if ((sc->sc_nobuf++ % DMC_RPNBFS) == 0) goto report; break; @@ -717,7 +717,7 @@ dmcxint(void *a) goto report; break; case DMC_DATACK: - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); if ((sc->sc_datck++ % DMC_RPDCK) == 0) goto report; break; diff --git a/sys/dev/usb/if_urndis.c b/sys/dev/usb/if_urndis.c index 8449b5702fe5..f65aa1aefccd 100644 --- a/sys/dev/usb/if_urndis.c +++ b/sys/dev/usb/if_urndis.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_urndis.c,v 1.36 2020/01/29 06:39:07 thorpej Exp $ */ +/* $NetBSD: if_urndis.c,v 1.37 2020/02/04 07:37:16 skrll Exp $ */ /* $OpenBSD: if_urndis.c,v 1.31 2011/07/03 15:47:17 matthew Exp $ */ /* @@ -21,7 +21,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_urndis.c,v 1.36 2020/01/29 06:39:07 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_urndis.c,v 1.37 2020/02/04 07:37:16 skrll Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -847,7 +847,7 @@ urndis_watchdog(struct ifnet *ifp) if (un->un_dying) return; - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); printf("%s: watchdog timeout\n", DEVNAME(un)); urndis_ctrl_keepalive(un);