aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_hw.c
diff options
context:
space:
mode:
authorRajesh Borundia <rajesh.borundia@qlogic.com>2010-10-18 02:03:41 +0000
committerDavid S. Miller <davem@davemloft.net>2010-10-18 07:22:51 -0700
commit7a9905e64272c8021a8cfaf6015dd0fb8eeeb378 (patch)
tree085ccb214fcc14dd2589516bba768a7c23fcef0a /drivers/net/netxen/netxen_nic_hw.c
parentqlcnic: update ethtool stats (diff)
downloadlinux-dev-7a9905e64272c8021a8cfaf6015dd0fb8eeeb378.tar.xz
linux-dev-7a9905e64272c8021a8cfaf6015dd0fb8eeeb378.zip
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_hw.c')
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index 29d7b93d0493..10e2f13d8903 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -598,8 +598,14 @@ netxen_send_cmd_descs(struct netxen_adapter *adapter,
if (nr_desc >= netxen_tx_avail(tx_ring)) {
netif_tx_stop_queue(tx_ring->txq);
- __netif_tx_unlock_bh(tx_ring->txq);
- return -EBUSY;
+ smp_mb();
+ if (netxen_tx_avail(tx_ring) > nr_desc) {
+ if (netxen_tx_avail(tx_ring) > TX_STOP_THRESH)
+ netif_tx_wake_queue(tx_ring->txq);
+ } else {
+ __netif_tx_unlock_bh(tx_ring->txq);
+ return -EBUSY;
+ }
}
do {