Skip to content

Commit

Permalink
ucc_geth: Fix full TX queue processing
Browse files Browse the repository at this point in the history
commit 7583605 ("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>
  • Loading branch information
Jiajun Wu authored and David S. Miller committed Jan 19, 2010
1 parent 4f9c85a commit 3469242
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/net/ucc_geth.c
Original file line number Diff line number Diff line change
Expand Up @@ -3279,13 +3279,12 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
/* Handle the transmitted buffer and release */
/* the BD to be used with the current frame */

if (bd == ugeth->txBd[txQ]) /* queue empty? */
skb = ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]];
if (!skb)
break;

dev->stats.tx_packets++;

skb = ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]];

if (skb_queue_len(&ugeth->rx_recycle) < RX_BD_RING_LEN &&
skb_recycle_check(skb,
ugeth->ug_info->uf_info.max_rx_buf_length +
Expand Down

0 comments on commit 3469242

Please sign in to comment.