summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2017-05-25 22:39:48 +0000
committerLuiz Souza <luiz@netgate.com>2017-07-15 11:24:07 -0500
commitf51bc51246c7db138115e007f9351ba87387384e (patch)
tree6901ec3fd495999a44527278685c0d8c84c10420
parentee69a0676ef262c886f221f160b183eb0a74a0b2 (diff)
downloadFreeBSD-src-f51bc51246c7db138115e007f9351ba87387384e.zip
FreeBSD-src-f51bc51246c7db138115e007f9351ba87387384e.tar.gz
MFC r318527
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> (cherry picked from commit 7a13da8481a35110d3d84b66b31cd02ed4d9908c)
-rw-r--r--sys/netpfil/ipfw/dn_aqm_pie.c11
-rw-r--r--sys/netpfil/ipfw/dn_sched_fq_pie.c11
2 files changed, 16 insertions, 6 deletions
diff --git a/sys/netpfil/ipfw/dn_aqm_pie.c b/sys/netpfil/ipfw/dn_aqm_pie.c
index 8259d08..c306a4c 100644
--- a/sys/netpfil/ipfw/dn_aqm_pie.c
+++ b/sys/netpfil/ipfw/dn_aqm_pie.c
@@ -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 *
diff --git a/sys/netpfil/ipfw/dn_sched_fq_pie.c b/sys/netpfil/ipfw/dn_sched_fq_pie.c
index 2ba16ab..5ee4006 100644
--- a/sys/netpfil/ipfw/dn_sched_fq_pie.c
+++ b/sys/netpfil/ipfw/dn_sched_fq_pie.c
@@ -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 *
OpenPOWER on IntegriCloud