diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2009-11-29 15:45:58 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-01 16:15:50 -0800 |
commit | a5ee155136b4a8f4ab0e4c9c064b661da475e298 (patch) | |
tree | 10c113756ff0dcc860735d96ed141701bffa3476 /net/ipv4 | |
parent | 5a5b6f6f62ac684a5856121d8cffd3c3253dc890 (diff) | |
download | linux-3.10-a5ee155136b4a8f4ab0e4c9c064b661da475e298.tar.gz linux-3.10-a5ee155136b4a8f4ab0e4c9c064b661da475e298.tar.bz2 linux-3.10-a5ee155136b4a8f4ab0e4c9c064b661da475e298.zip |
net: NETDEV_UNREGISTER_PERNET -> NETDEV_UNREGISTER_BATCH
The motivation for an additional notifier in batched netdevice
notification (rt_do_flush) only needs to be called once per batch not
once per namespace.
For further batching improvements I need a guarantee that the
netdevices are unregistered in order allowing me to unregister an all
of the network devices in a network namespace at the same time with
the guarantee that the loopback device is really and truly
unregistered last.
Additionally it appears that we moved the route cache flush after
the final synchronize_net, which seems wrong and there was no
explanation. So I have restored the original location of the final
synchronize_net.
Cc: Octavian Purdila <opurdila@ixiacom.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/fib_frontend.c | 4 | ||||
-rw-r--r-- | net/ipv4/route.c | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 6c1e56aef1f..3b373a8b047 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -959,9 +959,11 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo break; case NETDEV_CHANGEMTU: case NETDEV_CHANGE: - case NETDEV_UNREGISTER_PERNET: rt_cache_flush(dev_net(dev), 0); break; + case NETDEV_UNREGISTER_BATCH: + rt_cache_flush_batch(); + break; } return NOTIFY_DONE; } diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 9889fbd9648..90cdcfc3293 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -900,6 +900,12 @@ void rt_cache_flush(struct net *net, int delay) rt_do_flush(!in_softirq()); } +/* Flush previous cache invalidated entries from the cache */ +void rt_cache_flush_batch(void) +{ + rt_do_flush(!in_softirq()); +} + /* * We change rt_genid and let gc do the cleanup */ |