Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Feb 2019 19:57:55 +0000 (UTC)
From:      Tom Jones <thj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r344301 - head/sys/netinet6
Message-ID:  <201902191957.x1JJvtdq065454@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: thj
Date: Tue Feb 19 19:57:55 2019
New Revision: 344301
URL: https://svnweb.freebsd.org/changeset/base/344301

Log:
  When dropping a fragment queue count the number of fragments in the queue
  
  When dropping a fragment queue, account for the number of fragments in the
  queue. This improves accounting between the number of fragments received and
  the number of fragments dropped.
  
  Reviewed by:	jtl, bz, transport
  Approved by:	jtl (mentor), bz (mentor)
  Differential Revision:	https://review.freebsd.org/D17521

Modified:
  head/sys/netinet6/frag6.c

Modified: head/sys/netinet6/frag6.c
==============================================================================
--- head/sys/netinet6/frag6.c	Tue Feb 19 19:37:09 2019	(r344300)
+++ head/sys/netinet6/frag6.c	Tue Feb 19 19:57:55 2019	(r344301)
@@ -593,7 +593,7 @@ insert:
 	     af6 = af6->ip6af_down) {
 		if (af6->ip6af_off != next) {
 			if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) {
-				IP6STAT_INC(ip6s_fragdropped);
+				IP6STAT_ADD(ip6s_fragdropped, q6->ip6q_nfrag);
 				frag6_freef(q6, hash);
 			}
 			IP6Q_UNLOCK(hash);
@@ -603,7 +603,7 @@ insert:
 	}
 	if (af6->ip6af_up->ip6af_mff) {
 		if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) {
-			IP6STAT_INC(ip6s_fragdropped);
+			IP6STAT_ADD(ip6s_fragdropped, q6->ip6q_nfrag);
 			frag6_freef(q6, hash);
 		}
 		IP6Q_UNLOCK(hash);
@@ -861,7 +861,8 @@ frag6_slowtimo(void)
 				--q6->ip6q_ttl;
 				q6 = q6->ip6q_next;
 				if (q6->ip6q_prev->ip6q_ttl == 0) {
-					IP6STAT_INC(ip6s_fragtimeout);
+					IP6STAT_ADD(ip6s_fragtimeout,
+						q6->ip6q_prev->ip6q_nfrag);
 					/* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */
 					frag6_freef(q6->ip6q_prev, i);
 				}
@@ -879,7 +880,8 @@ frag6_slowtimo(void)
 			    (V_ip6_maxfragpackets > 0 &&
 			    V_ip6q[i].count > V_ip6_maxfragbucketsize)) &&
 			    head->ip6q_prev != head) {
-				IP6STAT_INC(ip6s_fragoverflow);
+				IP6STAT_ADD(ip6s_fragoverflow,
+					q6->ip6q_prev->ip6q_nfrag);
 				/* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */
 				frag6_freef(head->ip6q_prev, i);
 			}
@@ -896,7 +898,8 @@ frag6_slowtimo(void)
 			IP6Q_LOCK(i);
 			head = IP6Q_HEAD(i);
 			if (head->ip6q_prev != head) {
-				IP6STAT_INC(ip6s_fragoverflow);
+				IP6STAT_ADD(ip6s_fragoverflow,
+					q6->ip6q_prev->ip6q_nfrag);
 				/* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */
 				frag6_freef(head->ip6q_prev, i);
 			}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902191957.x1JJvtdq065454>