svn commit: r272066 - head/sys/dev/jme

Gleb Smirnoff glebius at FreeBSD.org
Wed Sep 24 11:33:44 UTC 2014


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);


More information about the svn-src-all mailing list