All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rini van Zetten <rini@arvoo.nl>
To: Linuxppc-dev@ozlabs.org, netdev@vger.kernel.org, afleming@freescale.com
Subject: [PATCH net] gianfar : Do right check on num_txbdfree
Date: Thu, 26 Feb 2009 09:56:58 +0100	[thread overview]
Message-ID: <49A6595A.9000405@arvoo.nl> (raw)

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

             reply	other threads:[~2009-02-26  8:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-26  8:56 Rini van Zetten [this message]
2009-02-26 10:03 ` [PATCH net] gianfar : Do right check on num_txbdfree David Miller
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 16:03       ` Geert Uytterhoeven
2009-02-26 22:07     ` Andy Fleming
2009-02-26 22:07       ` Andy Fleming
2009-02-27 11:18       ` David Miller
2009-02-27 11:18         ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49A6595A.9000405@arvoo.nl \
    --to=rini@arvoo.nl \
    --cc=Linuxppc-dev@ozlabs.org \
    --cc=afleming@freescale.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.