Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Feb 2019 20:42:50 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r343920 - head/sys/netinet/cc
Message-ID:  <201902082042.x18Kgod2018006@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



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