Skip to content

Commit

Permalink
net_sched: pfifo_head_drop problem
Browse files Browse the repository at this point in the history
commit 57dbb2d (sched: add head drop fifo queue)
introduced pfifo_head_drop, and broke the invariant that
sch->bstats.bytes and sch->bstats.packets are COUNTER (increasing
counters only)

This can break estimators because est_timer() handles unsigned deltas
only. A decreasing counter can then give a huge unsigned delta.

My mid term suggestion would be to change things so that
sch->bstats.bytes and sch->bstats.packets are incremented in dequeue()
only, not at enqueue() time. We also could add drop_bytes/drop_packets
and provide estimations of drop rates.

It would be more sensible anyway for very low speeds, and big bursts.
Right now, if we drop packets, they still are accounted in byte/packets
abolute counters and rate estimators.

Before this mid term change, this patch makes pfifo_head_drop behavior
similar to other qdiscs in case of drops :
Dont decrement sch->bstats.bytes and sch->bstats.packets

Signed-off-by: Eric Dumazet <[email protected]>
Acked-by: Hagen Paul Pfeifer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Eric Dumazet authored and davem330 committed Jan 5, 2011
1 parent dbbe68b commit 44b8288
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions net/sched/sch_fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ static int pfifo_tail_enqueue(struct sk_buff *skb, struct Qdisc* sch)

/* queue full, remove one skb to fulfill the limit */
skb_head = qdisc_dequeue_head(sch);
sch->bstats.bytes -= qdisc_pkt_len(skb_head);
sch->bstats.packets--;
sch->qstats.drops++;
kfree_skb(skb_head);

Expand Down

0 comments on commit 44b8288

Please sign in to comment.