Author: tuexen
Date: Fri Feb  8 20:42:49 2019
New Revision: 343920
URL: https://svnweb.freebsd.org/changeset/base/343920

Log:
  Ensure that when using the TCP CDG congestion control and setting the
  sysctl variable net.inet.tcp.cc.cdg.smoothing_factor to 0, the smoothing
  is disabled. Without this patch, a division by zero orrurs.
  
  PR:                   193762
  Reviewed by:          lstewart@, rrs@
  MFC after:            3 days
  Sponsored by:         Netflix, Inc.
  Differential Revision:        https://reviews.freebsd.org/D19071

Modified:
  head/sys/netinet/cc/cc_cdg.c

Modified: head/sys/netinet/cc/cc_cdg.c
==============================================================================
--- head/sys/netinet/cc/cc_cdg.c        Fri Feb  8 20:34:47 2019        
(r343919)
+++ head/sys/netinet/cc/cc_cdg.c        Fri Feb  8 20:42:49 2019        
(r343920)
@@ -592,7 +592,11 @@ cdg_ack_received(struct cc_var *ccv, uint16_t ack_type
                        qdiff_min = ((long)(cdg_data->minrtt_in_rtt -
                            cdg_data->minrtt_in_prevrtt) << D_P_E );
 
-                       calc_moving_average(cdg_data, qdiff_max, qdiff_min);
+                       if (cdg_data->sample_q_size == 0) {
+                               cdg_data->max_qtrend = qdiff_max;
+                               cdg_data->min_qtrend = qdiff_min;
+                       } else
+                               calc_moving_average(cdg_data, qdiff_max, 
qdiff_min);
 
                        /* Probabilistic backoff with respect to gradient. */
                        if (slowstart && qdiff_min > 0)
_______________________________________________
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