Skip to contentSkip to conversation

gianfar : Do right check on num_txbdfree

PATCH Superseded Rini van Zetten 4 participants 6 messages Feb 26, 2009 – Feb 27, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gianfar : Do right check on num_txbdfree

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(-)
drivers/net/gianfar.c +1 -2
index 7ef1ffd..2dc3bd3 100644
@@ -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);
-- 
maintainer
#1 lore raw

From: Rini van Zetten <[email protected]>
Date: Thu, 26 Feb 2009 09:56:58 +0100

Quoted 5 lines

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

Please use [email protected] in your signoffs, you cannot hide on the inna-net.

drivers/net/gianfar.c static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) · line 1287

Quoted 2 lines
drivers/net/gianfar.c +1 -1
-	if (nr_frags > priv->num_txbdfree) {
+	if ( (nr_frags+1) > priv->num_txbdfree) {

Please don't put a space between the parens there "( (", like that.

#2 lore raw

PATCH v2 1/1 gianfar : Do right check on num_txbdfree

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

---
 drivers/net/gianfar.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/gianfar.c +1 -1
index 7ef1ffd..2dc3bd3 100644
@@ -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);
#3 lore raw
Quoted 3 lines · Rini van Zetten

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.

A quick mental note for your next patch submission:

Quoted 3 lines

Changes from first version :
- removed a space between parens (David Millers comment)
- full email address in signed off line

Changelogs since previous versions should be ...

Quoted 2 lines

---

... here, below the `---', as they're not supposed to be end up in the final commit message.

Quoted 2 lines
 drivers/net/gianfar.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   [email protected]
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V. VAT BE 0413.825.160 · RPR Brussels Fortis · BIC GEBABEBB · IBAN BE41293037680010

Acked-by on v2 1/1
#4 lore raw
In reply to Rini van Zetten
Quoted 10 lines · Rini van Zetten

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

Good catch. Does this solve the bug you reported earlier?

maintainer Applied
#5 lore raw

From: Andy Fleming <[email protected]>
Date: Thu, 26 Feb 2009 16:07:16 -0600

Quoted 10 lines · Rini van Zetten
Quoted 9 lines

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

Quoted 5 lines
Quoted 1 line

Good catch. Does this solve the bug you reported earlier?

Applied, thanks.