From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by huchra.bufferbloat.net (Postfix, from userid 1000) id 0360021F0F4; Fri, 3 Aug 2012 19:45:00 -0700 (PDT) From: =?UTF-8?q?Dave=20T=C3=A4ht?= To: codel@lists.bufferbloat.net Date: Fri, 3 Aug 2012 19:44:59 -0700 Message-Id: <1344048299-26267-1-git-send-email-dave.taht@bufferbloat.net> X-Mailer: git-send-email 1.7.1 Cc: Dave Taht Subject: [Codel] [RFC PATCH] codel: ecn mark at target X-BeenThere: codel@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: CoDel AQM discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Aug 2012 02:45:01 -0000 From: Dave Taht The consensus at ietf was that ecn marking should start at target, and then the results fed into the codel drop scheduler. While I agree with the latter, I feel that waiting an interval before starting to mark will be more in-tune with the concept of a sojourn time, and lead to better utilization. As I am outnumbered and outgunned, do it at target. --- include/net/codel.h | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/include/net/codel.h b/include/net/codel.h index 550debf..f06d99c 100644 --- a/include/net/codel.h +++ b/include/net/codel.h @@ -204,7 +204,7 @@ static codel_time_t codel_control_law(codel_time_t t, } -static bool codel_should_drop(const struct sk_buff *skb, +static bool codel_should_drop(struct sk_buff *skb, struct Qdisc *sch, struct codel_vars *vars, struct codel_params *params, @@ -231,6 +231,9 @@ static bool codel_should_drop(const struct sk_buff *skb, return false; } ok_to_drop = false; + /* Above target, start marking */ + if (params->ecn && INET_ECN_set_ce(skb)) + stats->ecn_mark++; if (vars->first_above_time == 0) { /* just went above from below. If we stay above * for at least interval we'll say it's ok to drop @@ -238,6 +241,7 @@ static bool codel_should_drop(const struct sk_buff *skb, vars->first_above_time = now + params->interval; } else if (codel_time_after(now, vars->first_above_time)) { ok_to_drop = true; + /* dtaht: I think we should start marking here, instead */ } return ok_to_drop; } @@ -280,14 +284,6 @@ static struct sk_buff *codel_dequeue(struct Qdisc *sch, * since there is no more divide */ codel_Newton_step(vars); - if (params->ecn && INET_ECN_set_ce(skb)) { - stats->ecn_mark++; - vars->drop_next = - codel_control_law(vars->drop_next, - params->interval, - vars->rec_inv_sqrt); - goto end; - } qdisc_drop(skb, sch); stats->drop_count++; skb = dequeue_func(vars, sch); @@ -305,16 +301,11 @@ static struct sk_buff *codel_dequeue(struct Qdisc *sch, } } } else if (drop) { - if (params->ecn && INET_ECN_set_ce(skb)) { - stats->ecn_mark++; - } else { - qdisc_drop(skb, sch); - stats->drop_count++; - - skb = dequeue_func(vars, sch); - drop = codel_should_drop(skb, sch, vars, params, - stats, now); - } + qdisc_drop(skb, sch); + stats->drop_count++; + skb = dequeue_func(vars, sch); + drop = codel_should_drop(skb, sch, vars, params, + stats, now); vars->dropping = true; /* if min went above target close to when we last went below it * assume that the drop rate that controlled the queue on the @@ -336,7 +327,6 @@ static struct sk_buff *codel_dequeue(struct Qdisc *sch, vars->drop_next = codel_control_law(now, params->interval, vars->rec_inv_sqrt); } -end: return skb; } #endif -- 1.7.9.5