From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:39:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 252F94C3; Thu, 18 Sep 2014 20:39:24 +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 07635D3; Thu, 18 Sep 2014 20:39:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKdNDg049833; Thu, 18 Sep 2014 20:39:23 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKdNnH049832; Thu, 18 Sep 2014 20:39:23 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182039.s8IKdNnH049832@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:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271820 - head/sys/dev/ie 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:39:24 -0000 Author: glebius Date: Thu Sep 18 20:39:23 2014 New Revision: 271820 URL: http://svnweb.freebsd.org/changeset/base/271820 Log: - Mechanically convert to if_inc_counter(). - Cut code that runs a counter backwards. Modified: head/sys/dev/ie/if_ie.c Modified: head/sys/dev/ie/if_ie.c ============================================================================== --- head/sys/dev/ie/if_ie.c Thu Sep 18 20:38:18 2014 (r271819) +++ head/sys/dev/ie/if_ie.c Thu Sep 18 20:39:23 2014 (r271820) @@ -427,13 +427,13 @@ ierint(struct ie_softc *sc) status = sc->rframes[i]->ie_fd_status; if ((status & IE_FD_COMPLETE) && (status & IE_FD_OK)) { - sc->ifp->if_ipackets++; + if_inc_counter(sc->ifp, IFCOUNTER_IPACKETS, 1); if (!--timesthru) { - sc->ifp->if_ierrors += + if_inc_counter(sc->ifp, IFCOUNTER_IERRORS, sc->scb->ie_err_crc + sc->scb->ie_err_align + sc->scb->ie_err_resource + - sc->scb->ie_err_overrun; + sc->scb->ie_err_overrun); sc->scb->ie_err_crc = 0; sc->scb->ie_err_align = 0; sc->scb->ie_err_resource = 0; @@ -477,24 +477,24 @@ ietint(struct ie_softc *sc) if (status & IE_XS_LATECOLL) { if_printf(ifp, "late collision\n"); - ifp->if_collisions++; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } else if (status & IE_XS_NOCARRIER) { if_printf(ifp, "no carrier\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } else if (status & IE_XS_LOSTCTS) { if_printf(ifp, "lost CTS\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } else if (status & IE_XS_UNDERRUN) { if_printf(ifp, "DMA underrun\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } else if (status & IE_XS_EXCMAX) { if_printf(ifp, "too many collisions\n"); - ifp->if_collisions += 16; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 16); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } else { - ifp->if_opackets++; - ifp->if_collisions += status & IE_XS_MAXCOLL; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, status & IE_XS_MAXCOLL); } } sc->xmit_count = 0; @@ -539,7 +539,7 @@ iernr(struct ie_softc *sc) #endif ie_ack(sc, IE_ST_WHENCE); - sc->ifp->if_ierrors++; + if_inc_counter(sc->ifp, IFCOUNTER_IERRORS, 1); return (0); } @@ -688,16 +688,12 @@ ieget(struct ie_softc *sc, struct mbuf * */ if (!check_eh(sc, &eh)) { ie_drop_packet_buffer(sc); - sc->ifp->if_ierrors--; /* just this case, it's not an - * error - */ return (-1); } MGETHDR(m, M_NOWAIT, MT_DATA); if (!m) { ie_drop_packet_buffer(sc); - /* XXXX if_ierrors++; */ return (-1); } @@ -859,7 +855,7 @@ ie_readframe(struct ie_softc *sc, int nu if (rfd.ie_fd_status & IE_FD_OK) { if (ieget(sc, &m)) { - sc->ifp->if_ierrors++; /* this counts as an + if_inc_counter(sc->ifp, IFCOUNTER_IERRORS, 1); /* this counts as an * error */ return; }