All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krishna Kumar <krkumar2@in.ibm.com>
To: netdev@vger.kernel.org
Cc: krkumar2@in.ibm.com, Krishna Kumar <krkumar2@in.ibm.com>
Subject: [PATCH] sched: teql_enqueue can check limits before skb enqueue
Date: Tue, 08 May 2007 13:01:24 +0530	[thread overview]
Message-ID: <20070508073124.17543.7859.sendpatchset@localhost.localdomain> (raw)

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;

             reply	other threads:[~2007-05-08  7:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-08  7:31 Krishna Kumar [this message]
2007-05-09  1:57 ` [PATCH] sched: teql_enqueue can check limits before skb enqueue David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070508073124.17543.7859.sendpatchset@localhost.localdomain \
    --to=krkumar2@in.ibm.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.