Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223641
b: refs/heads/master
c: aa3e219
h: refs/heads/master
i:
  223639: 35d05de
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Dec 20, 2010
1 parent fffc41b commit 03edb97
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 914e5cea14b2e4651cdb0707e0936b43246deda0
refs/heads/master: aa3e219997e4b949be4199660936099ded0b401f
20 changes: 8 additions & 12 deletions trunk/net/sched/sch_sfq.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ static unsigned int sfq_drop(struct Qdisc *sch)
/* It is difficult to believe, but ALL THE SLOTS HAVE LENGTH 1. */
d = q->next[q->tail];
q->next[q->tail] = q->next[d];
q->allot[q->next[d]] += q->quantum;
skb = q->qs[d].prev;
len = qdisc_pkt_len(skb);
__skb_unlink(skb, &q->qs[d]);
Expand Down Expand Up @@ -321,14 +320,13 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
sfq_inc(q, x);
if (q->qs[x].qlen == 1) { /* The flow is new */
if (q->tail == SFQ_DEPTH) { /* It is the first flow */
q->tail = x;
q->next[x] = x;
q->allot[x] = q->quantum;
} else {
q->next[x] = q->next[q->tail];
q->next[q->tail] = x;
q->tail = x;
}
q->tail = x;
q->allot[x] = q->quantum;
}
if (++sch->q.qlen <= q->limit) {
sch->bstats.bytes += qdisc_pkt_len(skb);
Expand Down Expand Up @@ -359,13 +357,13 @@ sfq_dequeue(struct Qdisc *sch)
{
struct sfq_sched_data *q = qdisc_priv(sch);
struct sk_buff *skb;
sfq_index a, old_a;
sfq_index a, next_a;

/* No active slots */
if (q->tail == SFQ_DEPTH)
return NULL;

a = old_a = q->next[q->tail];
a = q->next[q->tail];

/* Grab packet */
skb = __skb_dequeue(&q->qs[a]);
Expand All @@ -376,17 +374,15 @@ sfq_dequeue(struct Qdisc *sch)
/* Is the slot empty? */
if (q->qs[a].qlen == 0) {
q->ht[q->hash[a]] = SFQ_DEPTH;
a = q->next[a];
if (a == old_a) {
next_a = q->next[a];
if (a == next_a) {
q->tail = SFQ_DEPTH;
return skb;
}
q->next[q->tail] = a;
q->allot[a] += q->quantum;
q->next[q->tail] = next_a;
} else if ((q->allot[a] -= qdisc_pkt_len(skb)) <= 0) {
q->tail = a;
a = q->next[a];
q->allot[a] += q->quantum;
q->tail = a;
}
return skb;
}
Expand Down

0 comments on commit 03edb97

Please sign in to comment.