Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 May 2017 08:38:03 +0000 (UTC)
From:      Don Lewis <truckman@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r318527 - head/sys/netpfil/ipfw
Message-ID:  <201705190838.v4J8c3Jq011370@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: truckman
Date: Fri May 19 08:38:03 2017
New Revision: 318527
URL: https://svnweb.freebsd.org/changeset/base/318527

Log:
  Fix the queue delay estimation in PIE/FQ-PIE when the timestamp
  (TS) method is used.  When packet timestamp is used, the "current_qdelay"
  keeps storing the last queue delay value calculated in the dequeue
  function.  Therefore, when a burst of packets arrives followed by
  a pause, the "current_qdelay" will store a high value caused by the
  burst and stick to that value during the pause because the queue
  delay measurement is done inside the dequeue function.  This causes
  the drop probability calculation function to calculate high drop
  probability value instead of zero and prevents the burst allowance
  mechanism from working properly.  Fix this problem by resetting
  "current_qdelay" inside the drop probability calculation function
  when the queue length is zero and TS option is used.
  
  Submitted by:	Rasool Al-Saadi <ralsaadi@swin.edu.au>
  MFC after:	1 week

Modified:
  head/sys/netpfil/ipfw/dn_aqm_pie.c
  head/sys/netpfil/ipfw/dn_sched_fq_pie.c

Modified: head/sys/netpfil/ipfw/dn_aqm_pie.c
==============================================================================
--- head/sys/netpfil/ipfw/dn_aqm_pie.c	Fri May 19 08:26:41 2017	(r318526)
+++ head/sys/netpfil/ipfw/dn_aqm_pie.c	Fri May 19 08:38:03 2017	(r318527)
@@ -211,11 +211,16 @@ calculate_drop_prob(void *x)
 	pprms = pst->parms;
 	prob = pst->drop_prob;
 
-	/* calculate current qdelay */
-	if (pprms->flags & PIE_DEPRATEEST_ENABLED) {
+	/* calculate current qdelay using DRE method.
+	 * If TS is used and no data in the queue, reset current_qdelay
+	 * as it stays at last value during dequeue process. 
+	*/
+	if (pprms->flags & PIE_DEPRATEEST_ENABLED)
 		pst->current_qdelay = ((uint64_t)pst->pq->ni.len_bytes *
 			pst->avg_dq_time) >> PIE_DQ_THRESHOLD_BITS;
-	}
+	else 
+		if (!pst->pq->ni.len_bytes)
+			 pst->current_qdelay = 0;
 
 	/* calculate drop probability */
 	p = (int64_t)pprms->alpha * 

Modified: head/sys/netpfil/ipfw/dn_sched_fq_pie.c
==============================================================================
--- head/sys/netpfil/ipfw/dn_sched_fq_pie.c	Fri May 19 08:26:41 2017	(r318526)
+++ head/sys/netpfil/ipfw/dn_sched_fq_pie.c	Fri May 19 08:38:03 2017	(r318527)
@@ -383,11 +383,16 @@ fq_calculate_drop_prob(void *x)
 	pprms = pst->parms;
 	prob = pst->drop_prob;
 
-	/* calculate current qdelay */
-	if (pprms->flags & PIE_DEPRATEEST_ENABLED) {
+	/* calculate current qdelay using DRE method.
+	 * If TS is used and no data in the queue, reset current_qdelay
+	 * as it stays at last value during dequeue process.
+	*/
+	if (pprms->flags & PIE_DEPRATEEST_ENABLED)
 		pst->current_qdelay = ((uint64_t)q->stats.len_bytes  * pst->avg_dq_time)
 			>> PIE_DQ_THRESHOLD_BITS;
-	}
+	else
+		if (!q->stats.len_bytes)
+			pst->current_qdelay = 0;
 
 	/* calculate drop probability */
 	p = (int64_t)pprms->alpha * 



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