diff options
author | Krishna Kumar <krkumar2@in.ibm.com> | 2007-05-08 21:57:50 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-05-11 02:45:10 -0400 |
commit | 4cd8c9e87be7ea891050ff1bebbf767a837eb5cf (patch) | |
tree | 2ade61b3b9c0cdc88f49cd854d799475b3298475 /net/sched/sch_teql.c | |
parent | 5b323edbf9daf287fed50dcc63a85589ba24887b (diff) |
[NET_SCHED]: teql_enqueue can check limits before skb enqueue
Optimize teql_enqueue so that it first checks limits before enqueing.
Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_teql.c')
-rw-r--r-- | net/sched/sch_teql.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c index d24914db7861..f05ad9a30b4c 100644 --- a/net/sched/sch_teql.c +++ b/net/sched/sch_teql.c | |||
@@ -94,14 +94,13 @@ teql_enqueue(struct sk_buff *skb, struct Qdisc* sch) | |||
94 | struct net_device *dev = sch->dev; | 94 | struct net_device *dev = sch->dev; |
95 | struct teql_sched_data *q = qdisc_priv(sch); | 95 | struct teql_sched_data *q = qdisc_priv(sch); |
96 | 96 | ||
97 | __skb_queue_tail(&q->q, skb); | 97 | if (q->q.qlen < dev->tx_queue_len) { |
98 | if (q->q.qlen <= dev->tx_queue_len) { | 98 | __skb_queue_tail(&q->q, skb); |
99 | sch->bstats.bytes += skb->len; | 99 | sch->bstats.bytes += skb->len; |
100 | sch->bstats.packets++; | 100 | sch->bstats.packets++; |
101 | return 0; | 101 | return 0; |
102 | } | 102 | } |
103 | 103 | ||
104 | __skb_unlink(skb, &q->q); | ||
105 | kfree_skb(skb); | 104 | kfree_skb(skb); |
106 | sch->qstats.drops++; | 105 | sch->qstats.drops++; |
107 | return NET_XMIT_DROP; | 106 | return NET_XMIT_DROP; |