From owner-svn-src-head@FreeBSD.ORG Thu Sep 18 21:07:06 2014 Return-Path: Delivered-To: svn-src-head@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 0C568138; Thu, 18 Sep 2014 21:07:06 +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 D144360B; Thu, 18 Sep 2014 21:07:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IL75GF064606; Thu, 18 Sep 2014 21:07:05 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IL75Ow064605; Thu, 18 Sep 2014 21:07:05 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182107.s8IL75Ow064605@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:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271831 - head/sys/dev/hme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 21:07:06 -0000 Author: glebius Date: Thu Sep 18 21:07:05 2014 New Revision: 271831 URL: http://svnweb.freebsd.org/changeset/base/271831 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/hme/if_hme.c Modified: head/sys/dev/hme/if_hme.c ============================================================================== --- head/sys/dev/hme/if_hme.c Thu Sep 18 21:05:59 2014 (r271830) +++ head/sys/dev/hme/if_hme.c Thu Sep 18 21:07:05 2014 (r271831) @@ -477,11 +477,11 @@ hme_tick(void *arg) /* * Unload collision counters */ - ifp->if_collisions += + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, HME_MAC_READ_4(sc, HME_MACI_NCCNT) + HME_MAC_READ_4(sc, HME_MACI_FCCNT) + HME_MAC_READ_4(sc, HME_MACI_EXCNT) + - HME_MAC_READ_4(sc, HME_MACI_LTCNT); + HME_MAC_READ_4(sc, HME_MACI_LTCNT)); /* * then clear the hardware counters. @@ -1072,7 +1072,7 @@ hme_read(struct hme_softc *sc, int ix, i HME_WHINE(sc->sc_dev, "invalid packet size %d; dropping\n", len); #endif - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); hme_discard_rxbuf(sc, ix); return; } @@ -1086,12 +1086,12 @@ hme_read(struct hme_softc *sc, int ix, i * it is sure that a new buffer can be mapped. If it can not, * drop the packet, but leave the interface up. */ - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); hme_discard_rxbuf(sc, ix); return; } - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = len + HME_RXOFFS; @@ -1193,7 +1193,7 @@ hme_tint(struct hme_softc *sc) BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(sc->sc_tdmatag, htx->htx_dmamap); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); m_freem(htx->htx_m); htx->htx_m = NULL; STAILQ_REMOVE_HEAD(&sc->sc_rb.rb_txbusyq, htx_q); @@ -1299,7 +1299,7 @@ hme_rint(struct hme_softc *sc) if ((flags & HME_XD_OFL) != 0) { device_printf(sc->sc_dev, "buffer overflow, ri=%d; " "flags=0x%x\n", ri, flags); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); hme_discard_rxbuf(sc, ri); } else { len = HME_XD_DECODE_RSIZE(flags); @@ -1374,7 +1374,7 @@ hme_watchdog(struct hme_softc *sc) device_printf(sc->sc_dev, "device timeout\n"); else if (bootverbose) device_printf(sc->sc_dev, "device timeout (no link)\n"); - ++ifp->if_oerrors; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; hme_init_locked(sc);