netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched: Optimize return value of qdisc_restart
@ 2007-05-08  7:31 Krishna Kumar
  2007-05-09  2:05 ` David Miller
  0 siblings, 1 reply; 22+ messages in thread
From: Krishna Kumar @ 2007-05-08  7:31 UTC (permalink / raw)
  To: netdev; +Cc: krkumar2, Krishna Kumar

Optimize return value of qdisc_restart so that it is not called an
extra time if there are no more packets on the queue to be sent out.
It is also not required to check for gso_skb (though the lock is
dropped) since another cpu which added this would have done a
netif_schedule.

Patch against net-2.6.22.git

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
---

diff -ruNp org/net/sched/sch_generic.c new/net/sched/sch_generic.c
--- org/net/sched/sch_generic.c	2007-05-07 17:25:25.000000000 +0530
+++ new/net/sched/sch_generic.c	2007-05-07 17:39:04.000000000 +0530
@@ -115,7 +115,7 @@ static inline int qdisc_restart(struct n
 					kfree_skb(skb);
 					if (net_ratelimit())
 						printk(KERN_DEBUG "Dead loop on netdevice %s, fix it urgently!\n", dev->name);
-					return -1;
+					return q->q.qlen ? -1 : 0;
 				}
 				__get_cpu_var(netdev_rx_stat).cpu_collision++;
 				goto requeue;
@@ -135,7 +135,7 @@ static inline int qdisc_restart(struct n
 						netif_tx_unlock(dev);
 					}
 					spin_lock(&dev->queue_lock);
-					return -1;
+					return q->q.qlen ? -1 : 0;
 				}
 				if (ret == NETDEV_TX_LOCKED && nolock) {
 					spin_lock(&dev->queue_lock);

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2007-05-10 21:11 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-08  7:31 [PATCH] sched: Optimize return value of qdisc_restart Krishna Kumar
2007-05-09  2:05 ` David Miller
2007-05-09  4:35   ` Krishna Kumar2
2007-05-09  6:36     ` David Miller
2007-05-09  7:23       ` Krishna Kumar2
2007-05-09  8:12         ` David Miller
2007-05-09 12:56           ` jamal
2007-05-09 14:47             ` Krishna Kumar2
2007-05-09 15:52               ` jamal
2007-05-10  5:12                 ` Krishna Kumar2
2007-05-10 11:50                   ` Herbert Xu
2007-05-10 11:55                     ` David Miller
2007-05-10 12:10                       ` Herbert Xu
2007-05-10 21:11                         ` David Miller
2007-05-10 12:21                       ` jamal
2007-05-10 12:50                         ` jamal
2007-05-10 12:59                         ` Herbert Xu
2007-05-10 13:18                           ` jamal
2007-05-10 13:52                             ` Herbert Xu
2007-05-10 14:12                               ` jamal
2007-05-10 14:26                                 ` Krishna Kumar2
2007-05-10 14:31                                   ` Herbert Xu

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).