From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 21:05:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E48E3F69; Thu, 18 Sep 2014 21:05:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF8865FB; Thu, 18 Sep 2014 21:05:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IL5xcD064418; Thu, 18 Sep 2014 21:05:59 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IL5xjI064417; Thu, 18 Sep 2014 21:05:59 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182105.s8IL5xjI064417@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 21:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271830 - head/sys/dev/bm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 21:06:00 -0000 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);