From: Auke Kok Date: Fri, 26 May 2006 16:35:47 +0000 (-0700) Subject: ixgb: remove lock access in the fast path X-Git-Tag: v2.6.18-rc1~1115^2~47 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3352a3b20ce880b17f185ad55bf27751f1c8edb9;p=linux-2.6 ixgb: remove lock access in the fast path This mimics a change made in the e1000 driver that imitates a slick tg3 way of avoiding grabbing the lock around restarting the tx queue. Signed-off-by: Jesse Brandeburg Signed-off-by: Auke Kok Signed-off-by: John Ronciak --- diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index b8258509f9..a714c4d2d8 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c @@ -1800,13 +1800,13 @@ ixgb_clean_tx_irq(struct ixgb_adapter *adapter) tx_ring->next_to_clean = i; - spin_lock(&adapter->tx_lock); - if(cleaned && netif_queue_stopped(netdev) && netif_carrier_ok(netdev) && - (IXGB_DESC_UNUSED(tx_ring) > IXGB_TX_QUEUE_WAKE)) { - - netif_wake_queue(netdev); + if (unlikely(netif_queue_stopped(netdev))) { + spin_lock(&adapter->tx_lock); + if (netif_queue_stopped(netdev) && netif_carrier_ok(netdev) && + (IXGB_DESC_UNUSED(tx_ring) > IXGB_TX_QUEUE_WAKE)) + netif_wake_queue(netdev); + spin_unlock(&adapter->tx_lock); } - spin_unlock(&adapter->tx_lock); if(adapter->detect_tx_hung) { /* detect a transmit hang in hardware, this serializes the