Commit f5539eb8 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[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: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 053cfed7
...@@ -232,6 +232,7 @@ static unsigned int sfq_drop(struct Qdisc *sch) ...@@ -232,6 +232,7 @@ static unsigned int sfq_drop(struct Qdisc *sch)
sfq_dec(q, x); sfq_dec(q, x);
sch->q.qlen--; sch->q.qlen--;
sch->qstats.drops++; sch->qstats.drops++;
sch->qstats.backlog -= len;
return len; return len;
} }
...@@ -248,6 +249,7 @@ static unsigned int sfq_drop(struct Qdisc *sch) ...@@ -248,6 +249,7 @@ static unsigned int sfq_drop(struct Qdisc *sch)
sch->q.qlen--; sch->q.qlen--;
q->ht[q->hash[d]] = SFQ_DEPTH; q->ht[q->hash[d]] = SFQ_DEPTH;
sch->qstats.drops++; sch->qstats.drops++;
sch->qstats.backlog -= len;
return len; return len;
} }
...@@ -266,6 +268,7 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc* sch) ...@@ -266,6 +268,7 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc* sch)
q->ht[hash] = x = q->dep[SFQ_DEPTH].next; q->ht[hash] = x = q->dep[SFQ_DEPTH].next;
q->hash[x] = hash; q->hash[x] = hash;
} }
sch->qstats.backlog += skb->len;
__skb_queue_tail(&q->qs[x], skb); __skb_queue_tail(&q->qs[x], skb);
sfq_inc(q, x); sfq_inc(q, x);
if (q->qs[x].qlen == 1) { /* The flow is new */ if (q->qs[x].qlen == 1) { /* The flow is new */
...@@ -301,6 +304,7 @@ sfq_requeue(struct sk_buff *skb, struct Qdisc* sch) ...@@ -301,6 +304,7 @@ sfq_requeue(struct sk_buff *skb, struct Qdisc* sch)
q->ht[hash] = x = q->dep[SFQ_DEPTH].next; q->ht[hash] = x = q->dep[SFQ_DEPTH].next;
q->hash[x] = hash; q->hash[x] = hash;
} }
sch->qstats.backlog += skb->len;
__skb_queue_head(&q->qs[x], skb); __skb_queue_head(&q->qs[x], skb);
sfq_inc(q, x); sfq_inc(q, x);
if (q->qs[x].qlen == 1) { /* The flow is new */ if (q->qs[x].qlen == 1) { /* The flow is new */
...@@ -344,6 +348,7 @@ sfq_dequeue(struct Qdisc* sch) ...@@ -344,6 +348,7 @@ sfq_dequeue(struct Qdisc* sch)
skb = __skb_dequeue(&q->qs[a]); skb = __skb_dequeue(&q->qs[a]);
sfq_dec(q, a); sfq_dec(q, a);
sch->q.qlen--; sch->q.qlen--;
sch->qstats.backlog -= skb->len;
/* Is the slot empty? */ /* Is the slot empty? */
if (q->qs[a].qlen == 0) { if (q->qs[a].qlen == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment