From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:35:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 114E8AB2; Thu, 18 Sep 2014 20:35:23 +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 F067AFD5; Thu, 18 Sep 2014 20:35:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKZMGY048863; Thu, 18 Sep 2014 20:35:22 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKZMsL048862; Thu, 18 Sep 2014 20:35:22 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182035.s8IKZMsL048862@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 20:35:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271818 - head/sys/dev/xl 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 20:35:23 -0000 Author: glebius Date: Thu Sep 18 20:35:22 2014 New Revision: 271818 URL: http://svnweb.freebsd.org/changeset/base/271818 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/xl/if_xl.c Modified: head/sys/dev/xl/if_xl.c ============================================================================== --- head/sys/dev/xl/if_xl.c Thu Sep 18 20:33:25 2014 (r271817) +++ head/sys/dev/xl/if_xl.c Thu Sep 18 20:35:22 2014 (r271818) @@ -1866,7 +1866,7 @@ again: * comes up in the ring. */ if (rxstat & XL_RXSTAT_UP_ERROR) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); cur_rx->xl_ptr->xl_status = 0; bus_dmamap_sync(sc->xl_ldata.xl_rx_tag, sc->xl_ldata.xl_rx_dmamap, BUS_DMASYNC_PREWRITE); @@ -1881,7 +1881,7 @@ again: if (!(rxstat & XL_RXSTAT_UP_CMPLT)) { device_printf(sc->xl_dev, "bad receive status -- packet dropped\n"); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); cur_rx->xl_ptr->xl_status = 0; bus_dmamap_sync(sc->xl_ldata.xl_rx_tag, sc->xl_ldata.xl_rx_dmamap, BUS_DMASYNC_PREWRITE); @@ -1901,7 +1901,7 @@ again: * can do in this situation. */ if (xl_newbuf(sc, cur_rx)) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); cur_rx->xl_ptr->xl_status = 0; bus_dmamap_sync(sc->xl_ldata.xl_rx_tag, sc->xl_ldata.xl_rx_dmamap, BUS_DMASYNC_PREWRITE); @@ -1910,7 +1910,7 @@ again: bus_dmamap_sync(sc->xl_ldata.xl_rx_tag, sc->xl_ldata.xl_rx_dmamap, BUS_DMASYNC_PREWRITE); - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = total_len; @@ -2014,7 +2014,7 @@ xl_txeof(struct xl_softc *sc) bus_dmamap_unload(sc->xl_mtag, cur_tx->xl_map); m_freem(cur_tx->xl_mbuf); cur_tx->xl_mbuf = NULL; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; cur_tx->xl_next = sc->xl_cdata.xl_tx_free; @@ -2061,7 +2061,7 @@ xl_txeof_90xB(struct xl_softc *sc) cur_tx->xl_mbuf = NULL; } - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); sc->xl_cdata.xl_tx_cnt--; XL_INC(idx, XL_TX_LIST_CNT); @@ -2185,7 +2185,7 @@ xl_intr(void *arg) } if (status & XL_STAT_TX_COMPLETE) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); xl_txeoc(sc); } @@ -2255,7 +2255,7 @@ xl_poll_locked(struct ifnet *ifp, enum p XL_CMD_INTR_ACK|(status & XL_INTRS)); if (status & XL_STAT_TX_COMPLETE) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); xl_txeoc(sc); } @@ -2312,10 +2312,12 @@ xl_stats_update(struct xl_softc *sc) for (i = 0; i < 16; i++) *p++ = CSR_READ_1(sc, XL_W6_CARRIER_LOST + i); - ifp->if_ierrors += xl_stats.xl_rx_overrun; + if_inc_counter(ifp, IFCOUNTER_IERRORS, xl_stats.xl_rx_overrun); - ifp->if_collisions += xl_stats.xl_tx_multi_collision + - xl_stats.xl_tx_single_collision + xl_stats.xl_tx_late_collision; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, + xl_stats.xl_tx_multi_collision + + xl_stats.xl_tx_single_collision + + xl_stats.xl_tx_late_collision); /* * Boomerang and cyclone chips have an extra stats counter @@ -3121,7 +3123,7 @@ xl_watchdog(struct xl_softc *sc) return (0); } - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); XL_SEL_WIN(4); status = CSR_READ_2(sc, XL_W4_MEDIA_STATUS); device_printf(sc->xl_dev, "watchdog timeout\n");