Re: [PATCH v2] net_sched: sch_sfq: fix allot handling

Eric Dumazet
2010-12-15T16:55:26Z

Le mercredi 15 décembre 2010 à 17:43 +0100, Patrick McHardy a écrit :

> Now we could remove the allot increase in sfq_dequeue for
> the case that the flow becomes inactive. It is incorrect
> anyways.

Hmm, we increase the allot for the next slot, not for the slot now
empty.

/* Is the slot empty? */
if (q->qs[a].qlen == 0) {
q->ht[q->hash[a]] = SFQ_DEPTH;
a = q->next[a]; // a = next slot index
if (a == old_a) {
q->tail = SFQ_DEPTH;
return skb;
}
q->next[q->tail] = a;
q->allot[a] += q->quantum;
// HERE, q->allot[a] is for next slot, we give it its quantum for being
activated

} else if ((q->allot[a] -= qdisc_pkt_len(skb)) <= 0) {

Maybe we should rename (a / old_a) by (a / next_a) to avoid confusion :)

I was thinking in allowing more packets per SFQ (but keep the 126 active
flows limit), what do you think ?