From: Rini van Zetten <rini@arvoo.nl>
To: David Miller <davem@davemloft.net>
Cc: Linuxppc-dev@ozlabs.org, afleming@freescale.com, netdev@vger.kernel.org
Subject: [PATCH v2 net] gianfar : Do right check on num_txbdfree
Date: Thu, 26 Feb 2009 11:25:49 +0100 [thread overview]
Message-ID: <49A66E2D.3060204@arvoo.nl> (raw)
In-Reply-To: <20090226.020318.50178027.davem@davemloft.net>
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.
Changes from first version :
- removed a space between parens (David Millers comment)
- full email address in signed off line
Signed-off-by: Rini van Zetten <rini@arvoo.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);
--
next prev parent reply other threads:[~2009-02-26 10:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
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:03 ` David Miller
2009-02-26 10:25 ` Rini van Zetten [this message]
2009-02-26 16:03 ` [PATCH v2 " 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=49A66E2D.3060204@arvoo.nl \
--to=rini@arvoo.nl \
--cc=Linuxppc-dev@ozlabs.org \
--cc=afleming@freescale.com \
--cc=davem@davemloft.net \
--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.