diff options
author | Jitendra Kalsaria <jitendra.kalsaria@qlogic.com> | 2012-07-10 10:57:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-11 02:28:33 -0400 |
commit | 41812db8e2111abbebff4fccffecab1fc1eb090c (patch) | |
tree | 63a08411f7b424aed2e264e126ae5ae17e403fe9 | |
parent | f62a23a7cb601fb30c4a8b8a5ba1c6bb7f5148b3 (diff) |
qlge: Fix TX queue stoppage due to full condition.
TX queue was being stopped at beginning of send path instead
of at the end when last descriptor is used.
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/qlogic/qlge/qlge_main.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c index ca427eb32369..fb86f06e8f1e 100644 --- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c +++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c | |||
@@ -2556,7 +2556,7 @@ static netdev_tx_t qlge_send(struct sk_buff *skb, struct net_device *ndev) | |||
2556 | 2556 | ||
2557 | if (unlikely(atomic_read(&tx_ring->tx_count) < 2)) { | 2557 | if (unlikely(atomic_read(&tx_ring->tx_count) < 2)) { |
2558 | netif_info(qdev, tx_queued, qdev->ndev, | 2558 | netif_info(qdev, tx_queued, qdev->ndev, |
2559 | "%s: shutting down tx queue %d du to lack of resources.\n", | 2559 | "%s: BUG! shutting down tx queue %d due to lack of resources.\n", |
2560 | __func__, tx_ring_idx); | 2560 | __func__, tx_ring_idx); |
2561 | netif_stop_subqueue(ndev, tx_ring->wq_id); | 2561 | netif_stop_subqueue(ndev, tx_ring->wq_id); |
2562 | atomic_inc(&tx_ring->queue_stopped); | 2562 | atomic_inc(&tx_ring->queue_stopped); |
@@ -2610,6 +2610,16 @@ static netdev_tx_t qlge_send(struct sk_buff *skb, struct net_device *ndev) | |||
2610 | tx_ring->prod_idx, skb->len); | 2610 | tx_ring->prod_idx, skb->len); |
2611 | 2611 | ||
2612 | atomic_dec(&tx_ring->tx_count); | 2612 | atomic_dec(&tx_ring->tx_count); |
2613 | |||
2614 | if (unlikely(atomic_read(&tx_ring->tx_count) < 2)) { | ||
2615 | netif_stop_subqueue(ndev, tx_ring->wq_id); | ||
2616 | if ((atomic_read(&tx_ring->tx_count) > (tx_ring->wq_len / 4))) | ||
2617 | /* | ||
2618 | * The queue got stopped because the tx_ring was full. | ||
2619 | * Wake it up, because it's now at least 25% empty. | ||
2620 | */ | ||
2621 | netif_wake_subqueue(qdev->ndev, tx_ring->wq_id); | ||
2622 | } | ||
2613 | return NETDEV_TX_OK; | 2623 | return NETDEV_TX_OK; |
2614 | } | 2624 | } |
2615 | 2625 | ||