diff options
author | Jarek Poplawski <jarkao2@gmail.com> | 2008-10-31 03:46:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-31 03:46:19 -0400 |
commit | 03c05f0d4bb0c267edf12d614025a40e33c5a6f9 (patch) | |
tree | c23b79ed8b7dfcdabb872f5c114541ae2de8ac0f /net/sched/sch_atm.c | |
parent | 8e3af97899db433111287e07d5105189f56fe191 (diff) |
pkt_sched: Use qdisc->ops->peek() instead of ->dequeue() & ->requeue()
Use qdisc->ops->peek() instead of ->dequeue() & ->requeue() pair.
After this patch the only remaining user of qdisc->ops->requeue() is
netem_enqueue(). Based on ideas of Herbert Xu, Patrick McHardy and
David S. Miller.
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_atm.c')
-rw-r--r-- | net/sched/sch_atm.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c index f9eac0818d18..2ee0c1a8efa9 100644 --- a/net/sched/sch_atm.c +++ b/net/sched/sch_atm.c | |||
@@ -480,11 +480,14 @@ static void sch_atm_dequeue(unsigned long data) | |||
480 | * If traffic is properly shaped, this won't generate nasty | 480 | * If traffic is properly shaped, this won't generate nasty |
481 | * little bursts. Otherwise, it may ... (but that's okay) | 481 | * little bursts. Otherwise, it may ... (but that's okay) |
482 | */ | 482 | */ |
483 | while ((skb = flow->q->dequeue(flow->q))) { | 483 | while ((skb = flow->q->ops->peek(flow->q))) { |
484 | if (!atm_may_send(flow->vcc, skb->truesize)) { | 484 | if (!atm_may_send(flow->vcc, skb->truesize)) |
485 | (void)flow->q->ops->requeue(skb, flow->q); | ||
486 | break; | 485 | break; |
487 | } | 486 | |
487 | skb = flow->q->dequeue(flow->q); | ||
488 | if (unlikely(!skb)) | ||
489 | break; | ||
490 | |||
488 | pr_debug("atm_tc_dequeue: sending on class %p\n", flow); | 491 | pr_debug("atm_tc_dequeue: sending on class %p\n", flow); |
489 | /* remove any LL header somebody else has attached */ | 492 | /* remove any LL header somebody else has attached */ |
490 | skb_pull(skb, skb_network_offset(skb)); | 493 | skb_pull(skb, skb_network_offset(skb)); |