diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2005-05-12 04:09:45 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-05-15 18:08:06 -0400 |
commit | b2e0852e1eee7c445b1789bef41204b64f981102 (patch) | |
tree | a1c0465f681b7aae24d0ade106f68593e74a8346 | |
parent | 41664c03f6c96a1f8a91714309b36f1b5ca85610 (diff) |
[PATCH] iseries_veth: Cleanup skbs to prevent unregister_netdevice() hanging
Hi Andrew, Jeff,
The iseries_veth driver is badly behaved in that it will keep TX packets
hanging around forever if they're not ACK'ed and the queue never fills up.
This causes the unregister_netdevice code to wait forever when we try to take
the device down, because there's still skbs around with references to our
struct net_device.
There's already code to cleanup any un-ACK'ed packets in veth_stop_connection()
but it's being called after we unregister the net_device, which is too late.
The fix is to rearrange the module exit function so that we cleanup any
outstanding skbs and then unregister the driver.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
-rw-r--r-- | drivers/net/iseries_veth.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c index 1edecb10993d..13ed8dc1e91d 100644 --- a/drivers/net/iseries_veth.c +++ b/drivers/net/iseries_veth.c | |||
@@ -1388,18 +1388,25 @@ void __exit veth_module_cleanup(void) | |||
1388 | { | 1388 | { |
1389 | int i; | 1389 | int i; |
1390 | 1390 | ||
1391 | vio_unregister_driver(&veth_driver); | 1391 | /* Stop the queues first to stop any new packets being sent. */ |
1392 | for (i = 0; i < HVMAXARCHITECTEDVIRTUALLANS; i++) | ||
1393 | if (veth_dev[i]) | ||
1394 | netif_stop_queue(veth_dev[i]); | ||
1392 | 1395 | ||
1396 | /* Stop the connections before we unregister the driver. This | ||
1397 | * ensures there's no skbs lying around holding the device open. */ | ||
1393 | for (i = 0; i < HVMAXARCHITECTEDLPS; ++i) | 1398 | for (i = 0; i < HVMAXARCHITECTEDLPS; ++i) |
1394 | veth_stop_connection(i); | 1399 | veth_stop_connection(i); |
1395 | 1400 | ||
1396 | HvLpEvent_unregisterHandler(HvLpEvent_Type_VirtualLan); | 1401 | HvLpEvent_unregisterHandler(HvLpEvent_Type_VirtualLan); |
1397 | 1402 | ||
1398 | /* Hypervisor callbacks may have scheduled more work while we | 1403 | /* Hypervisor callbacks may have scheduled more work while we |
1399 | * were destroying connections. Now that we've disconnected from | 1404 | * were stoping connections. Now that we've disconnected from |
1400 | * the hypervisor make sure everything's finished. */ | 1405 | * the hypervisor make sure everything's finished. */ |
1401 | flush_scheduled_work(); | 1406 | flush_scheduled_work(); |
1402 | 1407 | ||
1408 | vio_unregister_driver(&veth_driver); | ||
1409 | |||
1403 | for (i = 0; i < HVMAXARCHITECTEDLPS; ++i) | 1410 | for (i = 0; i < HVMAXARCHITECTEDLPS; ++i) |
1404 | veth_destroy_connection(i); | 1411 | veth_destroy_connection(i); |
1405 | 1412 | ||