From: Krishna Kumar Date: Wed, 9 May 2007 01:57:50 +0000 (-0700) Subject: [NET_SCHED]: teql_enqueue can check limits before skb enqueue X-Git-Tag: v2.6.22-rc1~34^2~23 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cd8c9e87be7ea891050ff1bebbf767a837eb5cf;p=linux-2.6 [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 Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c index d24914db78..f05ad9a30b 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) 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;