[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070508073124.17543.7859.sendpatchset@localhost.localdomain>
Date: Tue, 08 May 2007 13:01:24 +0530
From: Krishna Kumar <krkumar2@...ibm.com>
To: netdev@...r.kernel.org
Cc: krkumar2@...ibm.com, Krishna Kumar <krkumar2@...ibm.com>
Subject: [PATCH] sched: teql_enqueue can check limits before skb enqueue
Optimize teql_enqueue so that it first checks limits before
enqueing.
Patch against net-2.6.22.git
Signed-off-by: Krishna Kumar <krkumar2@...ibm.com>
---
diff -ruNp org/net/sched/sch_teql.c new/net/sched/sch_teql.c
--- org/net/sched/sch_teql.c 2007-04-09 12:37:41.000000000 +0530
+++ new/net/sched/sch_teql.c 2007-04-09 12:39:15.000000000 +0530
@@ -94,14 +94,13 @@ teql_enqueue(struct sk_buff *skb, struct
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;
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists