Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Jan 2020 15:50:45 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r356490 - stable/12/sys/netinet6
Message-ID:  <202001081550.008Foj4e013200@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Wed Jan  8 15:50:45 2020
New Revision: 356490
URL: https://svnweb.freebsd.org/changeset/base/356490

Log:
  MFC r344301 (by thj):
  
    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.

Modified:
  stable/12/sys/netinet6/frag6.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet6/frag6.c
==============================================================================
--- stable/12/sys/netinet6/frag6.c	Wed Jan  8 15:41:04 2020	(r356489)
+++ stable/12/sys/netinet6/frag6.c	Wed Jan  8 15:50:45 2020	(r356490)
@@ -672,7 +672,7 @@ insert:
 	     af6 = af6->ip6af_down) {
 		if (af6->ip6af_off != plen) {
 			if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) {
-				IP6STAT_INC(ip6s_fragdropped);
+				IP6STAT_ADD(ip6s_fragdropped, q6->ip6q_nfrag);
 				frag6_freef(q6, bucket);
 			}
 			IP6QB_UNLOCK(bucket);
@@ -682,7 +682,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, bucket);
 		}
 		IP6QB_UNLOCK(bucket);
@@ -826,7 +826,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, bucket);
 				}
@@ -844,7 +845,8 @@ frag6_slowtimo(void)
 			    (V_ip6_maxfragpackets > 0 &&
 			    V_ip6qb[bucket].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, bucket);
 			}
@@ -861,7 +863,8 @@ frag6_slowtimo(void)
 			IP6QB_LOCK(bucket);
 			head = IP6QB_HEAD(bucket);
 			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, bucket);
 			}



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