Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Sep 2014 20:24:48 +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: r271813 - head/sys/dev/pcn
Message-ID:  <201409182024.s8IKOmcU043588@svn.freebsd.org>

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

Log:
  Mechanically convert to if_inc_counter().

Modified:
  head/sys/dev/pcn/if_pcn.c

Modified: head/sys/dev/pcn/if_pcn.c
==============================================================================
--- head/sys/dev/pcn/if_pcn.c	Thu Sep 18 20:23:34 2014	(r271812)
+++ head/sys/dev/pcn/if_pcn.c	Thu Sep 18 20:24:47 2014	(r271813)
@@ -856,7 +856,7 @@ pcn_rxeof(sc)
 	 	 * comes up in the ring.
 		 */
 		if (cur_rx->pcn_rxstat & PCN_RXSTAT_ERR) {
-			ifp->if_ierrors++;
+			if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
 			pcn_newbuf(sc, i, m);
 			PCN_INC(i, PCN_RX_LIST_CNT);
 			continue;
@@ -865,7 +865,7 @@ pcn_rxeof(sc)
 		if (pcn_newbuf(sc, i, NULL)) {
 			/* Ran out of mbufs; recycle this one. */
 			pcn_newbuf(sc, i, m);
-			ifp->if_ierrors++;
+			if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
 			PCN_INC(i, PCN_RX_LIST_CNT);
 			continue;
 		}
@@ -873,7 +873,7 @@ pcn_rxeof(sc)
 		PCN_INC(i, PCN_RX_LIST_CNT);
 
 		/* No errors; receive the packet. */
-		ifp->if_ipackets++;
+		if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
 		m->m_len = m->m_pkthdr.len =
 		    cur_rx->pcn_rxlen - ETHER_CRC_LEN;
 		m->m_pkthdr.rcvif = ifp;
@@ -921,17 +921,17 @@ pcn_txeof(sc)
 		}
 
 		if (cur_tx->pcn_txctl & PCN_TXCTL_ERR) {
-			ifp->if_oerrors++;
+			if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
 			if (cur_tx->pcn_txstat & PCN_TXSTAT_EXDEF)
-				ifp->if_collisions++;
+				if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1);
 			if (cur_tx->pcn_txstat & PCN_TXSTAT_RTRY)
-				ifp->if_collisions++;
+				if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1);
 		}
 
-		ifp->if_collisions +=
-		    cur_tx->pcn_txstat & PCN_TXSTAT_TRC;
+		if_inc_counter(ifp, IFCOUNTER_COLLISIONS,
+		    cur_tx->pcn_txstat & PCN_TXSTAT_TRC);
 
-		ifp->if_opackets++;
+		if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
 		if (sc->pcn_cdata.pcn_tx_chain[idx] != NULL) {
 			m_freem(sc->pcn_cdata.pcn_tx_chain[idx]);
 			sc->pcn_cdata.pcn_tx_chain[idx] = NULL;
@@ -1436,7 +1436,7 @@ pcn_watchdog(struct pcn_softc *sc)
 	PCN_LOCK_ASSERT(sc);
 	ifp = sc->pcn_ifp;
 
-	ifp->if_oerrors++;
+	if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
 	if_printf(ifp, "watchdog timeout\n");
 
 	pcn_stop(sc);



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