diff options
author | Rajesh Borundia <rajesh.borundia@qlogic.com> | 2010-10-17 22:03:41 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-18 10:22:51 -0400 |
commit | 7a9905e64272c8021a8cfaf6015dd0fb8eeeb378 (patch) | |
tree | 085ccb214fcc14dd2589516bba768a7c23fcef0a /drivers/net/netxen/netxen_nic_init.c | |
parent | 3666e0b04f092f9d9da8a6d6a3820de6c870407c (diff) |
netxen: fix race in tx stop queue
There is race between netif_stop_queue and netif_stopped_queue
check.So check once again if buffers are available to avoid race.
With above logic we can also get rid of tx lock in process_cmd_ring.
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_init.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index a2d805aa75cd..95fe552aa279 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -1763,14 +1763,10 @@ int netxen_process_cmd_ring(struct netxen_adapter *adapter) | |||
1763 | 1763 | ||
1764 | smp_mb(); | 1764 | smp_mb(); |
1765 | 1765 | ||
1766 | if (netif_queue_stopped(netdev) && netif_carrier_ok(netdev)) { | 1766 | if (netif_queue_stopped(netdev) && netif_carrier_ok(netdev)) |
1767 | __netif_tx_lock(tx_ring->txq, smp_processor_id()); | 1767 | if (netxen_tx_avail(tx_ring) > TX_STOP_THRESH) |
1768 | if (netxen_tx_avail(tx_ring) > TX_STOP_THRESH) { | ||
1769 | netif_wake_queue(netdev); | 1768 | netif_wake_queue(netdev); |
1770 | adapter->tx_timeo_cnt = 0; | 1769 | adapter->tx_timeo_cnt = 0; |
1771 | } | ||
1772 | __netif_tx_unlock(tx_ring->txq); | ||
1773 | } | ||
1774 | } | 1770 | } |
1775 | /* | 1771 | /* |
1776 | * If everything is freed up to consumer then check if the ring is full | 1772 | * If everything is freed up to consumer then check if the ring is full |