aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlcnic/qlcnic_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/qlcnic/qlcnic_main.c')
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 06d2dfd646fe..655bccd7f8f4 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -132,12 +132,6 @@ qlcnic_update_cmd_producer(struct qlcnic_adapter *adapter,
132 struct qlcnic_host_tx_ring *tx_ring) 132 struct qlcnic_host_tx_ring *tx_ring)
133{ 133{
134 writel(tx_ring->producer, tx_ring->crb_cmd_producer); 134 writel(tx_ring->producer, tx_ring->crb_cmd_producer);
135
136 if (qlcnic_tx_avail(tx_ring) <= TX_STOP_THRESH) {
137 netif_stop_queue(adapter->netdev);
138 smp_mb();
139 adapter->stats.xmit_off++;
140 }
141} 135}
142 136
143static const u32 msi_tgt_status[8] = { 137static const u32 msi_tgt_status[8] = {
@@ -1137,7 +1131,7 @@ qlcnic_setup_netdev(struct qlcnic_adapter *adapter,
1137 adapter->max_mc_count = 38; 1131 adapter->max_mc_count = 38;
1138 1132
1139 netdev->netdev_ops = &qlcnic_netdev_ops; 1133 netdev->netdev_ops = &qlcnic_netdev_ops;
1140 netdev->watchdog_timeo = 2*HZ; 1134 netdev->watchdog_timeo = 5*HZ;
1141 1135
1142 qlcnic_change_mtu(netdev, netdev->mtu); 1136 qlcnic_change_mtu(netdev, netdev->mtu);
1143 1137
@@ -1709,10 +1703,15 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1709 /* 4 fragments per cmd des */ 1703 /* 4 fragments per cmd des */
1710 no_of_desc = (frag_count + 3) >> 2; 1704 no_of_desc = (frag_count + 3) >> 2;
1711 1705
1712 if (unlikely(no_of_desc + 2 > qlcnic_tx_avail(tx_ring))) { 1706 if (unlikely(qlcnic_tx_avail(tx_ring) <= TX_STOP_THRESH)) {
1713 netif_stop_queue(netdev); 1707 netif_stop_queue(netdev);
1714 adapter->stats.xmit_off++; 1708 smp_mb();
1715 return NETDEV_TX_BUSY; 1709 if (qlcnic_tx_avail(tx_ring) > TX_STOP_THRESH)
1710 netif_start_queue(netdev);
1711 else {
1712 adapter->stats.xmit_off++;
1713 return NETDEV_TX_BUSY;
1714 }
1716 } 1715 }
1717 1716
1718 producer = tx_ring->producer; 1717 producer = tx_ring->producer;
@@ -2018,14 +2017,12 @@ static int qlcnic_process_cmd_ring(struct qlcnic_adapter *adapter)
2018 smp_mb(); 2017 smp_mb();
2019 2018
2020 if (netif_queue_stopped(netdev) && netif_carrier_ok(netdev)) { 2019 if (netif_queue_stopped(netdev) && netif_carrier_ok(netdev)) {
2021 __netif_tx_lock(tx_ring->txq, smp_processor_id());
2022 if (qlcnic_tx_avail(tx_ring) > TX_STOP_THRESH) { 2020 if (qlcnic_tx_avail(tx_ring) > TX_STOP_THRESH) {
2023 netif_wake_queue(netdev); 2021 netif_wake_queue(netdev);
2024 adapter->tx_timeo_cnt = 0;
2025 adapter->stats.xmit_on++; 2022 adapter->stats.xmit_on++;
2026 } 2023 }
2027 __netif_tx_unlock(tx_ring->txq);
2028 } 2024 }
2025 adapter->tx_timeo_cnt = 0;
2029 } 2026 }
2030 /* 2027 /*
2031 * If everything is freed up to consumer then check if the ring is full 2028 * If everything is freed up to consumer then check if the ring is full