From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 11:53:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4FD61065670; Sun, 12 Apr 2009 11:53:12 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7DCF8FC0A; Sun, 12 Apr 2009 11:53:12 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3CBrCPk024179; Sun, 12 Apr 2009 11:53:12 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3CBrC5i024178; Sun, 12 Apr 2009 11:53:12 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904121153.n3CBrC5i024178@svn.freebsd.org> From: Robert Watson Date: Sun, 12 Apr 2009 11:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190963 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 11:53:13 -0000 Author: rwatson Date: Sun Apr 12 11:53:12 2009 New Revision: 190963 URL: http://svn.freebsd.org/changeset/base/190963 Log: Commit file omitted in r190962: Update stats in struct udpstat using two new macros, UDPSTAT_ADD() and UDPSTAT_INC(), rather than directly manipulating the fields across the kernel. This will make it easier to change the implementation of these statistics, such as using per-CPU versions of the data structures. MFC after: 3 days Modified: head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Sun Apr 12 11:42:40 2009 (r190962) +++ head/sys/netinet6/udp6_usrreq.c Sun Apr 12 11:53:12 2009 (r190963) @@ -166,7 +166,7 @@ udp6_append(struct inpcb *inp, struct mb m_freem(n); if (opts) m_freem(opts); - V_udpstat.udps_fullsock++; + UDPSTAT_INC(udps_fullsock); } else sorwakeup_locked(so); } @@ -202,7 +202,7 @@ udp6_input(struct mbuf **mp, int *offp, return (IPPROTO_DONE); #endif - V_udpstat.udps_ipackets++; + UDPSTAT_INC(udps_ipackets); /* * Destination port of 0 is illegal, based on RFC768. @@ -214,7 +214,7 @@ udp6_input(struct mbuf **mp, int *offp, ulen = ntohs((u_short)uh->uh_ulen); if (plen != ulen) { - V_udpstat.udps_badlen++; + UDPSTAT_INC(udps_badlen); goto badunlocked; } @@ -222,11 +222,11 @@ udp6_input(struct mbuf **mp, int *offp, * Checksum extended UDP header and data. */ if (uh->uh_sum == 0) { - V_udpstat.udps_nosum++; + UDPSTAT_INC(udps_nosum); goto badunlocked; } if (in6_cksum(m, IPPROTO_UDP, off, ulen) != 0) { - V_udpstat.udps_badsum++; + UDPSTAT_INC(udps_badsum); goto badunlocked; } @@ -327,8 +327,8 @@ udp6_input(struct mbuf **mp, int *offp, * to send an ICMP Port Unreachable for a broadcast * or multicast datgram.) */ - V_udpstat.udps_noport++; - V_udpstat.udps_noportmcast++; + UDPSTAT_INC(udps_noport); + UDPSTAT_INC(udps_noportmcast); goto badheadlocked; } INP_RLOCK(last); @@ -365,10 +365,10 @@ udp6_input(struct mbuf **mp, int *offp, ip6_sprintf(ip6bufs, &ip6->ip6_src), ntohs(uh->uh_sport)); } - V_udpstat.udps_noport++; + UDPSTAT_INC(udps_noport); if (m->m_flags & M_MCAST) { printf("UDP6: M_MCAST is set in a unicast packet.\n"); - V_udpstat.udps_noportmcast++; + UDPSTAT_INC(udps_noportmcast); goto badheadlocked; } INP_INFO_RUNLOCK(&V_udbinfo); @@ -719,7 +719,7 @@ udp6_output(struct inpcb *inp, struct mb flags = 0; - V_udpstat.udps_opackets++; + UDPSTAT_INC(udps_opackets); error = ip6_output(m, optp, NULL, flags, inp->in6p_moptions, NULL, inp); break;