diff options
author | Divy Le Ray <divy@chelsio.com> | 2008-03-13 03:13:30 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-03-17 08:07:01 -0400 |
commit | cd7e903440bad2625afa4090f34bf497593656cd (patch) | |
tree | fd718ac8012aa60ad855556bc0caa903fe69ac4c /drivers/net | |
parent | cdb346977829885cbd8b1200ca21049b1df242ad (diff) |
cxgb3: Fix transmit queue stop mechanism
The last change in the Tx queue stop mechanism opens a window
where the Tx queue might be stopped after pending credits
returned.
Tx credits are returned via a control message generated by the HW.
It returns tx credits on demand, triggered by a completion bit
set in selective transmit packet headers.
The current code can lead to the Tx queue stopped
with all pending credits returned, and the current frame
not triggering a credit return. The Tx queue will then never be
awaken.
The driver could alternatively request a completion for packets
that stop the queue. It's however safer at this point to go back
to the pre-existing behaviour.
Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/cxgb3/sge.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index 979f3fc5e765..db586870c5f4 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c | |||
@@ -1107,9 +1107,15 @@ int t3_eth_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1107 | } | 1107 | } |
1108 | 1108 | ||
1109 | q->in_use += ndesc; | 1109 | q->in_use += ndesc; |
1110 | if (unlikely(credits - ndesc < q->stop_thres)) | 1110 | if (unlikely(credits - ndesc < q->stop_thres)) { |
1111 | if (USE_GTS || !should_restart_tx(q)) | 1111 | t3_stop_queue(dev, qs, q); |
1112 | t3_stop_queue(dev, qs, q); | 1112 | |
1113 | if (should_restart_tx(q) && | ||
1114 | test_and_clear_bit(TXQ_ETH, &qs->txq_stopped)) { | ||
1115 | q->restarts++; | ||
1116 | netif_wake_queue(dev); | ||
1117 | } | ||
1118 | } | ||
1113 | 1119 | ||
1114 | gen = q->gen; | 1120 | gen = q->gen; |
1115 | q->unacked += ndesc; | 1121 | q->unacked += ndesc; |