* RE: [PATCH 1/3] ucc_geth: Fix empty TX queue processing
[not found] <0A1FE637C2C7E148B9573BB60CC630E56C3E90@zch01exm26.fsl.freescale.net>
@ 2010-01-11 3:47 ` Wu Jiajun-B06378
2010-01-11 10:52 ` Anton Vorontsov
0 siblings, 1 reply; 5+ messages in thread
From: Wu Jiajun-B06378 @ 2010-01-11 3:47 UTC (permalink / raw)
To: avorontsov; +Cc: linuxppc-dev, netdev, lsorense, davem
'bd == ugeth->txBd[txQ]' has two possible statuses: 1)full queue.
2)empty queue.
Removing 'netif_queue_stopped() == 0' will make transmitting stopping
when the queue is full.
I made a new patch for this oops.
>From 726765194352d01dc8ea672d97612589b67cec3f Mon Sep 17 00:00:00 2001
From: Jiajun Wu <b06378@freescale.com>
Date: Mon, 11 Jan 2010 10:57:22 +0800
Subject: [PATCH] ucc_geth: Fix empty TX queue processing
Signed-off-by: Jiajun Wu <b06378@freescale.com>
---
drivers/net/ucc_geth.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index f982220..34345f0 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3576,17 +3576,17 @@ static int ucc_geth_tx(struct net_device *dev,
u8 txQ)
while ((bd_status & T_R) == 0) {
struct sk_buff *skb;
+ skb = ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]];
+
/* BD contains already transmitted buffer. */
/* Handle the transmitted buffer and release */
/* the BD to be used with the current frame */
- if ((bd == ugeth->txBd[txQ]) &&
(netif_queue_stopped(dev) == 0))
+ if ((bd == ugeth->txBd[txQ]) && (skb == NULL))
break;
dev->stats.tx_packets++;
- skb = ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]];
-
if (skb_queue_len(&ugeth->rx_recycle) < RX_BD_RING_LEN
&&
skb_recycle_check(skb,
ugeth->ug_info->uf_info.max_rx_buf_length +
--
1.5.6.3
-----Original Message-----
From: linuxppc-dev-bounces+b13201=freescale.com@lists.ozlabs.org
[mailto:linuxppc-dev-bounces+b13201=freescale.com@lists.ozlabs.org] On
Behalf Of Anton Vorontsov
Sent: Thursday, December 24, 2009 11:31 PM
To: David Miller
Cc: linuxppc-dev@ozlabs.org; netdev@vger.kernel.org; Lennart Sorensen
Subject: [PATCH 1/3] ucc_geth: Fix empty TX queue processing
-----------
Following oops was seen with the ucc_geth driver:
Unable to handle kernel paging request for data at address 0x00000058
Faulting instruction address: 0xc024f2fc
Oops: Kernel access of bad area, sig: 11 [#1] [...] NIP [c024f2fc]
skb_recycle_check+0x14/0x100 LR [e30aa0a4] ucc_geth_poll+0xd8/0x4e0
[ucc_geth_driver] Call Trace:
[df857d50] [c000b03c] __ipipe_grab_irq+0x3c/0xa4 (unreliable)
[df857d60] [e30aa0a4] ucc_geth_poll+0xd8/0x4e0 [ucc_geth_driver]
[df857dd0] [c0258cf8] net_rx_action+0xf8/0x1b8 [df857e10] [c0032a38]
__do_softirq+0xb8/0x13c [df857e60] [c00065cc] do_softirq+0xa0/0xac
[...]
This is because ucc_geth_tx() tries to process an empty queue when
queues are logically stopped. Stopping the queues doesn't disable
polling, and since nowadays ucc_geth_tx() is actually called from the
polling routine, the oops above might pop up.
Fix this by removing 'netif_queue_stopped() == 0' check.
Reported-by: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Tested-by: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>
Cc: Stable <stable@vger.kernel.org> [2.6.32]
---
drivers/net/ucc_geth.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index
afaf088..0f8c99e 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3273,7 +3273,7 @@ static int ucc_geth_tx(struct net_device *dev, u8
txQ)
/* Handle the transmitted buffer and release */
/* the BD to be used with the current frame */
- if ((bd == ugeth->txBd[txQ]) &&
(netif_queue_stopped(dev) == 0))
+ if (bd == ugeth->txBd[txQ]) /* queue empty? */
break;
dev->stats.tx_packets++;
--
1.6.3.3
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 1/3] ucc_geth: Fix empty TX queue processing
2010-01-11 3:47 ` [PATCH 1/3] ucc_geth: Fix empty TX queue processing Wu Jiajun-B06378
@ 2010-01-11 10:52 ` Anton Vorontsov
2010-01-11 11:52 ` Wu Jiajun-B06378
0 siblings, 1 reply; 5+ messages in thread
From: Anton Vorontsov @ 2010-01-11 10:52 UTC (permalink / raw)
To: Wu Jiajun-B06378; +Cc: linuxppc-dev, netdev, lsorense, davem
On Mon, Jan 11, 2010 at 11:47:37AM +0800, Wu Jiajun-B06378 wrote:
>
> 'bd == ugeth->txBd[txQ]' has two possible statuses: 1)full queue.
> 2)empty queue.
> Removing 'netif_queue_stopped() == 0' will make transmitting stopping
> when the queue is full.
>
> I made a new patch for this oops.
[...]
> + if ((bd == ugeth->txBd[txQ]) && (skb == NULL))
> break;
Hm. I wonder why do we need the 'bd == ugeth->txBd[txQ]' check
at all? The null skb will cause a kernel oops anyway.
I think the patch below should be sufficient for the fix.
Can you try it? Or if you tell me how to reproduce the issue
you observe, I can try it myself.
Thanks a lot!
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 41ad2f3..a1a6d06 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3279,13 +3279,12 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
/* Handle the transmitted buffer and release */
/* the BD to be used with the current frame */
- if (bd == ugeth->txBd[txQ]) /* queue empty? */
+ skb = ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]];
+ if (!skb)
break;
dev->stats.tx_packets++;
- skb = ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]];
-
if (skb_queue_len(&ugeth->rx_recycle) < RX_BD_RING_LEN &&
skb_recycle_check(skb,
ugeth->ug_info->uf_info.max_rx_buf_length +
^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: [PATCH 1/3] ucc_geth: Fix empty TX queue processing
2010-01-11 10:52 ` Anton Vorontsov
@ 2010-01-11 11:52 ` Wu Jiajun-B06378
0 siblings, 0 replies; 5+ messages in thread
From: Wu Jiajun-B06378 @ 2010-01-11 11:52 UTC (permalink / raw)
To: avorontsov; +Cc: linuxppc-dev, netdev, lsorense, davem
Yes,'if (!skb)' is enough.
You can reproduce transmitting stopping if you use 'if ((bd == ugeth->txBd[txQ])' and run ipforwarding with MTU=64 1Gbps 100%linerate.
-----Original Message-----
From: Anton Vorontsov [mailto:avorontsov@ru.mvista.com]
Sent: 2010年1月11日 18:53
To: Wu Jiajun-B06378
Cc: linuxppc-dev@ozlabs.org; netdev@vger.kernel.org; lsorense@csclub.uwaterloo.ca; davem@davemloft.net
Subject: Re: [PATCH 1/3] ucc_geth: Fix empty TX queue processing
On Mon, Jan 11, 2010 at 11:47:37AM +0800, Wu Jiajun-B06378 wrote:
>
> 'bd == ugeth->txBd[txQ]' has two possible statuses: 1)full queue.
> 2)empty queue.
> Removing 'netif_queue_stopped() == 0' will make transmitting stopping
> when the queue is full.
>
> I made a new patch for this oops.
[...]
> + if ((bd == ugeth->txBd[txQ]) && (skb == NULL))
> break;
Hm. I wonder why do we need the 'bd == ugeth->txBd[txQ]' check at all? The null skb will cause a kernel oops anyway.
I think the patch below should be sufficient for the fix.
Can you try it? Or if you tell me how to reproduce the issue you observe, I can try it myself.
Thanks a lot!
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 41ad2f3..a1a6d06 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3279,13 +3279,12 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
/* Handle the transmitted buffer and release */
/* the BD to be used with the current frame */
- if (bd == ugeth->txBd[txQ]) /* queue empty? */
+ skb = ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]];
+ if (!skb)
break;
dev->stats.tx_packets++;
- skb = ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]];
-
if (skb_queue_len(&ugeth->rx_recycle) < RX_BD_RING_LEN &&
skb_recycle_check(skb,
ugeth->ug_info->uf_info.max_rx_buf_length +
^ permalink raw reply [flat|nested] 5+ messages in thread
* [stable] Please apply ucc_geth driver fixes to 2.6.32-stable
@ 2010-06-22 13:02 Petri Lehtinen
2010-06-22 13:02 ` [PATCH 1/3] ucc_geth: Fix empty TX queue processing Petri Lehtinen
0 siblings, 1 reply; 5+ messages in thread
From: Petri Lehtinen @ 2010-06-22 13:02 UTC (permalink / raw)
To: linux-kernel; +Cc: stable, netdev
(I already sent these patches a few weeks ago and got no reply. I also
sent them to some of the recipients a few minutes ago and failed to
use git-send-email properly. So sorry for the noise.)
Please include the following three patches to 2.6.32-stable. They fix
serious flaws in the ucc_geth ethernet driver, making it unusable (at
least on my system).
They have been included in 2.6.33 and apply cleanly on top of
2.6.32-stable.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] ucc_geth: Fix empty TX queue processing
2010-06-22 13:02 [stable] Please apply ucc_geth driver fixes to 2.6.32-stable Petri Lehtinen
@ 2010-06-22 13:02 ` Petri Lehtinen
0 siblings, 0 replies; 5+ messages in thread
From: Petri Lehtinen @ 2010-06-22 13:02 UTC (permalink / raw)
To: linux-kernel
Cc: stable, netdev, Anton Vorontsov, Stable, "[2.6.32]",
David S. Miller
From: Anton Vorontsov <avorontsov@ru.mvista.com>
Following oops was seen with the ucc_geth driver:
Unable to handle kernel paging request for data at address 0x00000058
Faulting instruction address: 0xc024f2fc
Oops: Kernel access of bad area, sig: 11 [#1]
[...]
NIP [c024f2fc] skb_recycle_check+0x14/0x100
LR [e30aa0a4] ucc_geth_poll+0xd8/0x4e0 [ucc_geth_driver]
Call Trace:
[df857d50] [c000b03c] __ipipe_grab_irq+0x3c/0xa4 (unreliable)
[df857d60] [e30aa0a4] ucc_geth_poll+0xd8/0x4e0 [ucc_geth_driver]
[df857dd0] [c0258cf8] net_rx_action+0xf8/0x1b8
[df857e10] [c0032a38] __do_softirq+0xb8/0x13c
[df857e60] [c00065cc] do_softirq+0xa0/0xac
[...]
This is because ucc_geth_tx() tries to process an empty queue when
queues are logically stopped. Stopping the queues doesn't disable
polling, and since nowadays ucc_geth_tx() is actually called from
the polling routine, the oops above might pop up.
Fix this by removing 'netif_queue_stopped() == 0' check.
Reported-by: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Tested-by: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>
Cc: Stable <stable@vger.kernel.org> [2.6.32]
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7583605b6d29f1f7f6fc505b883328089f3485ad)
---
drivers/net/ucc_geth.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 4469f24..20aa5b5 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3273,7 +3273,7 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
/* Handle the transmitted buffer and release */
/* the BD to be used with the current frame */
- if ((bd == ugeth->txBd[txQ]) && (netif_queue_stopped(dev) == 0))
+ if (bd == ugeth->txBd[txQ]) /* queue empty? */
break;
dev->stats.tx_packets++;
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 0/3] ucc_geth: Some more fixes
@ 2009-12-24 15:30 Anton Vorontsov
2009-12-24 15:31 ` [PATCH 1/3] ucc_geth: Fix empty TX queue processing Anton Vorontsov
0 siblings, 1 reply; 5+ messages in thread
From: Anton Vorontsov @ 2009-12-24 15:30 UTC (permalink / raw)
To: David Miller; +Cc: linuxppc-dev, netdev, Lennart Sorensen
Hi all,
Here are some more fixes and one small enhancement for the ucc_geth
driver.
Thanks,
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] ucc_geth: Fix empty TX queue processing
2009-12-24 15:30 [PATCH 0/3] ucc_geth: Some more fixes Anton Vorontsov
@ 2009-12-24 15:31 ` Anton Vorontsov
0 siblings, 0 replies; 5+ messages in thread
From: Anton Vorontsov @ 2009-12-24 15:31 UTC (permalink / raw)
To: David Miller; +Cc: Lennart Sorensen, Li Yang, netdev, linuxppc-dev
Following oops was seen with the ucc_geth driver:
Unable to handle kernel paging request for data at address 0x00000058
Faulting instruction address: 0xc024f2fc
Oops: Kernel access of bad area, sig: 11 [#1]
[...]
NIP [c024f2fc] skb_recycle_check+0x14/0x100
LR [e30aa0a4] ucc_geth_poll+0xd8/0x4e0 [ucc_geth_driver]
Call Trace:
[df857d50] [c000b03c] __ipipe_grab_irq+0x3c/0xa4 (unreliable)
[df857d60] [e30aa0a4] ucc_geth_poll+0xd8/0x4e0 [ucc_geth_driver]
[df857dd0] [c0258cf8] net_rx_action+0xf8/0x1b8
[df857e10] [c0032a38] __do_softirq+0xb8/0x13c
[df857e60] [c00065cc] do_softirq+0xa0/0xac
[...]
This is because ucc_geth_tx() tries to process an empty queue when
queues are logically stopped. Stopping the queues doesn't disable
polling, and since nowadays ucc_geth_tx() is actually called from
the polling routine, the oops above might pop up.
Fix this by removing 'netif_queue_stopped() == 0' check.
Reported-by: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Tested-by: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>
Cc: Stable <stable@vger.kernel.org> [2.6.32]
---
drivers/net/ucc_geth.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index afaf088..0f8c99e 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3273,7 +3273,7 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
/* Handle the transmitted buffer and release */
/* the BD to be used with the current frame */
- if ((bd == ugeth->txBd[txQ]) && (netif_queue_stopped(dev) == 0))
+ if (bd == ugeth->txBd[txQ]) /* queue empty? */
break;
dev->stats.tx_packets++;
--
1.6.3.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-06-22 13:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <0A1FE637C2C7E148B9573BB60CC630E56C3E90@zch01exm26.fsl.freescale.net>
2010-01-11 3:47 ` [PATCH 1/3] ucc_geth: Fix empty TX queue processing Wu Jiajun-B06378
2010-01-11 10:52 ` Anton Vorontsov
2010-01-11 11:52 ` Wu Jiajun-B06378
2010-06-22 13:02 [stable] Please apply ucc_geth driver fixes to 2.6.32-stable Petri Lehtinen
2010-06-22 13:02 ` [PATCH 1/3] ucc_geth: Fix empty TX queue processing Petri Lehtinen
-- strict thread matches above, loose matches on Subject: below --
2009-12-24 15:30 [PATCH 0/3] ucc_geth: Some more fixes Anton Vorontsov
2009-12-24 15:31 ` [PATCH 1/3] ucc_geth: Fix empty TX queue processing Anton Vorontsov
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).