Author: glebius Date: Thu Sep 18 21:05:59 2014 New Revision: 271830 URL: http://svnweb.freebsd.org/changeset/base/271830
Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/bm/if_bm.c Modified: head/sys/dev/bm/if_bm.c ============================================================================== --- head/sys/dev/bm/if_bm.c Thu Sep 18 21:03:13 2014 (r271829) +++ head/sys/dev/bm/if_bm.c Thu Sep 18 21:05:59 2014 (r271830) @@ -608,7 +608,7 @@ bm_rxintr(void *xsc) m = sc->sc_rxsoft[i].rxs_mbuf; if (bm_add_rxbuf(sc, i)) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m = NULL; continue; } @@ -616,7 +616,7 @@ bm_rxintr(void *xsc) if (m == NULL) continue; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = ifp; m->m_len -= (dbdma_get_residuals(sc->sc_rxdma, i) + 2); m->m_pkthdr.len = m->m_len; @@ -678,7 +678,7 @@ bm_txintr(void *xsc) STAILQ_INSERT_TAIL(&sc->sc_txfreeq, txs, txs_q); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); progress = 1; } @@ -1196,12 +1196,13 @@ bm_tick(void *arg) struct bm_softc *sc = arg; /* Read error counters */ - sc->sc_ifp->if_collisions += CSR_READ_2(sc, BM_TX_NCCNT) + - CSR_READ_2(sc, BM_TX_FCCNT) + CSR_READ_2(sc, BM_TX_EXCNT) + - CSR_READ_2(sc, BM_TX_LTCNT); - - sc->sc_ifp->if_ierrors += CSR_READ_2(sc, BM_RX_LECNT) + - CSR_READ_2(sc, BM_RX_AECNT) + CSR_READ_2(sc, BM_RX_FECNT); + if_inc_counter(sc->sc_ifp, IFCOUNTER_COLLISIONS, + CSR_READ_2(sc, BM_TX_NCCNT) + CSR_READ_2(sc, BM_TX_FCCNT) + + CSR_READ_2(sc, BM_TX_EXCNT) + CSR_READ_2(sc, BM_TX_LTCNT)); + + if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, + CSR_READ_2(sc, BM_RX_LECNT) + CSR_READ_2(sc, BM_RX_AECNT) + + CSR_READ_2(sc, BM_RX_FECNT)); /* Zero collision counters */ CSR_WRITE_2(sc, BM_TX_NCCNT, 0); _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"