Date: Thu, 18 Sep 2014 20:58:04 +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: r271826 - head/sys/dev/ffec Message-ID: <201409182058.s8IKw4KS059450@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Thu Sep 18 20:58:04 2014 New Revision: 271826 URL: http://svnweb.freebsd.org/changeset/base/271826 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/ffec/if_ffec.c Modified: head/sys/dev/ffec/if_ffec.c ============================================================================== --- head/sys/dev/ffec/if_ffec.c Thu Sep 18 20:53:36 2014 (r271825) +++ head/sys/dev/ffec/if_ffec.c Thu Sep 18 20:58:04 2014 (r271826) @@ -499,23 +499,21 @@ ffec_harvest_stats(struct ffec_softc *sc sc->stats_harvest_count = 0; ifp = sc->ifp; - ifp->if_ipackets += RD4(sc, FEC_RMON_R_PACKETS); - ifp->if_imcasts += RD4(sc, FEC_RMON_R_MC_PKT); - ifp->if_ierrors += RD4(sc, FEC_RMON_R_CRC_ALIGN); - ifp->if_ierrors += RD4(sc, FEC_RMON_R_UNDERSIZE); - ifp->if_ierrors += RD4(sc, FEC_RMON_R_OVERSIZE); - ifp->if_ierrors += RD4(sc, FEC_RMON_R_FRAG); - ifp->if_ierrors += RD4(sc, FEC_RMON_R_JAB); - - ifp->if_opackets += RD4(sc, FEC_RMON_T_PACKETS); - ifp->if_omcasts += RD4(sc, FEC_RMON_T_MC_PKT); - ifp->if_oerrors += RD4(sc, FEC_RMON_T_CRC_ALIGN); - ifp->if_oerrors += RD4(sc, FEC_RMON_T_UNDERSIZE); - ifp->if_oerrors += RD4(sc, FEC_RMON_T_OVERSIZE ); - ifp->if_oerrors += RD4(sc, FEC_RMON_T_FRAG); - ifp->if_oerrors += RD4(sc, FEC_RMON_T_JAB); + if_inc_counter(ifp, IFCOUNTER_IPACKETS, RD4(sc, FEC_RMON_R_PACKETS)); + if_inc_counter(ifp, IFCOUNTER_IMCASTS, RD4(sc, FEC_RMON_R_MC_PKT)); + if_inc_counter(ifp, IFCOUNTER_IERRORS, + RD4(sc, FEC_RMON_R_CRC_ALIGN) + RD4(sc, FEC_RMON_R_UNDERSIZE) + + RD4(sc, FEC_RMON_R_OVERSIZE) + RD4(sc, FEC_RMON_R_FRAG) + + RD4(sc, FEC_RMON_R_JAB)); + + if_inc_counter(ifp, IFCOUNTER_OPACKETS, RD4(sc, FEC_RMON_T_PACKETS)); + if_inc_counter(ifp, IFCOUNTER_OMCASTS, RD4(sc, FEC_RMON_T_MC_PKT)); + if_inc_counter(ifp, IFCOUNTER_OERRORS, + RD4(sc, FEC_RMON_T_CRC_ALIGN) + RD4(sc, FEC_RMON_T_UNDERSIZE) + + RD4(sc, FEC_RMON_T_OVERSIZE) + RD4(sc, FEC_RMON_T_FRAG) + + RD4(sc, FEC_RMON_T_JAB)); - ifp->if_collisions += RD4(sc, FEC_RMON_T_COL); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, RD4(sc, FEC_RMON_T_COL)); ffec_clear_stats(sc); } @@ -784,7 +782,7 @@ ffec_rxfinish_onebuf(struct ffec_softc * * mbuf, which is still mapped and loaded. */ if ((newmbuf = ffec_alloc_mbufcl(sc)) == NULL) { - ++sc->ifp->if_iqdrops; + if_inc_counter(sc->ifp, IFCOUNTER_IQDROPS, 1); ffec_setup_rxdesc(sc, sc->rx_idx, sc->rxdesc_ring[sc->rx_idx].buf_paddr); return;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409182058.s8IKw4KS059450>