Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Sep 2014 11:33:43 +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: r272066 - head/sys/dev/jme
Message-ID:  <201409241133.s8OBXhBO029390@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Wed Sep 24 11:33:43 2014
New Revision: 272066
URL: http://svnweb.freebsd.org/changeset/base/272066

Log:
  Mechanically convert to if_inc_counter().

Modified:
  head/sys/dev/jme/if_jme.c

Modified: head/sys/dev/jme/if_jme.c
==============================================================================
--- head/sys/dev/jme/if_jme.c	Wed Sep 24 11:31:46 2014	(r272065)
+++ head/sys/dev/jme/if_jme.c	Wed Sep 24 11:33:43 2014	(r272066)
@@ -1947,7 +1947,7 @@ jme_watchdog(struct jme_softc *sc)
 	ifp = sc->jme_ifp;
 	if ((sc->jme_flags & JME_FLAG_LINK) == 0) {
 		if_printf(sc->jme_ifp, "watchdog timeout (missed link)\n");
-		ifp->if_oerrors++;
+		if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
 		ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 		jme_init_locked(sc);
 		return;
@@ -1962,7 +1962,7 @@ jme_watchdog(struct jme_softc *sc)
 	}
 
 	if_printf(sc->jme_ifp, "watchdog timeout\n");
-	ifp->if_oerrors++;
+	if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
 	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 	jme_init_locked(sc);
 	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
@@ -2281,7 +2281,7 @@ jme_link_task(void *arg, int pending)
 				m_freem(txd->tx_m);
 				txd->tx_m = NULL;
 				txd->tx_ndesc = 0;
-				ifp->if_oerrors++;
+				if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
 			}
 		}
 	}
@@ -2449,13 +2449,13 @@ jme_txeof(struct jme_softc *sc)
 			break;
 
 		if ((status & (JME_TD_TMOUT | JME_TD_RETRY_EXP)) != 0)
-			ifp->if_oerrors++;
+			if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
 		else {
-			ifp->if_opackets++;
+			if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
 			if ((status & JME_TD_COLLISION) != 0)
-				ifp->if_collisions +=
+				if_inc_counter(ifp, IFCOUNTER_COLLISIONS,
 				    le32toh(txd->tx_desc->buflen) &
-				    JME_TD_BUF_LEN_MASK;
+				    JME_TD_BUF_LEN_MASK);
 		}
 		/*
 		 * Only the first descriptor of multi-descriptor
@@ -2526,7 +2526,7 @@ jme_rxeof(struct jme_softc *sc)
 	nsegs = JME_RX_NSEGS(status);
 	sc->jme_cdata.jme_rxlen = JME_RX_BYTES(status) - JME_RX_PAD_BYTES;
 	if ((status & JME_RX_ERR_STAT) != 0) {
-		ifp->if_ierrors++;
+		if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
 		jme_discard_rxbuf(sc, sc->jme_cdata.jme_rx_cons);
 #ifdef JME_SHOW_ERRORS
 		device_printf(sc->jme_dev, "%s : receive error = 0x%b\n",
@@ -2543,7 +2543,7 @@ jme_rxeof(struct jme_softc *sc)
 		mp = rxd->rx_m;
 		/* Add a new receive buffer to the ring. */
 		if (jme_newbuf(sc, rxd) != 0) {
-			ifp->if_iqdrops++;
+			if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
 			/* Reuse buffer. */
 			for (; count < nsegs; count++) {
 				jme_discard_rxbuf(sc, cons);
@@ -2626,7 +2626,7 @@ jme_rxeof(struct jme_softc *sc)
 				m->m_flags |= M_VLANTAG;
 			}
 
-			ifp->if_ipackets++;
+			if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
 			/* Pass it on. */
 			JME_UNLOCK(sc);
 			(*ifp->if_input)(ifp, m);



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