Commit:     5f1a485d5905aa641f33009019b3699076666a4c
Parent:     9418d5dc9ba40b88737580457bf3b7c63c60ec43
Author:     Peter P Waskiewicz Jr <[EMAIL PROTECTED]>
AuthorDate: Tue Nov 13 20:40:55 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Tue Nov 13 20:40:55 2007 -0800

    [PKT_SCHED]: Check subqueue status before calling hard_start_xmit
    The only qdiscs that check subqueue state before dequeue'ing are PRIO
    and RR.  The other qdiscs, including the default pfifo_fast qdisc,
    will allow traffic bound for subqueue 0 through to hard_start_xmit.
    The check for netif_queue_stopped() is done above in pkt_sched.h, so
    it is unnecessary for qdisc_restart().  However, if the underlying
    driver is multiqueue capable, and only sets queue states on subqueues,
    this will allow packets to enter the driver when it's currently unable
    to process packets, resulting in expensive requeues and driver
    entries.  This patch re-adds the check for the subqueue status before
    calling hard_start_xmit, so we can try and avoid the driver entry when
    the queues are stopped.
    Signed-off-by: Peter P Waskiewicz Jr <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
 net/sched/sch_generic.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index fa1a6f4..e595e65 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -134,7 +134,7 @@ static inline int qdisc_restart(struct net_device *dev)
        struct Qdisc *q = dev->qdisc;
        struct sk_buff *skb;
-       int ret;
+       int ret = NETDEV_TX_BUSY;
        /* Dequeue packet */
        if (unlikely((skb = dev_dequeue_skb(dev, q)) == NULL))
@@ -145,7 +145,8 @@ static inline int qdisc_restart(struct net_device *dev)
        HARD_TX_LOCK(dev, smp_processor_id());
-       ret = dev_hard_start_xmit(skb, dev);
+       if (!netif_subqueue_stopped(dev, skb))
+               ret = dev_hard_start_xmit(skb, dev);
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

Reply via email to