Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Sep 2014 20:03:45 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r271803 - head/sys/dev/tl
Message-ID:  <201409182003.s8IK3kr8033068@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Thu Sep 18 20:03:45 2014
New Revision: 271803
URL: http://svnweb.freebsd.org/changeset/base/271803

Log:
  Mechanically convert to if_inc_counter().

Modified:
  head/sys/dev/tl/if_tl.c

Modified: head/sys/dev/tl/if_tl.c
==============================================================================
--- head/sys/dev/tl/if_tl.c	Thu Sep 18 20:00:36 2014	(r271802)
+++ head/sys/dev/tl/if_tl.c	Thu Sep 18 20:03:45 2014	(r271803)
@@ -1430,7 +1430,7 @@ tl_intvec_rxeof(xsc, type)
 		total_len = cur_rx->tl_ptr->tlist_frsize;
 
 		if (tl_newbuf(sc, cur_rx) == ENOBUFS) {
-			ifp->if_ierrors++;
+			if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
 			cur_rx->tl_ptr->tlist_frsize = MCLBYTES;
 			cur_rx->tl_ptr->tlist_cstat = TL_CSTAT_READY;
 			cur_rx->tl_ptr->tl_frag.tlist_dcnt = MCLBYTES;
@@ -1726,13 +1726,13 @@ tl_stats_update(xsc)
 	*p++ = CSR_READ_4(sc, TL_DIO_DATA);
 	*p++ = CSR_READ_4(sc, TL_DIO_DATA);
 
-	ifp->if_opackets += tl_tx_goodframes(tl_stats);
-	ifp->if_collisions += tl_stats.tl_tx_single_collision +
-				tl_stats.tl_tx_multi_collision;
-	ifp->if_ipackets += tl_rx_goodframes(tl_stats);
-	ifp->if_ierrors += tl_stats.tl_crc_errors + tl_stats.tl_code_errors +
-			    tl_rx_overrun(tl_stats);
-	ifp->if_oerrors += tl_tx_underrun(tl_stats);
+	if_inc_counter(ifp, IFCOUNTER_OPACKETS, tl_tx_goodframes(tl_stats));
+	if_inc_counter(ifp, IFCOUNTER_COLLISIONS,
+	    tl_stats.tl_tx_single_collision + tl_stats.tl_tx_multi_collision);
+	if_inc_counter(ifp, IFCOUNTER_IPACKETS, tl_rx_goodframes(tl_stats));
+	if_inc_counter(ifp, IFCOUNTER_IERRORS, tl_stats.tl_crc_errors +
+	    tl_stats.tl_code_errors + tl_rx_overrun(tl_stats));
+	if_inc_counter(ifp, IFCOUNTER_OERRORS, tl_tx_underrun(tl_stats));
 
 	if (tl_tx_underrun(tl_stats)) {
 		u_int8_t		tx_thresh;
@@ -2186,7 +2186,7 @@ tl_watchdog(sc)
 
 	if_printf(ifp, "device timeout\n");
 
-	ifp->if_oerrors++;
+	if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
 
 	tl_softreset(sc, 1);
 	tl_init_locked(sc);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409182003.s8IK3kr8033068>