Patchwork CHOKe flow scheduler (0.8)

login
register
mail settings
Submitter Eric Dumazet
Date Jan. 14, 2011, 2:24 p.m.
Message ID <1295015043.3937.20.camel@edumazet-laptop>
Download mbox | patch
Permalink /patch/78926/
State Superseded
Delegated to: David Miller
Headers show

Comments

Eric Dumazet - Jan. 14, 2011, 2:24 p.m.
Le vendredi 14 janvier 2011 à 14:55 +0100, Patrick McHardy a écrit :
> On 14.01.2011 14:54, Patrick McHardy wrote:
> > On 14.01.2011 00:34, Stephen Hemminger wrote:
> >> +static int choke_enqueue(struct sk_buff *skb, struct Qdisc *sch)
> >> +{
> >> ...
> >> +	/* Is queue small? */
> >> +	if (p->qavg <= p->qth_min)
> >> +		p->qcount = -1;
> >> +	else {
> >> +		struct sk_buff *oskb;
> >> +		unsigned int idx;
> >> +
> >> +		/* Draw a packet at random from queue */
> >> +		oskb = choke_peek_random(sch, &idx);
> >> +
> >> +		/* Both packets from same flow ? */
> >> +		if (*(unsigned int *)(qdisc_skb_cb(oskb)->data) == hash) {
> >> +			/* Drop both packets */
> >> +			q->stats.matched++;
> >> +			choke_drop_by_idx(q, idx);
> >> +			sch->qstats.backlog -= qdisc_pkt_len(skb);
> >> +			--sch->q.qlen;
> >> +			qdisc_drop(oskb, sch);
> > 
> > You need to adjust the qlen values of parent qdiscs by calling
> > qdisc_tree_decrease_qlen(), they are not aware that a second
> > packet has been dropped.
> 
> I just saw that Eric already fixed this :)
> --

Thanks Patrick, I did that in choke_change() only, not on this part of
the code.


qdisc cbq 1: root refcnt 2 rate 1000Mbit cell 8b (bounded,isolated) prio no-transmit/8 weight 1000Mbit allot 1514b 
level 2 ewma 5 avpkt 1000b maxidle 0us 
 Sent 92016573 bytes 167811 pkt (dropped 615544, overlimits 982637 requeues 0) 
 rate 6248bit 9pps backlog 0b 191202p requeues 0 
  borrowed 0 overactions 0 avgidle 125 undertime 0
qdisc choke 11: parent 1:11 limit 130000b min 10833b max 32500b ewma 13 Plog 21 Scell_log 30
 Sent 91969929 bytes 167257 pkt (dropped 806746, overlimits 424342 requeues 0) 
 rate 56bit 0pps backlog 0b 0p requeues 0 
  marked 0 early 424342 pdrop 0 other 0 matched 191202


So yes : we see 191202 were CHOKed, and upper cbq leaks 191202 packets in 'backlog'

After following patch :


Everything seems fine :

qdisc cbq 1: root refcnt 2 rate 1000Mbit cell 8b (bounded,isolated) prio no-transmit/8 weight 1000Mbit allot 1514b 
level 2 ewma 5 avpkt 1000b maxidle 0us 
 Sent 93962148 bytes 170940 pkt (dropped 633053, overlimits 1010490 requeues 0) 
 rate 568bit 1pps backlog 0b 0p requeues 0 
  borrowed 0 overactions 0 avgidle 125 undertime 0
qdisc choke 11: parent 1:11 limit 130000b min 10833b max 32500b ewma 13 Plog 21 Scell_log 30
 Sent 93957621 bytes 170888 pkt (dropped 829160, overlimits 436946 requeues 0) 
 rate 104bit 0pps backlog 0b 0p requeues 0 
  marked 0 early 436946 pdrop 0 other 0 matched 196107


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c
index 29a91d8..5479f7e 100644
--- a/net/sched/sch_choke.c
+++ b/net/sched/sch_choke.c
@@ -223,6 +223,7 @@  static int choke_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 			q->stats.matched++;
 			choke_drop_by_idx(q, idx);
 			sch->qstats.backlog -= qdisc_pkt_len(oskb);
+			qdisc_tree_decrease_qlen(sch, 1);
 			--sch->q.qlen;
 			qdisc_drop(oskb, sch);
 			goto congestion_drop;