summaryrefslogtreecommitdiffstats
path: root/sys/netpfil/ipfw/dn_aqm_pie.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netpfil/ipfw/dn_aqm_pie.c')
-rw-r--r--sys/netpfil/ipfw/dn_aqm_pie.c11
1 files changed, 8 insertions, 3 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 *
OpenPOWER on IntegriCloud