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_hfsc.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_hfsc.c')
-rw-r--r-- | net/sched/sch_hfsc.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c index c1e77da8cd09..ddfc40887848 100644 --- a/net/sched/sch_hfsc.c +++ b/net/sched/sch_hfsc.c | |||
@@ -880,28 +880,20 @@ set_passive(struct hfsc_class *cl) | |||
880 | */ | 880 | */ |
881 | } | 881 | } |
882 | 882 | ||
883 | /* | ||
884 | * hack to get length of first packet in queue. | ||
885 | */ | ||
886 | static unsigned int | 883 | static unsigned int |
887 | qdisc_peek_len(struct Qdisc *sch) | 884 | qdisc_peek_len(struct Qdisc *sch) |
888 | { | 885 | { |
889 | struct sk_buff *skb; | 886 | struct sk_buff *skb; |
890 | unsigned int len; | 887 | unsigned int len; |
891 | 888 | ||
892 | skb = sch->dequeue(sch); | 889 | skb = sch->ops->peek(sch); |
893 | if (skb == NULL) { | 890 | if (skb == NULL) { |
894 | if (net_ratelimit()) | 891 | if (net_ratelimit()) |
895 | printk("qdisc_peek_len: non work-conserving qdisc ?\n"); | 892 | printk("qdisc_peek_len: non work-conserving qdisc ?\n"); |
896 | return 0; | 893 | return 0; |
897 | } | 894 | } |
898 | len = qdisc_pkt_len(skb); | 895 | len = qdisc_pkt_len(skb); |
899 | if (unlikely(sch->ops->requeue(skb, sch) != NET_XMIT_SUCCESS)) { | 896 | |
900 | if (net_ratelimit()) | ||
901 | printk("qdisc_peek_len: failed to requeue\n"); | ||
902 | qdisc_tree_decrease_qlen(sch, 1); | ||
903 | return 0; | ||
904 | } | ||
905 | return len; | 897 | return len; |
906 | } | 898 | } |
907 | 899 | ||