From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:33:25 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 B6500898; Thu, 18 Sep 2014 20:33:25 +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 87387FB5; Thu, 18 Sep 2014 20:33:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKXPmA048523; Thu, 18 Sep 2014 20:33:25 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKXPpl048522; Thu, 18 Sep 2014 20:33:25 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182033.s8IKXPpl048522@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:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271817 - head/sys/dev/smc 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:33:25 -0000 Author: glebius Date: Thu Sep 18 20:33:25 2014 New Revision: 271817 URL: http://svnweb.freebsd.org/changeset/base/271817 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/smc/if_smc.c Modified: head/sys/dev/smc/if_smc.c ============================================================================== --- head/sys/dev/smc/if_smc.c Thu Sep 18 20:32:40 2014 (r271816) +++ head/sys/dev/smc/if_smc.c Thu Sep 18 20:33:25 2014 (r271817) @@ -512,7 +512,7 @@ smc_start_locked(struct ifnet *ifp) len += (len & 1); if (len > ETHER_MAX_LEN - ETHER_CRC_LEN) { if_printf(ifp, "large packet discarded\n"); - ++ifp->if_oerrors; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(m); return; /* XXX readcheck? */ } @@ -598,7 +598,7 @@ smc_task_tx(void *context, int pending) */ if (packet & ARR_FAILED) { IFQ_DRV_PREPEND(&ifp->if_snd, m); - ++ifp->if_oerrors; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; smc_start_locked(ifp); SMC_UNLOCK(sc); @@ -655,7 +655,7 @@ smc_task_tx(void *context, int pending) /* * Finish up. */ - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; SMC_UNLOCK(sc); BPF_MTAP(ifp, m0); @@ -721,7 +721,7 @@ smc_task_rx(void *context, int pending) if (status & (RX_TOOSHORT | RX_TOOLNG | RX_BADCRC | RX_ALGNERR)) { smc_mmu_wait(sc); smc_write_2(sc, MMUCR, MMUCR_CMD_RELEASE); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m_freem(m); break; } @@ -777,7 +777,7 @@ smc_task_rx(void *context, int pending) m = mhead; mhead = mhead->m_next; m->m_next = NULL; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); (*ifp->if_input)(ifp, m); } } @@ -892,7 +892,7 @@ smc_task_intr(void *context, int pending */ if (status & RX_OVRN_INT) { smc_write_1(sc, ACK, RX_OVRN_INT); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } /* @@ -909,10 +909,9 @@ smc_task_intr(void *context, int pending smc_select_bank(sc, 0); counter = smc_read_2(sc, ECR); smc_select_bank(sc, 2); - ifp->if_collisions += - (counter & ECR_SNGLCOL_MASK) >> ECR_SNGLCOL_SHIFT; - ifp->if_collisions += - (counter & ECR_MULCOL_MASK) >> ECR_MULCOL_SHIFT; + if_inc_counter(ifp, IFNET_COLLISIONS, + ((counter & ECR_SNGLCOL_MASK) >> ECR_SNGLCOL_SHIFT) + + ((counter & ECR_MULCOL_MASK) >> ECR_MULCOL_SHIFT)); /* * See if there are any packets to transmit.