From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 21:13:13 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 B0CEE7BD; Thu, 18 Sep 2014 21:13:13 +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 6FE896D2; Thu, 18 Sep 2014 21:13:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8ILDDu9069254; Thu, 18 Sep 2014 21:13:13 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ILDDsk069253; Thu, 18 Sep 2014 21:13:13 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182113.s8ILDDsk069253@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:13:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271835 - head/sys/dev/ale 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:13:13 -0000 Author: glebius Date: Thu Sep 18 21:13:12 2014 New Revision: 271835 URL: http://svnweb.freebsd.org/changeset/base/271835 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/ale/if_ale.c Modified: head/sys/dev/ale/if_ale.c ============================================================================== --- head/sys/dev/ale/if_ale.c Thu Sep 18 21:13:03 2014 (r271834) +++ head/sys/dev/ale/if_ale.c Thu Sep 18 21:13:12 2014 (r271835) @@ -1953,13 +1953,13 @@ ale_watchdog(struct ale_softc *sc) ifp = sc->ale_ifp; if ((sc->ale_flags & ALE_FLAG_LINK) == 0) { if_printf(sc->ale_ifp, "watchdog timeout (lost link)\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ale_init_locked(sc); return; } if_printf(sc->ale_ifp, "watchdog timeout -- resetting\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ale_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -2206,11 +2206,11 @@ ale_stats_update(struct ale_softc *sc) stat->tx_mcast_bytes += smb->tx_mcast_bytes; /* Update counters in ifnet. */ - ifp->if_opackets += smb->tx_frames; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, smb->tx_frames); - ifp->if_collisions += smb->tx_single_colls + + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, smb->tx_single_colls + smb->tx_multi_colls * 2 + smb->tx_late_colls + - smb->tx_abort * HDPX_CFG_RETRY_DEFAULT; + smb->tx_abort * HDPX_CFG_RETRY_DEFAULT); /* * XXX @@ -2219,15 +2219,16 @@ ale_stats_update(struct ale_softc *sc) * the counter name is not correct one so I've removed the * counter in output errors. */ - ifp->if_oerrors += smb->tx_abort + smb->tx_late_colls + - smb->tx_underrun; + if_inc_counter(ifp, IFCOUNTER_OERRORS, + smb->tx_abort + smb->tx_late_colls + smb->tx_underrun); - ifp->if_ipackets += smb->rx_frames; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, smb->rx_frames); - ifp->if_ierrors += smb->rx_crcerrs + smb->rx_lenerrs + + if_inc_counter(ifp, IFCOUNTER_IERRORS, + smb->rx_crcerrs + smb->rx_lenerrs + smb->rx_runts + smb->rx_pkts_truncated + smb->rx_fifo_oflows + smb->rx_rrs_errs + - smb->rx_alignerrs; + smb->rx_alignerrs); } static int @@ -2549,7 +2550,7 @@ ale_rxeof(struct ale_softc *sc, int coun m = m_devget((char *)(rs + 1), length - ETHER_CRC_LEN, ETHER_ALIGN, ifp, NULL); if (m == NULL) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); ale_rx_update_page(sc, &rx_page, length, &prod); continue; }