Skip to content

Commit

Permalink
[NET_SCHED]: teql_enqueue can check limits before skb enqueue
Browse files Browse the repository at this point in the history
Optimize teql_enqueue so that it first checks limits before enqueing.

Signed-off-by: Krishna Kumar <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
krkumar authored and David S. Miller committed May 11, 2007
1 parent 5b323ed commit 4cd8c9e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/sched/sch_teql.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,13 @@ teql_enqueue(struct sk_buff *skb, struct Qdisc* sch)
struct net_device *dev = sch->dev;
struct teql_sched_data *q = qdisc_priv(sch);

__skb_queue_tail(&q->q, skb);
if (q->q.qlen <= dev->tx_queue_len) {
if (q->q.qlen < dev->tx_queue_len) {
__skb_queue_tail(&q->q, skb);
sch->bstats.bytes += skb->len;
sch->bstats.packets++;
return 0;
}

__skb_unlink(skb, &q->q);
kfree_skb(skb);
sch->qstats.drops++;
return NET_XMIT_DROP;
Expand Down

0 comments on commit 4cd8c9e

Please sign in to comment.