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);
                        }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to