netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leslie Monis <lesliemonis@gmail.com>
To: jhs@mojatatu.com
Cc: netdev@vger.kernel.org, tahiliani@nitk.edu.in,
	dhavaljkhandla26@gmail.com, hrishihiraskar@gmail.com,
	bmanish15597@gmail.com, sdp.sachin@gmail.com
Subject: [PATCH net-next 7/8] net: sched: pie: add derandomization mechanism
Date: Wed, 31 Oct 2018 21:49:31 +0530	[thread overview]
Message-ID: <1541002772-28040-8-git-send-email-lesliemonis@gmail.com> (raw)
In-Reply-To: <1541002772-28040-1-git-send-email-lesliemonis@gmail.com>

From: "Mohit P. Tahiliani" <tahiliani@nitk.edu.in>

Random dropping of packets to achieve latency control may
introduce outlier situations where packets are dropped too
close to each other or too far from each other. This can
cause the real drop percentage to temporarily deviate from
the intended drop probability. In certain scenarios, such
as a small number of simultaneous TCP flows, these
deviations can cause significant deviations in link
utilization and queuing latency. RFC 8033 suggests using a
derandomization mechanism to avoid these deviations.

Signed-off-by: Mohit P. Tahiliani <tahiliani@nitk.edu.in>
Signed-off-by: Dhaval Khandla <dhavaljkhandla26@gmail.com>
Signed-off-by: Hrishikesh Hiraskar <hrishihiraskar@gmail.com>
Signed-off-by: Manish Kumar B <bmanish15597@gmail.com>
Signed-off-by: Sachin D. Patil <sdp.sachin@gmail.com>
Signed-off-by: Leslie Monis <lesliemonis@gmail.com>
---
 net/sched/sch_pie.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/net/sched/sch_pie.c b/net/sched/sch_pie.c
index b68b367..88e605c 100644
--- a/net/sched/sch_pie.c
+++ b/net/sched/sch_pie.c
@@ -58,6 +58,7 @@ struct pie_vars {
 	u32 avg_dq_rate;	/* bytes per pschedtime tick,scaled */
 	u32 qlen_old;		/* in bytes */
 	bool active;		/* inactive/active */
+	u64 accu_prob;		/* accumulated drop probability */
 };
 
 /* statistics gathering */
@@ -96,6 +97,7 @@ static void pie_vars_init(struct pie_vars *vars)
 	/* default of 150 ms in pschedtime */
 	vars->burst_time = PSCHED_NS2TICKS(150 * NSEC_PER_MSEC);
 	vars->active = true;
+	vars->accu_prob = 0;
 }
 
 static bool drop_early(struct Qdisc *sch, u32 packet_size)
@@ -130,9 +132,21 @@ static bool drop_early(struct Qdisc *sch, u32 packet_size)
 	else
 		local_prob = q->vars.prob;
 
+	if (local_prob == 0)
+		q->vars.accu_prob = 0;
+
+	q->vars.accu_prob += local_prob;
+
+	if (q->vars.accu_prob < (MAX_PROB / 100) * 85)
+		return false;
+	if (q->vars.accu_prob >= ((u64)MAX_PROB * 17) / 2)
+		return true;
+
 	rnd = prandom_u32();
-	if (rnd < local_prob)
+	if (rnd < local_prob) {
+		q->vars.accu_prob = 0;
 		return true;
+	}
 
 	return false;
 }
@@ -181,6 +195,7 @@ static int pie_qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch,
 
 out:
 	q->stats.dropped++;
+	q->vars.accu_prob = 0;
 	return qdisc_drop(skb, sch, to_free);
 }
 
-- 
2.7.4

  parent reply	other threads:[~2018-11-01  1:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-31 16:19 [PATCH net-next 0/8] net: sched: pie: align PIE implementation with RFC 8033 Leslie Monis
2018-10-31 16:19 ` [PATCH net-next 1/8] net: sched: pie: change value of QUEUE_THRESHOLD Leslie Monis
2018-10-31 16:19 ` [PATCH net-next 2/8] net: sched: pie: change default value of pie_params->target Leslie Monis
2018-10-31 16:19 ` [PATCH net-next 3/8] net: sched: pie: change default value of pie_params->tupdate Leslie Monis
2018-10-31 16:19 ` [PATCH net-next 4/8] net: sched: pie: change initial value of pie_vars->burst_time Leslie Monis
2018-10-31 16:19 ` [PATCH net-next 5/8] net: sched: pie: add more conditions to auto-tune alpha and beta Leslie Monis
2018-10-31 16:40   ` Stephen Hemminger
2018-10-31 16:19 ` [PATCH net-next 6/8] net: sched: pie: add mechanism to set PIE active/inactive Leslie Monis
2018-10-31 16:41   ` Stephen Hemminger
2018-10-31 16:19 ` Leslie Monis [this message]
2018-10-31 16:38   ` [PATCH net-next 7/8] net: sched: pie: add derandomization mechanism Stephen Hemminger
2018-10-31 16:19 ` [PATCH net-next 8/8] net: sched: pie: update references Leslie Monis
2018-10-31 16:36 ` [PATCH net-next 0/8] net: sched: pie: align PIE implementation with RFC 8033 Stephen Hemminger
2018-10-31 17:43 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1541002772-28040-8-git-send-email-lesliemonis@gmail.com \
    --to=lesliemonis@gmail.com \
    --cc=bmanish15597@gmail.com \
    --cc=dhavaljkhandla26@gmail.com \
    --cc=hrishihiraskar@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=sdp.sachin@gmail.com \
    --cc=tahiliani@nitk.edu.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).