Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4cd8c9e87be7ea891050ff1bebbf767a837eb5cf
Commit:     4cd8c9e87be7ea891050ff1bebbf767a837eb5cf
Parent:     5b323edbf9daf287fed50dcc63a85589ba24887b
Author:     Krishna Kumar <[EMAIL PROTECTED]>
AuthorDate: Tue May 8 18:57:50 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Thu May 10 23:45:10 2007 -0700

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 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 d24914d..f05ad9a 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;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to