From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 05:03:12 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 BD8B64A9; Fri, 19 Sep 2014 05:03:12 +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 9D71D7FB; Fri, 19 Sep 2014 05:03:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8J53CgJ088361; Fri, 19 Sep 2014 05:03:12 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8J53C8F088358; Fri, 19 Sep 2014 05:03:12 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409190503.s8J53C8F088358@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 19 Sep 2014 05:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271851 - head/sys/netgraph 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: Fri, 19 Sep 2014 05:03:12 -0000 Author: glebius Date: Fri Sep 19 05:03:11 2014 New Revision: 271851 URL: http://svnweb.freebsd.org/changeset/base/271851 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/netgraph/ng_eiface.c head/sys/netgraph/ng_iface.c head/sys/netgraph/ng_sppp.c Modified: head/sys/netgraph/ng_eiface.c ============================================================================== --- head/sys/netgraph/ng_eiface.c Fri Sep 19 03:55:19 2014 (r271850) +++ head/sys/netgraph/ng_eiface.c Fri Sep 19 05:03:11 2014 (r271851) @@ -247,7 +247,7 @@ ng_eiface_start2(node_p node, hook_p hoo BPF_MTAP(ifp, m); if (ifp->if_flags & IFF_MONITOR) { - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); m_freem(m); continue; } @@ -262,9 +262,9 @@ ng_eiface_start2(node_p node, hook_p hoo /* Update stats */ if (error == 0) - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); else - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; @@ -597,7 +597,7 @@ ng_eiface_rcvdata(hook_p hook, item_p it m->m_pkthdr.rcvif = ifp; /* Update interface stats */ - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); (*ifp->if_input)(ifp, m); Modified: head/sys/netgraph/ng_iface.c ============================================================================== --- head/sys/netgraph/ng_iface.c Fri Sep 19 03:55:19 2014 (r271850) +++ head/sys/netgraph/ng_iface.c Fri Sep 19 05:03:11 2014 (r271851) @@ -396,7 +396,7 @@ ng_iface_output(struct ifnet *ifp, struc IFQ_LOCK(&ifp->if_snd); IFQ_INC_DROPS(&ifp->if_snd); IFQ_UNLOCK(&ifp->if_snd); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (ENOBUFS); } *(sa_family_t *)m->m_data = af; @@ -472,8 +472,8 @@ ng_iface_send(struct ifnet *ifp, struct /* Update stats. */ if (error == 0) { - ifp->if_obytes += len; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OBYTES, len); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } return (error); @@ -736,8 +736,8 @@ ng_iface_rcvdata(hook_p hook, item_p ite } /* Update interface stats */ - ifp->if_ipackets++; - ifp->if_ibytes += m->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); /* Note receiving interface */ m->m_pkthdr.rcvif = ifp; Modified: head/sys/netgraph/ng_sppp.c ============================================================================== --- head/sys/netgraph/ng_sppp.c Fri Sep 19 03:55:19 2014 (r271850) +++ head/sys/netgraph/ng_sppp.c Fri Sep 19 05:03:11 2014 (r271851) @@ -364,7 +364,7 @@ ng_sppp_rcvdata (hook_p hook, item_p ite } /* Update interface stats */ - SP2IFP(pp)->if_ipackets++; + if_inc_counter(SP2IFP(pp), IFCOUNTER_IPACKETS, 1); /* Note receiving interface */ m->m_pkthdr.rcvif = SP2IFP(pp);