linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] gianfar : Do right check on num_txbdfree
@ 2009-02-26  8:56 Rini van Zetten
  2009-02-26 10:03 ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Rini van Zetten @ 2009-02-26  8:56 UTC (permalink / raw)
  To: Linuxppc-dev, netdev, afleming

This patch fixes a wrong check on num_txbdfree. It could lead to num_txbdfree become nagative.
Result was that the gianfar stops sending data.


Signed-off-by: Rini van Zetten <rini at arvoo dot nl>
---
  drivers/net/gianfar.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 7ef1ffd..2dc3bd3 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -1284,9 +1284,8 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
  	spin_lock_irqsave(&priv->txlock, flags);

  	/* check if there is space to queue this packet */
-	if (nr_frags > priv->num_txbdfree) {
+	if ( (nr_frags+1) > priv->num_txbdfree) {
  		/* no space, stop the queue */
  		netif_stop_queue(dev);
  		dev->stats.tx_fifo_errors++;
  		spin_unlock_irqrestore(&priv->txlock, flags);
-- 

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-02-27 11:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-26  8:56 [PATCH net] gianfar : Do right check on num_txbdfree Rini van Zetten
2009-02-26 10:03 ` David Miller
2009-02-26 10:25   ` [PATCH v2 " Rini van Zetten
2009-02-26 16:03     ` Geert Uytterhoeven
2009-02-26 22:07     ` Andy Fleming
2009-02-27 11:18       ` David Miller

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).