Date: Fri, 19 Sep 2014 03:51:27 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271849 - in head/sys/dev: ae altera/atse an bwi bwn cadence ce cm cp ctau cx dc de ed en ex fatm firewire gxemul/ether hatm hyperv/netvsc if_ndis iicbus ipw iwi iwn le lge malo mge net... Message-ID: <201409190351.s8J3pRlr055922@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Fri Sep 19 03:51:26 2014 New Revision: 271849 URL: http://svnweb.freebsd.org/changeset/base/271849 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/ae/if_ae.c head/sys/dev/altera/atse/if_atse.c head/sys/dev/an/if_an.c head/sys/dev/bwi/if_bwi.c head/sys/dev/bwn/if_bwn.c head/sys/dev/cadence/if_cgem.c head/sys/dev/ce/if_ce.c head/sys/dev/cm/smc90cx6.c head/sys/dev/cp/if_cp.c head/sys/dev/ctau/if_ct.c head/sys/dev/cx/if_cx.c head/sys/dev/dc/if_dc.c head/sys/dev/de/if_de.c head/sys/dev/ed/if_ed.c head/sys/dev/en/midway.c head/sys/dev/ex/if_ex.c head/sys/dev/fatm/if_fatm.c head/sys/dev/firewire/if_fwe.c head/sys/dev/firewire/if_fwip.c head/sys/dev/gxemul/ether/if_gx.c head/sys/dev/hatm/if_hatm_rx.c head/sys/dev/hatm/if_hatm_tx.c head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/if_ndis/if_ndis.c head/sys/dev/iicbus/if_ic.c head/sys/dev/ipw/if_ipw.c head/sys/dev/iwi/if_iwi.c head/sys/dev/iwn/if_iwn.c head/sys/dev/le/am7990.c head/sys/dev/le/am79900.c head/sys/dev/le/lance.c head/sys/dev/lge/if_lge.c head/sys/dev/malo/if_malo.c head/sys/dev/mge/if_mge.c head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c head/sys/dev/netmap/if_lem_netmap.h head/sys/dev/netmap/if_re_netmap.h head/sys/dev/oce/oce_if.c head/sys/dev/patm/if_patm_rx.c head/sys/dev/patm/if_patm_tx.c head/sys/dev/ppbus/if_plip.c head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_isr.c head/sys/dev/qlxge/qls_isr.c head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2661.c head/sys/dev/ral/rt2860.c head/sys/dev/re/if_re.c head/sys/dev/rt/if_rt.c head/sys/dev/sbni/if_sbni.c head/sys/dev/sge/if_sge.c head/sys/dev/sk/if_sk.c head/sys/dev/sn/if_sn.c head/sys/dev/ste/if_ste.c head/sys/dev/tsec/if_tsec.c head/sys/dev/vx/if_vx.c head/sys/dev/vxge/vxge.c head/sys/dev/wb/if_wb.c head/sys/dev/wl/if_wl.c head/sys/dev/wpi/if_wpi.c head/sys/dev/wtap/if_wtap.c head/sys/dev/xe/if_xe.c head/sys/dev/xen/netback/netback.c head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/ae/if_ae.c Fri Sep 19 03:51:26 2014 (r271849) @@ -1852,9 +1852,9 @@ ae_tx_intr(ae_softc_t *sc) sizeof(ae_txs_t) + 3) & ~3) % AE_TXD_BUFSIZE_DEFAULT; if ((flags & AE_TXS_SUCCESS) != 0) - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); else - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); sc->tx_inproc--; } @@ -1897,13 +1897,13 @@ ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd) size = le16toh(rxd->len) - ETHER_CRC_LEN; if (size < (ETHER_MIN_LEN - ETHER_CRC_LEN - ETHER_VLAN_ENCAP_LEN)) { if_printf(ifp, "Runt frame received."); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } m = m_devget(&rxd->data[0], size, ETHER_ALIGN, ifp, NULL); if (m == NULL) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return; } @@ -1913,7 +1913,7 @@ ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd) m->m_flags |= M_VLANTAG; } - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); /* * Pass it through. */ @@ -1959,7 +1959,7 @@ ae_rx_intr(ae_softc_t *sc) if ((flags & AE_RXD_SUCCESS) != 0) ae_rxeof(sc, rxd); else - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } if (count > 0) { @@ -1989,7 +1989,7 @@ ae_watchdog(ae_softc_t *sc) else if_printf(ifp, "watchdog timeout - resetting.\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ae_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) Modified: head/sys/dev/altera/atse/if_atse.c ============================================================================== --- head/sys/dev/altera/atse/if_atse.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/altera/atse/if_atse.c Fri Sep 19 03:51:26 2014 (r271849) @@ -1159,7 +1159,7 @@ atse_watchdog(struct atse_softc *sc) return; device_printf(sc->atse_dev, "watchdog timeout\n"); - sc->atse_ifp->if_oerrors++; + if_inc_counter(sc->atse_ifp, IFCOUNTER_OERRORS, 1); atse_intr_debug(sc, "poll"); @@ -1263,7 +1263,7 @@ outer: atse_update_rx_err(sc, ((meta & A_ONCHIP_FIFO_MEM_CORE_ERROR_MASK) >> A_ONCHIP_FIFO_MEM_CORE_ERROR_SHIFT) & 0xff); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); sc->atse_rx_buf_len = 0; /* * Should still read till EOP or next SOP. @@ -1292,7 +1292,7 @@ outer: "without empty buffer: %u\n", __func__, sc->atse_rx_buf_len); /* XXX-BZ any better counter? */ - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } if ((sc->atse_flags & ATSE_FLAGS_SOP_SEEN) == 0) @@ -1311,7 +1311,7 @@ outer: * XXX-BZ Error. We need more mbufs and are * not setup for this yet. */ - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); sc->atse_flags |= ATSE_FLAGS_ERROR; } if ((sc->atse_flags & ATSE_FLAGS_ERROR) == 0) @@ -1330,7 +1330,7 @@ outer: A_ONCHIP_FIFO_MEM_CORE_EMPTY_SHIFT; sc->atse_rx_buf_len += (4 - empty); - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); rx_npkts++; m = sc->atse_rx_m; @@ -1414,7 +1414,7 @@ atse_rx_intr(void *arg) atse_update_rx_err(sc, ((rxe & A_ONCHIP_FIFO_MEM_CORE_ERROR_MASK) >> A_ONCHIP_FIFO_MEM_CORE_ERROR_SHIFT) & 0xff); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } /* @@ -1469,7 +1469,7 @@ atse_tx_intr(void *arg) if (txe & (A_ONCHIP_FIFO_MEM_CORE_EVENT_OVERFLOW| A_ONCHIP_FIFO_MEM_CORE_EVENT_UNDERFLOW)) { /* XXX-BZ ERROR HANDLING. */ - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } /* @@ -1527,12 +1527,12 @@ atse_poll(struct ifnet *ifp, enum poll_c atse_update_rx_err(sc, ((rx & A_ONCHIP_FIFO_MEM_CORE_ERROR_MASK) >> A_ONCHIP_FIFO_MEM_CORE_ERROR_SHIFT) & 0xff); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } if (tx & (A_ONCHIP_FIFO_MEM_CORE_EVENT_OVERFLOW| A_ONCHIP_FIFO_MEM_CORE_EVENT_UNDERFLOW)) { /* XXX-BZ ERROR HANDLING. */ - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } if (ATSE_TX_READ_FILL_LEVEL(sc) == 0) sc->atse_watchdog_timer = 0; Modified: head/sys/dev/an/if_an.c ============================================================================== --- head/sys/dev/an/if_an.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/an/if_an.c Fri Sep 19 03:51:26 2014 (r271849) @@ -872,7 +872,7 @@ an_rxeof(struct an_softc *sc) /* read header */ if (an_read_data(sc, id, 0x0, (caddr_t)&rx_frame, sizeof(rx_frame))) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } @@ -895,7 +895,7 @@ an_rxeof(struct an_softc *sc) if_printf(ifp, "oversized packet " "received (%d, %d)\n", len, MCLBYTES); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } @@ -921,7 +921,7 @@ an_rxeof(struct an_softc *sc) if_printf(ifp, "oversized packet " "received (%d, %d)\n", len, MCLBYTES); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } @@ -940,13 +940,13 @@ an_rxeof(struct an_softc *sc) } else { MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } MCLGET(m, M_NOWAIT); if (!(m->m_flags & M_EXT)) { m_freem(m); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } m->m_pkthdr.rcvif = ifp; @@ -957,7 +957,7 @@ an_rxeof(struct an_softc *sc) if (an_read_data(sc, id, 0, (caddr_t)&rx_frame, sizeof(rx_frame))) { m_freem(m); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } #endif @@ -966,12 +966,12 @@ an_rxeof(struct an_softc *sc) (caddr_t)&rx_frame_802_3, sizeof(rx_frame_802_3))) { m_freem(m); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } if (rx_frame_802_3.an_rx_802_3_status != 0) { m_freem(m); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } /* Check for insane frame length */ @@ -981,7 +981,7 @@ an_rxeof(struct an_softc *sc) if_printf(ifp, "oversized packet " "received (%d, %d)\n", len, MCLBYTES); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } m->m_pkthdr.len = m->m_len = @@ -1001,10 +1001,10 @@ an_rxeof(struct an_softc *sc) if (error) { m_freem(m); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); /* Receive packet. */ #ifdef ANCACHE @@ -1031,13 +1031,13 @@ an_rxeof(struct an_softc *sc) MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } MCLGET(m, M_NOWAIT); if (!(m->m_flags & M_EXT)) { m_freem(m); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } m->m_pkthdr.rcvif = ifp; @@ -1061,7 +1061,7 @@ an_rxeof(struct an_softc *sc) if_printf(ifp, "oversized packet " "received (%d, %d)\n", len, MCLBYTES); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } @@ -1073,7 +1073,7 @@ an_rxeof(struct an_softc *sc) bcopy(buf, (char *)eh, m->m_pkthdr.len); - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); /* Receive packet. */ #if 0 @@ -1126,9 +1126,9 @@ an_txeof(struct an_softc *sc, int status id = CSR_READ_2(sc, AN_TX_CMP_FID(sc->mpi350)); if (status & AN_EV_TX_EXC) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } else - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); for (i = 0; i < AN_TX_RING_CNT; i++) { if (id == sc->an_rdata.an_tx_ring[i]) { @@ -1142,9 +1142,9 @@ an_txeof(struct an_softc *sc, int status id = CSR_READ_2(sc, AN_TX_CMP_FID(sc->mpi350)); if (!sc->an_rdata.an_tx_empty){ if (status & AN_EV_TX_EXC) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } else - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); AN_INC(sc->an_rdata.an_tx_cons, AN_MAX_TX_DESC); if (sc->an_rdata.an_tx_prod == sc->an_rdata.an_tx_cons) @@ -2962,7 +2962,7 @@ an_watchdog(struct an_softc *sc) an_init_mpi350_desc(sc); an_init_locked(sc); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } int Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/bwi/if_bwi.c Fri Sep 19 03:51:26 2014 (r271849) @@ -1401,7 +1401,7 @@ bwi_start_locked(struct ifnet *ifp) if (k == NULL) { ieee80211_free_node(ni); m_freem(m); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } } @@ -1411,7 +1411,7 @@ bwi_start_locked(struct ifnet *ifp) /* 'm' is freed in bwi_encap() if we reach here */ if (ni != NULL) ieee80211_free_node(ni); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } @@ -1419,7 +1419,7 @@ bwi_start_locked(struct ifnet *ifp) tbd->tbd_used++; idx = (idx + 1) % BWI_TX_NDESC; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); if (tbd->tbd_used + BWI_TX_NSPRDESC >= BWI_TX_NDESC) { ifp->if_drv_flags |= IFF_DRV_OACTIVE; @@ -1466,7 +1466,7 @@ bwi_raw_xmit(struct ieee80211_node *ni, error = bwi_encap_raw(sc, idx, m, ni, params); } if (error == 0) { - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); if (++tbd->tbd_used + BWI_TX_NSPRDESC >= BWI_TX_NDESC) ifp->if_drv_flags |= IFF_DRV_OACTIVE; tbd->tbd_idx = (idx + 1) % BWI_TX_NDESC; @@ -1474,7 +1474,7 @@ bwi_raw_xmit(struct ieee80211_node *ni, } else { /* NB: m is reclaimed on encap failure */ ieee80211_free_node(ni); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } BWI_UNLOCK(sc); return error; @@ -1491,7 +1491,7 @@ bwi_watchdog(void *arg) BWI_ASSERT_LOCKED(sc); if (sc->sc_tx_timer != 0 && --sc->sc_tx_timer == 0) { if_printf(ifp, "watchdog timeout\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); taskqueue_enqueue(sc->sc_tq, &sc->sc_restart_task); } callout_reset(&sc->sc_watchdog_timer, hz, bwi_watchdog, sc); @@ -2639,7 +2639,7 @@ bwi_rxeof(struct bwi_softc *sc, int end_ BUS_DMASYNC_POSTREAD); if (bwi_newbuf(sc, idx, 0)) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto next; } @@ -2655,7 +2655,7 @@ bwi_rxeof(struct bwi_softc *sc, int end_ if (buflen < BWI_FRAME_MIN_LEN(wh_ofs)) { if_printf(ifp, "%s: zero length data, hdr_extra %d\n", __func__, hdr_extra); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m_freem(m); goto next; } Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/bwn/if_bwn.c Fri Sep 19 03:51:26 2014 (r271849) @@ -1311,7 +1311,7 @@ bwn_start_locked(struct ifnet *ifp) if (ni == NULL) { device_printf(sc->sc_dev, "unexpected NULL ni\n"); m_freem(m); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } KASSERT(ni != NULL, ("%s:%d: fail", __func__, __LINE__)); @@ -1321,7 +1321,7 @@ bwn_start_locked(struct ifnet *ifp) if (k == NULL) { ieee80211_free_node(ni); m_freem(m); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } } @@ -1330,7 +1330,7 @@ bwn_start_locked(struct ifnet *ifp) if (bwn_tx_start(sc, ni, m) != 0) { if (ni != NULL) ieee80211_free_node(ni); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } @@ -1587,7 +1587,7 @@ bwn_watchdog(void *arg) if (sc->sc_watchdog_timer != 0 && --sc->sc_watchdog_timer == 0) { if_printf(ifp, "device timeout\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } callout_schedule(&sc->sc_watchdog_ch, hz); } @@ -2748,7 +2748,7 @@ bwn_raw_xmit(struct ieee80211_node *ni, if (bwn_tx_isfull(sc, m)) { ieee80211_free_node(ni); m_freem(m); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); BWN_UNLOCK(sc); return (ENOBUFS); } @@ -2756,7 +2756,7 @@ bwn_raw_xmit(struct ieee80211_node *ni, if (bwn_tx_start(sc, ni, m) != 0) { if (ni != NULL) ieee80211_free_node(ni); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } sc->sc_watchdog_timer = 5; BWN_UNLOCK(sc); @@ -8929,14 +8929,14 @@ bwn_dma_rxeof(struct bwn_dma_ring *dr, i m = meta->mt_m; if (bwn_dma_newbuf(dr, desc, meta, 0)) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } rxhdr = mtod(m, struct bwn_rxhdr4 *); len = le16toh(rxhdr->frame_len); if (len <= 0) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } if (bwn_dma_check_redzone(dr, m)) { @@ -9366,7 +9366,7 @@ bwn_rxeof(struct bwn_mac *mac, struct mb rssi = rxhdr->phy.abg.rssi; /* XXX incorrect RSSI calculation? */ noise = mac->mac_stats.link_noise; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); BWN_UNLOCK(sc); @@ -9441,7 +9441,7 @@ bwn_dma_handle_txeof(struct bwn_mac *mac dr->dr_usedslot--; if (meta->mt_islast) { - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); break; } slot = bwn_dma_nextslot(dr, slot); @@ -9487,7 +9487,7 @@ bwn_pio_handle_txeof(struct bwn_mac *mac tp->tp_m = NULL; TAILQ_INSERT_TAIL(&tq->tq_pktlist, tp, tp_list); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); sc->sc_watchdog_timer = 0; if (tq->tq_stop) { Modified: head/sys/dev/cadence/if_cgem.c ============================================================================== --- head/sys/dev/cadence/if_cgem.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/cadence/if_cgem.c Fri Sep 19 03:51:26 2014 (r271849) @@ -558,7 +558,7 @@ cgem_recv(struct cgem_softc *sc) (CGEM_RXDESC_SOF | CGEM_RXDESC_EOF)) { /* discard. */ m_free(m); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); continue; } @@ -604,7 +604,7 @@ cgem_recv(struct cgem_softc *sc) m = m_hd; m_hd = m_hd->m_next; m->m_next = NULL; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); (*ifp->if_input)(ifp, m); } CGEM_LOCK(sc); @@ -646,9 +646,9 @@ cgem_clean_tx(struct cgem_softc *sc) sc->txring[sc->txring_tl_ptr].addr); } else if ((ctl & (CGEM_TXDESC_RETRY_ERR | CGEM_TXDESC_LATE_COLL)) != 0) { - sc->ifp->if_oerrors++; + if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, 1); } else - sc->ifp->if_opackets++; + if_inc_counter(sc->ifp, IFCOUNTER_OPACKETS, 1); /* If the packet spanned more than one tx descriptor, * skip descriptors until we find the end so that only @@ -821,16 +821,16 @@ cgem_poll_hw_stats(struct cgem_softc *sc n = RD4(sc, CGEM_SINGLE_COLL_FRAMES); sc->stats.tx_single_collisn += n; - sc->ifp->if_collisions += n; + if_inc_counter(sc->ifp, IFCOUNTER_COLLISIONS, n); n = RD4(sc, CGEM_MULTI_COLL_FRAMES); sc->stats.tx_multi_collisn += n; - sc->ifp->if_collisions += n; + if_inc_counter(sc->ifp, IFCOUNTER_COLLISIONS, n); n = RD4(sc, CGEM_EXCESSIVE_COLL_FRAMES); sc->stats.tx_excsv_collisn += n; - sc->ifp->if_collisions += n; + if_inc_counter(sc->ifp, IFCOUNTER_COLLISIONS, n); n = RD4(sc, CGEM_LATE_COLL); sc->stats.tx_late_collisn += n; - sc->ifp->if_collisions += n; + if_inc_counter(sc->ifp, IFCOUNTER_COLLISIONS, n); sc->stats.tx_deferred_frames += RD4(sc, CGEM_DEFERRED_TX_FRAMES); sc->stats.tx_carrier_sense_errs += RD4(sc, CGEM_CARRIER_SENSE_ERRS); Modified: head/sys/dev/ce/if_ce.c ============================================================================== --- head/sys/dev/ce/if_ce.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/ce/if_ce.c Fri Sep 19 03:51:26 2014 (r271849) @@ -1097,7 +1097,7 @@ static void ce_transmit (ce_chan_t *c, v d->timeout = 0; #ifndef NETGRAPH - ++d->ifp->if_opackets; + if_inc_counter(d->ifp, IFCOUNTER_OPACKETS, 1); #if __FreeBSD_version >= 600034 d->ifp->if_flags &= ~IFF_DRV_OACTIVE; #else @@ -1119,7 +1119,7 @@ static void ce_receive (ce_chan_t *c, un if (! m) { CE_DEBUG (d, ("no memory for packet\n")); #ifndef NETGRAPH - ++d->ifp->if_iqdrops; + if_inc_counter(d->ifp, IFCOUNTER_IQDROPS, 1); #endif return; } @@ -1129,7 +1129,7 @@ static void ce_receive (ce_chan_t *c, un m->m_pkthdr.rcvif = 0; IF_ENQUEUE(&d->rqueue, m); #else - ++d->ifp->if_ipackets; + if_inc_counter(d->ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = d->ifp; /* Check if there's a BPF listener on this interface. * If so, hand off the raw packet to bpf. */ @@ -1151,33 +1151,33 @@ static void ce_error (ce_chan_t *c, int case CE_FRAME: CE_DEBUG (d, ("frame error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CE_CRC: CE_DEBUG (d, ("crc error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CE_OVERRUN: CE_DEBUG (d, ("overrun error\n")); #ifndef NETGRAPH - ++d->ifp->if_collisions; - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_COLLISIONS, 1); + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CE_OVERFLOW: CE_DEBUG (d, ("overflow error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CE_UNDERRUN: CE_DEBUG (d, ("underrun error\n")); d->timeout = 0; #ifndef NETGRAPH - ++d->ifp->if_oerrors; + if_inc_counter(d->ifp, IFCOUNTER_OERRORS, 1); #if __FreeBSD_version >= 600034 d->ifp->if_flags &= ~IFF_DRV_OACTIVE; #else Modified: head/sys/dev/cm/smc90cx6.c ============================================================================== --- head/sys/dev/cm/smc90cx6.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/cm/smc90cx6.c Fri Sep 19 03:51:26 2014 (r271849) @@ -512,7 +512,7 @@ cm_srint_locked(vsc) * count it as input error (we dont have any other * detectable) */ - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto cleanup; } @@ -544,13 +544,13 @@ cm_srint_locked(vsc) /* Insist on getting a cluster */ if ((m->m_flags & M_EXT) == 0) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto cleanup; } } if (m == 0) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto cleanup; } @@ -572,7 +572,7 @@ cm_srint_locked(vsc) CM_LOCK(sc); m = NULL; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); cleanup: @@ -620,7 +620,7 @@ cm_tint_locked(sc, isr) */ if (isr & CM_TMA || sc->sc_broadcast[buffer]) - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); #ifdef CMRETRANSMIT else if (ifp->if_flags & IFF_LINK2 && sc->sc_timer > 0 && --sc->sc_retransmits[buffer] > 0) { @@ -630,7 +630,7 @@ cm_tint_locked(sc, isr) } #endif else - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); /* We know we can accept another buffer at this point. */ @@ -730,7 +730,7 @@ cmintr(arg) * PUTREG(CMCMD, CM_CONF(CONF_LONG)); */ PUTREG(CMCMD, CM_CLR(CLR_RECONFIG)); - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); /* * If less than 2 seconds per reconfig: Modified: head/sys/dev/cp/if_cp.c ============================================================================== --- head/sys/dev/cp/if_cp.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/cp/if_cp.c Fri Sep 19 03:51:26 2014 (r271849) @@ -867,7 +867,7 @@ static void cp_transmit (cp_chan_t *c, v d->timeout = 0; #ifndef NETGRAPH - ++d->ifp->if_opackets; + if_inc_counter(d->ifp, IFCOUNTER_OPACKETS, 1); d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; #endif cp_start (d); @@ -888,7 +888,7 @@ static void cp_receive (cp_chan_t *c, un if (! m) { CP_DEBUG (d, ("no memory for packet\n")); #ifndef NETGRAPH - ++d->ifp->if_iqdrops; + if_inc_counter(d->ifp, IFCOUNTER_IQDROPS, 1); #endif return; } @@ -898,7 +898,7 @@ static void cp_receive (cp_chan_t *c, un m->m_pkthdr.rcvif = 0; NG_SEND_DATA_ONLY (error, d->hook, m); #else - ++d->ifp->if_ipackets; + if_inc_counter(d->ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = d->ifp; /* Check if there's a BPF listener on this interface. * If so, hand off the raw packet to bpf. */ @@ -915,33 +915,33 @@ static void cp_error (cp_chan_t *c, int case CP_FRAME: CP_DEBUG (d, ("frame error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CP_CRC: CP_DEBUG (d, ("crc error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CP_OVERRUN: CP_DEBUG (d, ("overrun error\n")); #ifndef NETGRAPH - ++d->ifp->if_collisions; - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_COLLISIONS, 1); + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CP_OVERFLOW: CP_DEBUG (d, ("overflow error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CP_UNDERRUN: CP_DEBUG (d, ("underrun error\n")); d->timeout = 0; #ifndef NETGRAPH - ++d->ifp->if_oerrors; + if_inc_counter(d->ifp, IFCOUNTER_OERRORS, 1); d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; #endif cp_start (d); Modified: head/sys/dev/ctau/if_ct.c ============================================================================== --- head/sys/dev/ctau/if_ct.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/ctau/if_ct.c Fri Sep 19 03:51:26 2014 (r271849) @@ -1082,7 +1082,7 @@ static void ct_transmit (ct_chan_t *c, v return; d->timeout = 0; #ifndef NETGRAPH - ++d->ifp->if_opackets; + if_inc_counter(d->ifp, IFCOUNTER_OPACKETS, 1); d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; #endif ct_start (d); @@ -1106,7 +1106,7 @@ static void ct_receive (ct_chan_t *c, ch if (! m) { CT_DEBUG (d, ("no memory for packet\n")); #ifndef NETGRAPH - ++d->ifp->if_iqdrops; + if_inc_counter(d->ifp, IFCOUNTER_IQDROPS, 1); #endif return; } @@ -1116,7 +1116,7 @@ static void ct_receive (ct_chan_t *c, ch m->m_pkthdr.rcvif = 0; NG_SEND_DATA_ONLY (error, d->hook, m); #else - ++d->ifp->if_ipackets; + if_inc_counter(d->ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = d->ifp; /* Check if there's a BPF listener on this interface. * If so, hand off the raw packet to bpf. */ @@ -1139,33 +1139,33 @@ static void ct_error (ct_chan_t *c, int case CT_FRAME: CT_DEBUG (d, ("frame error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CT_CRC: CT_DEBUG (d, ("crc error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CT_OVERRUN: CT_DEBUG (d, ("overrun error\n")); #ifndef NETGRAPH - ++d->ifp->if_collisions; - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_COLLISIONS, 1); + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CT_OVERFLOW: CT_DEBUG (d, ("overflow error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CT_UNDERRUN: CT_DEBUG (d, ("underrun error\n")); d->timeout = 0; #ifndef NETGRAPH - ++d->ifp->if_oerrors; + if_inc_counter(d->ifp, IFCOUNTER_OERRORS, 1); d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; #endif ct_start (d); Modified: head/sys/dev/cx/if_cx.c ============================================================================== --- head/sys/dev/cx/if_cx.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/cx/if_cx.c Fri Sep 19 03:51:26 2014 (r271849) @@ -1251,7 +1251,7 @@ static void cx_transmit (cx_chan_t *c, v } d->timeout = 0; #ifndef NETGRAPH - ++d->ifp->if_opackets; + if_inc_counter(d->ifp, IFCOUNTER_OPACKETS, 1); d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; #endif cx_start (d); @@ -1304,7 +1304,7 @@ static void cx_receive (cx_chan_t *c, ch if (! m) { CX_DEBUG (d, ("no memory for packet\n")); #ifndef NETGRAPH - ++d->ifp->if_iqdrops; + if_inc_counter(d->ifp, IFCOUNTER_IQDROPS, 1); #endif return; } @@ -1314,7 +1314,7 @@ static void cx_receive (cx_chan_t *c, ch m->m_pkthdr.rcvif = 0; NG_SEND_DATA_ONLY (error, d->hook, m); #else - ++d->ifp->if_ipackets; + if_inc_counter(d->ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = d->ifp; /* Check if there's a BPF listener on this interface. * If so, hand off the raw packet to bpf. */ @@ -1357,7 +1357,7 @@ static void cx_error (cx_chan_t *c, int } #ifndef NETGRAPH else - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CX_CRC: @@ -1374,7 +1374,7 @@ static void cx_error (cx_chan_t *c, int } #ifndef NETGRAPH else - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CX_OVERRUN: @@ -1391,8 +1391,8 @@ static void cx_error (cx_chan_t *c, int #endif #ifndef NETGRAPH else { - ++d->ifp->if_collisions; - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_COLLISIONS, 1); + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); } #endif break; @@ -1400,7 +1400,7 @@ static void cx_error (cx_chan_t *c, int CX_DEBUG (d, ("overflow error\n")); #ifndef NETGRAPH if (c->mode != M_ASYNC) - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CX_UNDERRUN: @@ -1408,7 +1408,7 @@ static void cx_error (cx_chan_t *c, int if (c->mode != M_ASYNC) { d->timeout = 0; #ifndef NETGRAPH - ++d->ifp->if_oerrors; + if_inc_counter(d->ifp, IFCOUNTER_OERRORS, 1); d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; #endif cx_start (d); @@ -1427,7 +1427,7 @@ static void cx_error (cx_chan_t *c, int } #ifndef NETGRAPH else - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; default: Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/dc/if_dc.c Fri Sep 19 03:51:26 2014 (r271849) @@ -2915,9 +2915,9 @@ dc_rxeof(struct dc_softc *sc) (rxstat & (DC_RXSTAT_CRCERR | DC_RXSTAT_DRIBBLE | DC_RXSTAT_MIIERE | DC_RXSTAT_COLLSEEN | DC_RXSTAT_RUNT | DC_RXSTAT_DE))) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); if (rxstat & DC_RXSTAT_COLLSEEN) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); dc_discard_rxbuf(sc, i); if (rxstat & DC_RXSTAT_CRCERR) continue; @@ -2943,7 +2943,7 @@ dc_rxeof(struct dc_softc *sc) */ if (dc_newbuf(sc, i) != 0) { dc_discard_rxbuf(sc, i); - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); continue; } m->m_pkthdr.rcvif = ifp; @@ -2956,14 +2956,14 @@ dc_rxeof(struct dc_softc *sc) ETHER_ALIGN, ifp, NULL); dc_discard_rxbuf(sc, i); if (m0 == NULL) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); continue; } m = m0; } #endif - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); DC_UNLOCK(sc); (*ifp->if_input)(ifp, m); DC_LOCK(sc); @@ -3054,19 +3054,19 @@ dc_txeof(struct dc_softc *sc) } if (txstat & DC_TXSTAT_ERRSUM) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (txstat & DC_TXSTAT_EXCESSCOLL) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); if (txstat & DC_TXSTAT_LATECOLL) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); if (!(txstat & DC_TXSTAT_UNDERRUN)) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; dc_init_locked(sc); return; } } else - ifp->if_opackets++; - ifp->if_collisions += (txstat & DC_TXSTAT_COLLCNT) >> 3; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, (txstat & DC_TXSTAT_COLLCNT) >> 3); bus_dmamap_sync(sc->dc_tx_mtag, sc->dc_cdata.dc_tx_map[idx], BUS_DMASYNC_POSTWRITE); @@ -3261,7 +3261,7 @@ dc_poll(struct ifnet *ifp, enum poll_cmd if (status & (DC_ISR_RX_WATDOGTIMEO | DC_ISR_RX_NOBUF)) { uint32_t r = CSR_READ_4(sc, DC_FRAMESDISCARDED); - ifp->if_ierrors += (r & 0xffff) + ((r >> 17) & 0x7ff); + if_inc_counter(ifp, IFCOUNTER_IERRORS, (r & 0xffff) + ((r >> 17) & 0x7ff)); if (dc_rx_resync(sc)) dc_rxeof(sc); @@ -3343,7 +3343,7 @@ dc_intr(void *arg) if ((status & DC_ISR_RX_WATDOGTIMEO) || (status & DC_ISR_RX_NOBUF)) { r = CSR_READ_4(sc, DC_FRAMESDISCARDED); - ifp->if_ierrors += (r & 0xffff) + ((r >> 17) & 0x7ff); + if_inc_counter(ifp, IFCOUNTER_IERRORS, (r & 0xffff) + ((r >> 17) & 0x7ff)); if (dc_rxeof(sc) == 0) { while (dc_rx_resync(sc)) dc_rxeof(sc); @@ -3941,7 +3941,7 @@ dc_watchdog(void *xsc) } ifp = sc->dc_ifp; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); device_printf(sc->dc_dev, "watchdog timeout\n"); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; Modified: head/sys/dev/de/if_de.c ============================================================================== --- head/sys/dev/de/if_de.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/de/if_de.c Fri Sep 19 03:51:26 2014 (r271849) @@ -3439,7 +3439,7 @@ tulip_rx_intr(tulip_softc_t * const sc) } else { CTR1(KTR_TULIP, "tulip_rx_intr: bad packet; status %08x", DESC_STATUS(eop)); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); if (DESC_STATUS(eop) & (TULIP_DSTS_RxBADLENGTH|TULIP_DSTS_RxOVERFLOW|TULIP_DSTS_RxWATCHDOG)) { sc->tulip_dot3stats.dot3StatsInternalMacReceiveErrors++; } else { @@ -3479,7 +3479,7 @@ tulip_rx_intr(tulip_softc_t * const sc) #if defined(TULIP_DEBUG) cnt++; #endif - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); if (++eop == ri->ri_last) eop = ri->ri_first; ri->ri_nextin = eop; @@ -3501,7 +3501,7 @@ tulip_rx_intr(tulip_softc_t * const sc) */ m0 = m_devget(mtod(ms, caddr_t), total_len, ETHER_ALIGN, ifp, NULL); if (m0 == NULL) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto skip_input; } #else @@ -3675,7 +3675,7 @@ tulip_tx_intr(tulip_softc_t * const sc) if (d_status & TULIP_DSTS_ERRSUM) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409190351.s8J3pRlr055922>