* [PATCH] sched: teql_enqueue can check limits before skb enqueue
@ 2007-05-08 7:31 Krishna Kumar
2007-05-09 1:57 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Krishna Kumar @ 2007-05-08 7:31 UTC (permalink / raw)
To: netdev; +Cc: krkumar2, Krishna Kumar
Optimize teql_enqueue so that it first checks limits before
enqueing.
Patch against net-2.6.22.git
Signed-off-by: Krishna Kumar <krkumar2@in.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;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-05-09 1:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-08 7:31 [PATCH] sched: teql_enqueue can check limits before skb enqueue Krishna Kumar
2007-05-09 1:57 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).