From nobody@FreeBSD.org  Wed Oct 30 03:03:46 2013
Return-Path: <nobody@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 ESMTP id AD866302
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 30 Oct 2013 03:03:45 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 5CE8D2D90
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 30 Oct 2013 03:03:45 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r9U33jYY013520
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 30 Oct 2013 03:03:45 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r9U33jYs013507;
	Wed, 30 Oct 2013 03:03:45 GMT
	(envelope-from nobody)
Message-Id: <201310300303.r9U33jYs013507@oldred.freebsd.org>
Date: Wed, 30 Oct 2013 03:03:45 GMT
From: Sven-Thorsten Dietrich <thebigcorporation@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: IPv6 Multicast Lookup Accounting Fix
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         183462
>Category:       kern
>Synopsis:       IPv6 Multicast Lookup Accounting Fix
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    brueffer
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 30 03:10:00 UTC 2013
>Closed-Date:    Wed Mar 12 09:21:01 CET 2014
>Last-Modified:  Wed Mar 12 09:21:01 CET 2014
>Originator:     Sven-Thorsten Dietrich
>Release:        HEAD / 9.1.0
>Organization:
Vyatta
>Environment:
>Description:
Implementation should only count table lookups when processing packets.
internal table accesses should not be counted in the stats.
>How-To-Repeat:
See patch
>Fix:


Patch attached with submission follows:

Subject: Don't count table lookups from add_mfc.
Signed-off-by: Sven-Thorsten Dietrich <thebigcorporation@gmail.com>

Index: sys/netinet6/ip6_mroute.c
===================================================================
--- sys/netinet6/ip6_mroute.c	(revision 256126)
+++ sys/netinet6/ip6_mroute.c	(working copy)
@@ -275,7 +275,6 @@
 #define MF6CFIND(o, g, rt) do { \
 	struct mf6c *_rt = mf6ctable[MF6CHASH(o,g)]; \
 	rt = NULL; \
-	MRT6STAT_INC(mrt6s_mfc_lookups); \
 	while (_rt) { \
 		if (IN6_ARE_ADDR_EQUAL(&_rt->mf6c_origin.sin6_addr, &(o)) && \
 		    IN6_ARE_ADDR_EQUAL(&_rt->mf6c_mcastgrp.sin6_addr, &(g)) && \
@@ -1124,6 +1123,7 @@
 	/*
 	 * Determine forwarding mifs from the forwarding cache table
 	 */
+	MRT6STAT_INC(mrt6s_mfc_lookups);
 	MF6CFIND(ip6->ip6_src, ip6->ip6_dst, rt);
 
 	/* Entry exists, so forward if necessary */


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: brueffer 
State-Changed-When: Mon Feb 10 15:49:06 CET 2014 
State-Changed-Why:  
Slightly adjusted patch (suggested by bms@) committed to HEAD, will merge to STABLE branches 
in a while.  Thanks for the submission! 


Responsible-Changed-From-To: freebsd-bugs->brueffer 
Responsible-Changed-By: brueffer 
Responsible-Changed-When: Mon Feb 10 15:49:06 CET 2014 
Responsible-Changed-Why:  
MFC reminder. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=183462 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/183462: commit references a PR
Date: Mon, 10 Feb 2014 14:47:59 +0000 (UTC)

 Author: brueffer
 Date: Mon Feb 10 14:47:51 2014
 New Revision: 261710
 URL: http://svnweb.freebsd.org/changeset/base/261710
 
 Log:
   Only count table lookups when we're actually processing packets.
   
   PR:		183462
   Submitted by:	Sven-Thorsten Dietrich <thebigcorporation at gmail.com>
   Reviewed by:	bms
   MFC after:	1 month
 
 Modified:
   head/sys/netinet6/ip6_mroute.c
 
 Modified: head/sys/netinet6/ip6_mroute.c
 ==============================================================================
 --- head/sys/netinet6/ip6_mroute.c	Mon Feb 10 14:36:51 2014	(r261709)
 +++ head/sys/netinet6/ip6_mroute.c	Mon Feb 10 14:47:51 2014	(r261710)
 @@ -283,7 +283,6 @@ static VNET_DEFINE(int, pim6);
  #define MF6CFIND(o, g, rt) do { \
  	struct mf6c *_rt = mf6ctable[MF6CHASH(o,g)]; \
  	rt = NULL; \
 -	MRT6STAT_INC(mrt6s_mfc_lookups); \
  	while (_rt) { \
  		if (IN6_ARE_ADDR_EQUAL(&_rt->mf6c_origin.sin6_addr, &(o)) && \
  		    IN6_ARE_ADDR_EQUAL(&_rt->mf6c_mcastgrp.sin6_addr, &(g)) && \
 @@ -1099,6 +1098,7 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru
  	 * Determine forwarding mifs from the forwarding cache table
  	 */
  	MF6CFIND(ip6->ip6_src, ip6->ip6_dst, rt);
 +	MRT6STAT_INC(mrt6s_mfc_lookups);
  
  	/* Entry exists, so forward if necessary */
  	if (rt) {
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/183462: commit references a PR
Date: Wed, 12 Mar 2014 08:16:25 +0000 (UTC)

 Author: brueffer
 Date: Wed Mar 12 08:16:17 2014
 New Revision: 263070
 URL: http://svnweb.freebsd.org/changeset/base/263070
 
 Log:
   MFC: r261710
   
   Only count table lookups when we're actually processing packets.
   
   PR:             183462
   Submitted by:   Sven-Thorsten Dietrich <thebigcorporation at gmail.com>
   Reviewed by:    bms
 
 Modified:
   stable/9/sys/netinet6/ip6_mroute.c
 Directory Properties:
   stable/9/sys/   (props changed)
 
 Modified: stable/9/sys/netinet6/ip6_mroute.c
 ==============================================================================
 --- stable/9/sys/netinet6/ip6_mroute.c	Wed Mar 12 08:15:15 2014	(r263069)
 +++ stable/9/sys/netinet6/ip6_mroute.c	Wed Mar 12 08:16:17 2014	(r263070)
 @@ -280,7 +280,6 @@ static VNET_DEFINE(int, pim6);
  #define MF6CFIND(o, g, rt) do { \
  	struct mf6c *_rt = mf6ctable[MF6CHASH(o,g)]; \
  	rt = NULL; \
 -	MRT6STAT_INC(mrt6s_mfc_lookups); \
  	while (_rt) { \
  		if (IN6_ARE_ADDR_EQUAL(&_rt->mf6c_origin.sin6_addr, &(o)) && \
  		    IN6_ARE_ADDR_EQUAL(&_rt->mf6c_mcastgrp.sin6_addr, &(g)) && \
 @@ -1096,6 +1095,7 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru
  	 * Determine forwarding mifs from the forwarding cache table
  	 */
  	MF6CFIND(ip6->ip6_src, ip6->ip6_dst, rt);
 +	MRT6STAT_INC(mrt6s_mfc_lookups);
  
  	/* Entry exists, so forward if necessary */
  	if (rt) {
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/183462: commit references a PR
Date: Wed, 12 Mar 2014 08:15:22 +0000 (UTC)

 Author: brueffer
 Date: Wed Mar 12 08:15:15 2014
 New Revision: 263069
 URL: http://svnweb.freebsd.org/changeset/base/263069
 
 Log:
   MFC: r261710
   
   Only count table lookups when we're actually processing packets.
   
   PR:		183462
   Submitted by:	Sven-Thorsten Dietrich <thebigcorporation at gmail.com>
   Reviewed by:	bms
 
 Modified:
   stable/10/sys/netinet6/ip6_mroute.c
 Directory Properties:
   stable/10/   (props changed)
 
 Modified: stable/10/sys/netinet6/ip6_mroute.c
 ==============================================================================
 --- stable/10/sys/netinet6/ip6_mroute.c	Wed Mar 12 08:08:41 2014	(r263068)
 +++ stable/10/sys/netinet6/ip6_mroute.c	Wed Mar 12 08:15:15 2014	(r263069)
 @@ -283,7 +283,6 @@ static VNET_DEFINE(int, pim6);
  #define MF6CFIND(o, g, rt) do { \
  	struct mf6c *_rt = mf6ctable[MF6CHASH(o,g)]; \
  	rt = NULL; \
 -	MRT6STAT_INC(mrt6s_mfc_lookups); \
  	while (_rt) { \
  		if (IN6_ARE_ADDR_EQUAL(&_rt->mf6c_origin.sin6_addr, &(o)) && \
  		    IN6_ARE_ADDR_EQUAL(&_rt->mf6c_mcastgrp.sin6_addr, &(g)) && \
 @@ -1099,6 +1098,7 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru
  	 * Determine forwarding mifs from the forwarding cache table
  	 */
  	MF6CFIND(ip6->ip6_src, ip6->ip6_dst, rt);
 +	MRT6STAT_INC(mrt6s_mfc_lookups);
  
  	/* Entry exists, so forward if necessary */
  	if (rt) {
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: brueffer 
State-Changed-When: Wed Mar 12 09:20:41 CET 2014 
State-Changed-Why:  
Merge to stable branches done. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=183462 
>Unformatted:
