diff options
author | Eric Dumazet <edumazet@google.com> | 2012-08-22 13:19:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-23 00:50:36 -0400 |
commit | 0115e8e30d6fcdd4b8faa30d3ffd90859a591f51 (patch) | |
tree | 725026e2192e57b98366947ab53c73689ca040a8 /include/linux/netdevice.h | |
parent | bf277b0ccea7d2422b85e232017ce3fddbe9c49c (diff) |
net: remove delay at device dismantle
I noticed extra one second delay in device dismantle, tracked down to
a call to dst_dev_event() while some call_rcu() are still in RCU queues.
These call_rcu() were posted by rt_free(struct rtable *rt) calls.
We then wait a little (but one second) in netdev_wait_allrefs() before
kicking again NETDEV_UNREGISTER.
As the call_rcu() are now completed, dst_dev_event() can do the needed
device swap on busy dst.
To solve this problem, add a new NETDEV_UNREGISTER_FINAL, called
after a rcu_barrier(), but outside of RTNL lock.
Use NETDEV_UNREGISTER_FINAL with care !
Change dst_dev_event() handler to react to NETDEV_UNREGISTER_FINAL
Also remove NETDEV_UNREGISTER_BATCH, as its not used anymore after
IP cache removal.
With help from Gao feng
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tom Herbert <therbert@google.com>
Cc: Mahesh Bandewar <maheshb@google.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Gao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 4936f09a9333..9ad7fa8c10e0 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1553,7 +1553,7 @@ struct packet_type { | |||
1553 | #define NETDEV_PRE_TYPE_CHANGE 0x000E | 1553 | #define NETDEV_PRE_TYPE_CHANGE 0x000E |
1554 | #define NETDEV_POST_TYPE_CHANGE 0x000F | 1554 | #define NETDEV_POST_TYPE_CHANGE 0x000F |
1555 | #define NETDEV_POST_INIT 0x0010 | 1555 | #define NETDEV_POST_INIT 0x0010 |
1556 | #define NETDEV_UNREGISTER_BATCH 0x0011 | 1556 | #define NETDEV_UNREGISTER_FINAL 0x0011 |
1557 | #define NETDEV_RELEASE 0x0012 | 1557 | #define NETDEV_RELEASE 0x0012 |
1558 | #define NETDEV_NOTIFY_PEERS 0x0013 | 1558 | #define NETDEV_NOTIFY_PEERS 0x0013 |
1559 | #define NETDEV_JOIN 0x0014 | 1559 | #define NETDEV_JOIN 0x0014 |