* [PATCH 2.6.25] - Fix transmit queue stop mechanism
@ 2008-03-13 7:13 Divy Le Ray
2008-03-17 12:09 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Divy Le Ray @ 2008-03-13 7:13 UTC (permalink / raw)
To: jeff; +Cc: netdev, linux-kernel, swise
From: Divy Le Ray <divy@chelsio.com>
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>
---
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 979f3fc..db58687 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)
}
q->in_use += ndesc;
- if (unlikely(credits - ndesc < q->stop_thres))
- if (USE_GTS || !should_restart_tx(q))
- t3_stop_queue(dev, qs, q);
+ if (unlikely(credits - ndesc < q->stop_thres)) {
+ t3_stop_queue(dev, qs, q);
+
+ if (should_restart_tx(q) &&
+ test_and_clear_bit(TXQ_ETH, &qs->txq_stopped)) {
+ q->restarts++;
+ netif_wake_queue(dev);
+ }
+ }
gen = q->gen;
q->unacked += ndesc;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2.6.25] - Fix transmit queue stop mechanism
2008-03-13 7:13 [PATCH 2.6.25] - Fix transmit queue stop mechanism Divy Le Ray
@ 2008-03-17 12:09 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2008-03-17 12:09 UTC (permalink / raw)
To: Divy Le Ray; +Cc: netdev, linux-kernel, swise
Divy Le Ray wrote:
> From: Divy Le Ray <divy@chelsio.com>
>
> 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>
> ---
>
> drivers/net/cxgb3/sge.c | 12 +++++++++---
> 1 files changed, 9 insertions(+), 3 deletions(-)
applied -- please include "cxgb3: " prefix in your subject line next time.
See http://linux.yyz.us/patch-format.html for more info.
Jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-03-17 12:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-13 7:13 [PATCH 2.6.25] - Fix transmit queue stop mechanism Divy Le Ray
2008-03-17 12:09 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).