public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Changli Gao <xiaosuo@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>,
	Dave Taht <dave.taht@bufferbloat.net>,
	Kathleen Nichols <nichols@pollere.com>,
	Van Jacobson <van@pollere.net>, Tom Herbert <therbert@google.com>,
	Matt Mathis <mattmathis@google.com>,
	Yuchung Cheng <ycheng@google.com>,
	Stephen Hemminger <shemminger@vyatta.com>
Subject: Re: [PATCH net-next] fq_codel: Fair Queue Codel AQM
Date: Fri, 11 May 2012 18:08:36 +0200	[thread overview]
Message-ID: <1336752516.31653.196.camel@edumazet-glaptop> (raw)
In-Reply-To: <1336749810.31653.176.camel@edumazet-glaptop>

On Fri, 2012-05-11 at 17:23 +0200, Eric Dumazet wrote:

> Its possible I missed something, because in my first coding I had 3
> lists.
> 
> Anyway I'll send a V2 because I left .change method to NULL, while the
> intent was to permit a change on fq_codel.

Before sending v2, here is the diff against v1 :

 net/sched/sch_fq_codel.c |   26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
index 8675ff8..f29a967 100644
--- a/net/sched/sch_fq_codel.c
+++ b/net/sched/sch_fq_codel.c
@@ -231,18 +231,16 @@ static struct sk_buff *fq_codel_dequeue(struct Qdisc *sch)
 	struct fq_codel_sched_data *q = qdisc_priv(sch);
 	struct sk_buff *skb;
 	struct fq_codel_flow *flow;
+	struct list_head *head;
 
 begin:
-	if (!list_empty(&q->new_flows))
-		flow = list_first_entry(&q->new_flows,
-					struct fq_codel_flow,
-					flowchain);
-	else if (!list_empty(&q->old_flows))
-		flow = list_first_entry(&q->old_flows,
-					struct fq_codel_flow,
-					flowchain);
-	else
-		return NULL;
+	head = &q->new_flows;
+	if (list_empty(head)) {
+		head = &q->old_flows;
+		if (list_empty(head))
+			return NULL;
+	}
+	flow = list_first_entry(head, struct fq_codel_flow, flowchain);
 
 	if (flow->deficit <= 0) {
 		flow->deficit += q->quantum;
@@ -252,7 +250,11 @@ begin:
 	skb = codel_dequeue(sch, &q->cparams, &flow->cvars, &q->cstats,
 			    dequeue, &q->backlogs[flow - q->flows]);
 	if (!skb) {
-		list_del_init(&flow->flowchain);
+		/* force a pass through old_flows to prevent starvation */
+		if ((head == &q->new_flows) && !list_empty(&q->old_flows))
+			list_move_tail(&flow->flowchain, &q->old_flows);
+		else
+			list_del_init(&flow->flowchain);
 		goto begin;
 	}
 	qdisc_bstats_update(sch, skb);
@@ -573,7 +575,7 @@ static struct Qdisc_ops fq_codel_qdisc_ops __read_mostly = {
 	.init		=	fq_codel_init,
 	.reset		=	fq_codel_reset,
 	.destroy	=	fq_codel_destroy,
-	.change		=	NULL,
+	.change		=	fq_codel_change,
 	.dump		=	fq_codel_dump,
 	.dump_stats =	fq_codel_dump_stats,
 	.owner		=	THIS_MODULE,

  reply	other threads:[~2012-05-11 16:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-11 13:59 [PATCH net-next] fq_codel: Fair Queue Codel AQM Eric Dumazet
2012-05-11 15:03 ` Changli Gao
2012-05-11 15:23   ` Eric Dumazet
2012-05-11 16:08     ` Eric Dumazet [this message]
2012-05-11 18:49       ` pch_gbe oops with vlan Andy Cress
2012-05-11 20:36         ` David Miller
2012-05-11 19:30       ` [PATCH v2 net-next] fq_codel: Fair Queue Codel AQM Eric Dumazet
2012-05-11 19:49         ` [PATCH v2 iproute2] " Eric Dumazet
2012-05-11 22:16         ` [PATCH v2 net-next] " Eric Dumazet
2012-05-11 22:17           ` David Miller
2012-05-12 19:55           ` David Miller
2012-05-12 20:42             ` Eric Dumazet

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=1336752516.31653.196.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=dave.taht@bufferbloat.net \
    --cc=davem@davemloft.net \
    --cc=mattmathis@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=nichols@pollere.com \
    --cc=shemminger@vyatta.com \
    --cc=therbert@google.com \
    --cc=van@pollere.net \
    --cc=xiaosuo@gmail.com \
    --cc=ycheng@google.com \
    /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