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_netem.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_netem.c')
-rw-r--r-- | net/sched/sch_netem.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index 74fbdb52baed..3080bd6ee332 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
@@ -290,8 +290,8 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch) | |||
290 | 290 | ||
291 | /* if more time remaining? */ | 291 | /* if more time remaining? */ |
292 | if (cb->time_to_send <= now) { | 292 | if (cb->time_to_send <= now) { |
293 | skb = q->qdisc->dequeue(q->qdisc); | 293 | skb = qdisc_dequeue_peeked(q->qdisc); |
294 | if (!skb) | 294 | if (unlikely(!skb)) |
295 | return NULL; | 295 | return NULL; |
296 | 296 | ||
297 | pr_debug("netem_dequeue: return skb=%p\n", skb); | 297 | pr_debug("netem_dequeue: return skb=%p\n", skb); |
@@ -714,6 +714,7 @@ static struct Qdisc_ops netem_qdisc_ops __read_mostly = { | |||
714 | .priv_size = sizeof(struct netem_sched_data), | 714 | .priv_size = sizeof(struct netem_sched_data), |
715 | .enqueue = netem_enqueue, | 715 | .enqueue = netem_enqueue, |
716 | .dequeue = netem_dequeue, | 716 | .dequeue = netem_dequeue, |
717 | .peek = qdisc_peek_dequeued, | ||
717 | .requeue = netem_requeue, | 718 | .requeue = netem_requeue, |
718 | .drop = netem_drop, | 719 | .drop = netem_drop, |
719 | .init = netem_init, | 720 | .init = netem_init, |