Date: Fri, 19 Sep 2014 05:03:12 +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: r271851 - head/sys/netgraph Message-ID: <201409190503.s8J53C8F088358@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409190503.s8J53C8F088358>