* [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
* Re: [PATCH net] gianfar : Do right check on num_txbdfree
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
0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2009-02-26 10:03 UTC (permalink / raw)
To: rini; +Cc: Linuxppc-dev, afleming, netdev
From: Rini van Zetten <rini@arvoo.nl>
Date: Thu, 26 Feb 2009 09:56:58 +0100
> 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 rini@arvoo.nl in your signoffs, you cannot
hide on the inna-net.
> - 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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 net] gianfar : Do right check on num_txbdfree
2009-02-26 10:03 ` David Miller
@ 2009-02-26 10:25 ` Rini van Zetten
2009-02-26 16:03 ` Geert Uytterhoeven
2009-02-26 22:07 ` Andy Fleming
0 siblings, 2 replies; 6+ messages in thread
From: Rini van Zetten @ 2009-02-26 10:25 UTC (permalink / raw)
To: David Miller; +Cc: Linuxppc-dev, afleming, netdev
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);
--
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 net] gianfar : Do right check on num_txbdfree
2009-02-26 10:25 ` [PATCH v2 " Rini van Zetten
@ 2009-02-26 16:03 ` Geert Uytterhoeven
2009-02-26 22:07 ` Andy Fleming
1 sibling, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2009-02-26 16:03 UTC (permalink / raw)
To: Rini van Zetten; +Cc: Linuxppc-dev, afleming, David Miller, netdev
On Thu, 26 Feb 2009, Rini van Zetten wrote:
> 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:
> 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 ...
> Signed-off-by: Rini van Zetten <rini@arvoo.nl>
> ---
... here, below the `---', as they're not supposed to be end up in the final
commit message.
> 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: Geert.Uytterhoeven@sonycom.com
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 net] gianfar : Do right check on num_txbdfree
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
1 sibling, 1 reply; 6+ messages in thread
From: Andy Fleming @ 2009-02-26 22:07 UTC (permalink / raw)
To: Rini van Zetten; +Cc: Linuxppc-dev, afleming, David Miller, netdev
On Thu, Feb 26, 2009 at 4:25 AM, Rini van Zetten <rini@arvoo.nl> wrote:
> 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>
Good catch. Does this solve the bug you reported earlier?
Acked-by: Andy Fleming <afleming@freescale.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 net] gianfar : Do right check on num_txbdfree
2009-02-26 22:07 ` Andy Fleming
@ 2009-02-27 11:18 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2009-02-27 11:18 UTC (permalink / raw)
To: afleming; +Cc: Linuxppc-dev, rini, afleming, netdev
From: Andy Fleming <afleming@gmail.com>
Date: Thu, 26 Feb 2009 16:07:16 -0600
> On Thu, Feb 26, 2009 at 4:25 AM, Rini van Zetten <rini@arvoo.nl> wrote:
> > 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>
>
> Good catch. Does this solve the bug you reported earlier?
>
> Acked-by: Andy Fleming <afleming@freescale.com>
Applied, thanks.
^ permalink raw reply [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).