diff options
author | Jarek Poplawski <jarkao2@gmail.com> | 2008-10-31 03:47:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-31 03:47:01 -0400 |
commit | 77be155cba4e163e8bba9fd27222a8b6189ec4f7 (patch) | |
tree | 0819d4c0bb760080aaba8a00060a774205914034 /net/sched/sch_tbf.c | |
parent | 03c05f0d4bb0c267edf12d614025a40e33c5a6f9 (diff) |
pkt_sched: Add peek emulation for non-work-conserving qdiscs.
This patch adds qdisc_peek_dequeued() wrapper to emulate peek method
with qdisc->dequeue() and storing "peeked" skb in qdisc->gso_skb until
dequeuing. This is mainly for compatibility reasons not to break some
strange configs because peeking is expected for non-work-conserving
parent qdiscs to query work-conserving child qdiscs.
This implementation requires using qdisc_dequeue_peeked() wrapper
instead of directly calling qdisc->dequeue() for all qdiscs ever
querried with qdisc->ops->peek() or qdisc_peek_dequeued().
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_tbf.c')
-rw-r--r-- | net/sched/sch_tbf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c index 61fdc77a48d2..435076cf620e 100644 --- a/net/sched/sch_tbf.c +++ b/net/sched/sch_tbf.c | |||
@@ -192,7 +192,7 @@ static struct sk_buff *tbf_dequeue(struct Qdisc* sch) | |||
192 | toks -= L2T(q, len); | 192 | toks -= L2T(q, len); |
193 | 193 | ||
194 | if ((toks|ptoks) >= 0) { | 194 | if ((toks|ptoks) >= 0) { |
195 | skb = q->qdisc->dequeue(q->qdisc); | 195 | skb = qdisc_dequeue_peeked(q->qdisc); |
196 | if (unlikely(!skb)) | 196 | if (unlikely(!skb)) |
197 | return NULL; | 197 | return NULL; |
198 | 198 | ||
@@ -467,6 +467,7 @@ static struct Qdisc_ops tbf_qdisc_ops __read_mostly = { | |||
467 | .priv_size = sizeof(struct tbf_sched_data), | 467 | .priv_size = sizeof(struct tbf_sched_data), |
468 | .enqueue = tbf_enqueue, | 468 | .enqueue = tbf_enqueue, |
469 | .dequeue = tbf_dequeue, | 469 | .dequeue = tbf_dequeue, |
470 | .peek = qdisc_peek_dequeued, | ||
470 | .requeue = tbf_requeue, | 471 | .requeue = tbf_requeue, |
471 | .drop = tbf_drop, | 472 | .drop = tbf_drop, |
472 | .init = tbf_init, | 473 | .init = tbf_init, |