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 <[EMAIL PROTECTED]>
---

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);
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to