diff options
author | Jiajun Wu <b06378@freescale.com> | 2010-01-18 00:47:50 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-19 04:59:03 -0500 |
commit | 34692421bc7d6145ef383b014860f4fde10b7505 (patch) | |
tree | ab1674b67e9169940a206b43c0d7dd8d0b6c139f /drivers/net/ucc_geth.c | |
parent | 4f9c85a1b03bfa5c0a0d8488a3a7766f3c9fb756 (diff) |
ucc_geth: Fix full TX queue processing
commit 7583605b6d29f1f7f6fc505b883328089f3485ad ("ucc_geth: Fix empty
TX queue processing") fixed empty TX queue mishandling, but didn't
account another corner case: when TX queue becomes full.
Without this patch the driver will stop transmiting when TX queue
becomes full since 'bd == ugeth->txBd[txQ]' actually checks for
two things: queue empty or full.
Let's better check for NULL skb, which unambiguously signals an empty
queue.
Signed-off-by: Jiajun Wu <b06378@freescale.com>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: Stable <stable@vger.kernel.org> [2.6.32]
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ucc_geth.c')
-rw-r--r-- | drivers/net/ucc_geth.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 96bdc0b43889..eb8fe7e16c6c 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
@@ -3279,13 +3279,12 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ) | |||
3279 | /* Handle the transmitted buffer and release */ | 3279 | /* Handle the transmitted buffer and release */ |
3280 | /* the BD to be used with the current frame */ | 3280 | /* the BD to be used with the current frame */ |
3281 | 3281 | ||
3282 | if (bd == ugeth->txBd[txQ]) /* queue empty? */ | 3282 | skb = ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]]; |
3283 | if (!skb) | ||
3283 | break; | 3284 | break; |
3284 | 3285 | ||
3285 | dev->stats.tx_packets++; | 3286 | dev->stats.tx_packets++; |
3286 | 3287 | ||
3287 | skb = ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]]; | ||
3288 | |||
3289 | if (skb_queue_len(&ugeth->rx_recycle) < RX_BD_RING_LEN && | 3288 | if (skb_queue_len(&ugeth->rx_recycle) < RX_BD_RING_LEN && |
3290 | skb_recycle_check(skb, | 3289 | skb_recycle_check(skb, |
3291 | ugeth->ug_info->uf_info.max_rx_buf_length + | 3290 | ugeth->ug_info->uf_info.max_rx_buf_length + |