[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 <[EMAIL PROTECTED]>
---
commit 78564b29480707a727ef83e5186036d2a280dd57
tree a87b1f211fa627c0d8da240d5e042ffac19324ad
parent 7a2ef66a3ef9321be0e090ab49be8fdde543f10e
author Patrick McHardy <[EMAIL PROTECTED]> Mon, 13 Feb 2006 21:05:11 +0100
committer Patrick McHardy <[EMAIL PROTECTED]> Mon, 13 Feb 2006 21:05:11 +0100
net/sched/sch_sfq.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
index 86d8da0..e057768 100644
--- a/net/sched/sch_sfq.c
+++ b/net/sched/sch_sfq.c
@@ -232,6 +232,7 @@ static unsigned int sfq_drop(struct Qdis
sfq_dec(q, x);
sch->q.qlen--;
sch->qstats.drops++;
+ sch->qstats.backlog -= len;
return len;
}
@@ -248,6 +249,7 @@ static unsigned int sfq_drop(struct Qdis
sch->q.qlen--;
q->ht[q->hash[d]] = SFQ_DEPTH;
sch->qstats.drops++;
+ sch->qstats.backlog -= len;
return len;
}
@@ -266,6 +268,7 @@ sfq_enqueue(struct sk_buff *skb, struct
q->ht[hash] = x = q->dep[SFQ_DEPTH].next;
q->hash[x] = hash;
}
+ sch->qstats.backlog += skb->len;
__skb_queue_tail(&q->qs[x], skb);
sfq_inc(q, x);
if (q->qs[x].qlen == 1) { /* The flow is new */
@@ -301,6 +304,7 @@ sfq_requeue(struct sk_buff *skb, struct
q->ht[hash] = x = q->dep[SFQ_DEPTH].next;
q->hash[x] = hash;
}
+ sch->qstats.backlog += skb->len;
__skb_queue_head(&q->qs[x], skb);
sfq_inc(q, x);
if (q->qs[x].qlen == 1) { /* The flow is new */
@@ -344,6 +348,7 @@ sfq_dequeue(struct Qdisc* sch)
skb = __skb_dequeue(&q->qs[a]);
sfq_dec(q, a);
sch->q.qlen--;
+ sch->qstats.backlog -= skb->len;
/* Is the slot empty? */
if (q->qs[a].qlen == 0) {
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html