aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_sfq.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2006-03-20 22:01:38 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-20 22:01:38 -0500
commitf5539eb8caa52a9198079df767cc1bb5494e69e3 (patch)
treefa24490b12273384dfced2f664090b7fbf469e1e /net/sched/sch_sfq.c
parent053cfed75d9e01bda274c5b0126f5937181dcb62 (diff)
[PKT_SCHED]: Keep backlog counter in sch_sfq
Keep backlog counter in SFQ qdisc to make it usable as child qdisc with RED. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_sfq.c')
-rw-r--r--net/sched/sch_sfq.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
index 86d8da0cbd02..e057768f68b4 100644
--- a/net/sched/sch_sfq.c
+++ b/net/sched/sch_sfq.c
@@ -232,6 +232,7 @@ static unsigned int sfq_drop(struct Qdisc *sch)
232 sfq_dec(q, x); 232 sfq_dec(q, x);
233 sch->q.qlen--; 233 sch->q.qlen--;
234 sch->qstats.drops++; 234 sch->qstats.drops++;
235 sch->qstats.backlog -= len;
235 return len; 236 return len;
236 } 237 }
237 238
@@ -248,6 +249,7 @@ static unsigned int sfq_drop(struct Qdisc *sch)
248 sch->q.qlen--; 249 sch->q.qlen--;
249 q->ht[q->hash[d]] = SFQ_DEPTH; 250 q->ht[q->hash[d]] = SFQ_DEPTH;
250 sch->qstats.drops++; 251 sch->qstats.drops++;
252 sch->qstats.backlog -= len;
251 return len; 253 return len;
252 } 254 }
253 255
@@ -266,6 +268,7 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc* sch)
266 q->ht[hash] = x = q->dep[SFQ_DEPTH].next; 268 q->ht[hash] = x = q->dep[SFQ_DEPTH].next;
267 q->hash[x] = hash; 269 q->hash[x] = hash;
268 } 270 }
271 sch->qstats.backlog += skb->len;
269 __skb_queue_tail(&q->qs[x], skb); 272 __skb_queue_tail(&q->qs[x], skb);
270 sfq_inc(q, x); 273 sfq_inc(q, x);
271 if (q->qs[x].qlen == 1) { /* The flow is new */ 274 if (q->qs[x].qlen == 1) { /* The flow is new */
@@ -301,6 +304,7 @@ sfq_requeue(struct sk_buff *skb, struct Qdisc* sch)
301 q->ht[hash] = x = q->dep[SFQ_DEPTH].next; 304 q->ht[hash] = x = q->dep[SFQ_DEPTH].next;
302 q->hash[x] = hash; 305 q->hash[x] = hash;
303 } 306 }
307 sch->qstats.backlog += skb->len;
304 __skb_queue_head(&q->qs[x], skb); 308 __skb_queue_head(&q->qs[x], skb);
305 sfq_inc(q, x); 309 sfq_inc(q, x);
306 if (q->qs[x].qlen == 1) { /* The flow is new */ 310 if (q->qs[x].qlen == 1) { /* The flow is new */
@@ -344,6 +348,7 @@ sfq_dequeue(struct Qdisc* sch)
344 skb = __skb_dequeue(&q->qs[a]); 348 skb = __skb_dequeue(&q->qs[a]);
345 sfq_dec(q, a); 349 sfq_dec(q, a);
346 sch->q.qlen--; 350 sch->q.qlen--;
351 sch->qstats.backlog -= skb->len;
347 352
348 /* Is the slot empty? */ 353 /* Is the slot empty? */
349 if (q->qs[a].qlen == 0) { 354 if (q->qs[a].qlen == 0) {