netdev tx timeouts
Subsystems (3)
Michael,
I still have not gotten a network guru to answer any questions about synchronize_net, but I have been testing the patch below:
drivers/net/wireless/bcm43xx/bcm43xx_main.c +1 -1
@@ -3169,8 +3169,8 @@ static void bcm43xx_periodic_work_handle* be preemtible. */ mutex_lock (&bcm->mutex); -netif_stop_queue (bcm->net_dev);synchronize_net (); +netif_stop_queue (bcm->net_dev);spin_lock_irqsave (&bcm->irq_lock, flags);bcm43xx_mac_suspend (bcm);if (bcm43xx_using_pio (bcm))
With the synchronize_net call before the netif_stop_queue as shown, my device has run since last Saturday with no netdev watchdog tx timeouts. Roughly two days of that testing was done at the accelerated rate of 60X normal.
I still hope to get access to a guru, but if that doesn't happen soon, I'm going to push this change so that it gets into 2.6.19.
Larry
Quoted 4 lines · Larry Finger
Michael,
I still have not gotten a network guru to answer any questions about
synchronize_net, but I have been testing the patch below:
I'd say this is racy.
Did you test this on SMP?
drivers/net/wireless/bcm43xx/bcm43xx_main.c static void bcm43xx_periodic_work_handle · line 3172
Quoted 10 lines
Index:
wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===================================================================drivers/net/wireless/bcm43xx/bcm43xx_main.c +0
-1@@ -3169,8 +3169,8 @@ static void bcm43xx_periodic_work_handle* be preemtible. */ mutex_lock (&bcm->mutex); -netif_stop_queue (bcm->net_dev);synchronize_net ();
A TX handler starts on another CPU.
drivers/net/wireless/bcm43xx/bcm43xx_main.c static void bcm43xx_periodic_work_handle · line 3173
Quoted 1 line
drivers/net/wireless/bcm43xx/bcm43xx_main.c +1
-0+netif_stop_queue (bcm->net_dev);
It's still running... boom.
Quoted 14 lines
drivers/net/wireless/bcm43xx/bcm43xx_main.c +0
-0spin_lock_irqsave (&bcm->irq_lock, flags);bcm43xx_mac_suspend (bcm);if (bcm43xx_using_pio (bcm))With the
synchronize_netcall before thenetif_stop_queueas shown, my device has run since last Saturday with no netdev watchdog tx timeouts. Roughly two days of that testing was done at the accelerated rate of 60X normal.I still hope to get access to a guru, but if that doesn't happen soon, I'm going to push this change so that it gets into 2.6.19.
Larry
Signature · 1 line
Greetings Michael.
Quoted 8 lines · Michael Buesch
Quoted 4 lines · Larry Finger
Michael,
I still have not gotten a network guru to answer any questions about
synchronize_net, but I have been testing the patch below:I'd say this is racy.
Did you test this on SMP?
No - I don't have the hardware.
Quoted 14 lines
drivers/net/wireless/bcm43xx/bcm43xx_main.c static void bcm43xx_periodic_work_handle · line 3172
Quoted 11 lines
Index:
wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===================================================================drivers/net/wireless/bcm43xx/bcm43xx_main.c +0
-1@@ -3169,8 +3169,8 @@ static void bcm43xx_periodic_work_handle* be preemtible. */ mutex_lock (&bcm->mutex); -netif_stop_queue (bcm->net_dev);synchronize_net ();A TX handler starts on another CPU.
Quoted 4 lines
drivers/net/wireless/bcm43xx/bcm43xx_main.c static void bcm43xx_periodic_work_handle · line 3173
Quoted 1 line
drivers/net/wireless/bcm43xx/bcm43xx_main.c +1
-0+netif_stop_queue (bcm->net_dev);It's still running... boom.
I see your point, but the current way breaks a UP system! What to do?
Larry
Quoted 25 lines · Larry Finger
Quoted 8 lines · Michael Buesch
Quoted 4 lines · Larry Finger
Michael,
I still have not gotten a network guru to answer any questions about
synchronize_net, but I have been testing the patch below:I'd say this is racy.
Did you test this on SMP?No - I don't have the hardware.
Quoted 14 lines
drivers/net/wireless/bcm43xx/bcm43xx_main.c static void bcm43xx_periodic_work_handle · line 3172
Quoted 11 lines
Index:
wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===================================================================drivers/net/wireless/bcm43xx/bcm43xx_main.c +0
-1@@ -3169,8 +3169,8 @@ static void bcm43xx_periodic_work_handle* be preemtible. */ mutex_lock (&bcm->mutex); -netif_stop_queue (bcm->net_dev);synchronize_net ();A TX handler starts on another CPU.
Quoted 6 lines
Quoted 4 lines
drivers/net/wireless/bcm43xx/bcm43xx_main.c static void bcm43xx_periodic_work_handle · line 3173
Quoted 1 line
drivers/net/wireless/bcm43xx/bcm43xx_main.c +1
-0+netif_stop_queue (bcm->net_dev);It's still running... boom.
I see your point, but the current way breaks a UP system! What to do?
Simple. Reading the code of synchronize_net() and netif_stop_queue() and thinking about why it breaks, instead of committing bugfixes that only substitute one bug by another. ;) I'll take a look, too.
Signature · 1 line
Greetings Michael.
Quoted 31 lines · Michael Buesch
Quoted 30 lines · Larry Finger
Quoted 8 lines · Michael Buesch
Quoted 4 lines · Larry Finger
Michael,
I still have not gotten a network guru to answer any questions about
synchronize_net, but I have been testing the patch below:I'd say this is racy.
Did you test this on SMP?No - I don't have the hardware.
Quoted 18 lines
drivers/net/wireless/bcm43xx/bcm43xx_main.c static void bcm43xx_periodic_work_handle · line 3172
Quoted 11 lines
Index:
wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===================================================================drivers/net/wireless/bcm43xx/bcm43xx_main.c +0
-1@@ -3169,8 +3169,8 @@ static void bcm43xx_periodic_work_handle* be preemtible. */ mutex_lock (&bcm->mutex); -netif_stop_queue (bcm->net_dev);synchronize_net ();A TX handler starts on another CPU.
drivers/net/wireless/bcm43xx/bcm43xx_main.c static void bcm43xx_periodic_work_handle · line 3173
Quoted 1 line
drivers/net/wireless/bcm43xx/bcm43xx_main.c +1
-0+netif_stop_queue (bcm->net_dev);It's still running... boom.
Quoted 6 lines
Quoted 1 line
I see your point, but the current way breaks a UP system! What to do?
Simple. Reading the code of
synchronize_net()andnetif_stop_queue()and thinking about why it breaks, instead of committing bugfixes that only substitute one bug by another. ;) I'll take a look, too.
Ok, I am pretty sure now we need the following patch to fix this. Can you test?
If it does not crash anymore, please push upstream.
drivers/net/wireless/bcm43xx/bcm43xx_main.c +1 -2
@@ -3169,8 +3169,7 @@ static void bcm43xx_periodic_work_handle* be preemtible. */ mutex_lock (&bcm->mutex); -netif_stop_queue (bcm->net_dev); -synchronize_net (); +netif_tx_disable (bcm->net_dev);spin_lock_irqsave (&bcm->irq_lock, flags);bcm43xx_mac_suspend (bcm);if (bcm43xx_using_pio (bcm))
Signature · 1 line
Greetings Michael.
Quoted 31 lines · On Wed, 13 Sep 2006 15:49:23 +0200 Michael Buesch <[email protected]> wrote:
Quoted 30 lines · Larry Finger
Quoted 8 lines · Michael Buesch
Quoted 4 lines · Larry Finger
Michael,
I still have not gotten a network guru to answer any questions about
synchronize_net, but I have been testing the patch below:I'd say this is racy.
Did you test this on SMP?No - I don't have the hardware.
Quoted 18 lines
drivers/net/wireless/bcm43xx/bcm43xx_main.c static void bcm43xx_periodic_work_handle · line 3172
Quoted 11 lines
Index:
wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===================================================================drivers/net/wireless/bcm43xx/bcm43xx_main.c +0
-1@@ -3169,8 +3169,8 @@ static void bcm43xx_periodic_work_handle* be preemtible. */ mutex_lock (&bcm->mutex); -netif_stop_queue (bcm->net_dev);synchronize_net ();A TX handler starts on another CPU.
drivers/net/wireless/bcm43xx/bcm43xx_main.c static void bcm43xx_periodic_work_handle · line 3173
Quoted 1 line
drivers/net/wireless/bcm43xx/bcm43xx_main.c +1
-0+netif_stop_queue (bcm->net_dev);It's still running... boom.
Quoted 6 lines
Quoted 1 line
I see your point, but the current way breaks a UP system! What to do?
Simple. Reading the code of
synchronize_net()andnetif_stop_queue()and thinking about why it breaks, instead of committing bugfixes that only substitute one bug by another. ;) I'll take a look, too.
Why are you doing the synchronize_net()? it is meant for RCU.
Quoted 8 lines · Stephen Hemminger
Quoted 4 lines · On Wed, 13 Sep 2006 15:49:23 +0200 Michael Buesch…
Simple. Reading the code of
synchronize_net()andnetif_stop_queue()and thinking about why it breaks, instead of committing bugfixes that only substitute one bug by another. ;) I'll take a look, too.Why are you doing the
synchronize_net()? it is meant for RCU.
We know and it no longer is in the code. We have known for a couple of days that it was the synchronize_net() step that led to the netdev timeouts, but we were afraid that a bare netif_stop_queue would not be SMP safe. The current structure has
mutex_lock
netif_tx_disable(dev) (equivalent to netif_tx_lock_bh(dev); netif_stop_queue(dev); netif_tx_unlock_bh(dev);
spin_lock_irqsafe
I see you listed as a maintainer in several network-related parts of the system, so AFAIK, you are a network guru. Do you think this will work? I have tested code with just a netif_stop_queue (without the lock_bh/unlock_bh parts) on a UP system and have gotten no errors, but I do not have access to SMP hardware.
Thanks,
Larry
Quoted 18 lines · On Wed, 13 Sep 2006 21:04:02 -0500 Larry Finger <[email protected]>…
Quoted 8 lines · Stephen Hemminger
Quoted 4 lines · On Wed, 13 Sep 2006 15:49:23 +0200 Michael Buesch <[email protected]> wrote:
Simple. Reading the code of
synchronize_net()andnetif_stop_queue()and thinking about why it breaks, instead of committing bugfixes that only substitute one bug by another. ;) I'll take a look, too.Why are you doing the
synchronize_net()? it is meant for RCU.We know and it no longer is in the code. We have known for a couple of days that it was the
synchronize_net()step that led to the netdev timeouts, but we were afraid that a barenetif_stop_queuewould not be SMP safe. The current structure has
mutex_locknetif_tx_disable(dev) (equivalent to netif_tx_lock_bh(dev); netif_stop_queue(dev); netif_tx_unlock_bh(dev);
Quoted 9 lines
spin_lock_irqsafeI see you listed as a maintainer in several network-related parts of the system, so AFAIK, you are a network guru. Do you think this will work? I have tested code with just a
netif_stop_queue(without the lock_bh/unlock_bh parts) on a UP system and have gotten no errors, but I do not have access to SMP hardware.Thanks,
I haven't done a careful review of the broadcom driver. What you are proposing looks fine. But most network devices just use spin_lock's rather than mutexs because there is little need for holding the lock for a long length of time.
Quoted 1 line
Quoted 21 lines · Stephen Hemminger
Quoted 18 lines · On Wed, 13 Sep 2006 21:04:02 -0500 Larry Finger <[email protected]>…
Quoted 7 lines · Stephen Hemminger
Quoted 4 lines · On Wed, 13 Sep 2006 15:49:23 +0200 Michael Buesch <[email protected]> wrote:
Simple. Reading the code of
synchronize_net()andnetif_stop_queue()and thinking about why it breaks, instead of committing bugfixes that only substitute one bug by another. ;) I'll take a look, too.Why are you doing the
synchronize_net()? it is meant for RCU.We know and it no longer is in the code. We have known for a couple of days that it was the
synchronize_net()step that led to the netdev timeouts, but we were afraid that a barenetif_stop_queuewould not be SMP safe. The current structure has
mutex_locknetif_tx_disable(dev) (equivalent to netif_tx_lock_bh(dev); netif_stop_queue(dev); netif_tx_unlock_bh(dev);
spin_lock_irqsafeI see you listed as a maintainer in several network-related parts of the system, so AFAIK, you are a network guru. Do you think this will work? I have tested code with just a
netif_stop_queue(without the lock_bh/unlock_bh parts) on a UP system and have gotten no errors, but I do not have access to SMP hardware.
Quoted 7 lines
Quoted 2 lines
Thanks,
I haven't done a careful review of the broadcom driver. What you are proposing looks fine. But most network devices just use spin_lock's rather than mutexs because there is little need for holding the lock for a long length of time.
I didn't code this section, but I know that the processing that we are about to do after the mutex can be quite lengthy - perhaps as long as 200 ms. Prior to 2.6.18, it was protected with a spin_lock; however, there were complaints about the effect on latency, so the mutex approach was taken to allow this long section to be preemptible. At appropriate points in the processing, the program calls cond_resched() if the kernel has preemption configured. This change resulted in the timeouts of the subject, which we are now trying to fix.
Larry