ipv4: Flush per-ns routing cache more sanely.
Subsystems (3)
David Miller
maintainerPATCH 1/1 ipv4: Flush per-ns routing cache more sanely.
Flush the routing cache only of entries that match the network namespace in which the purge event occurred.
---
Could I get some testing and performance analysis feedback on this change? I don't want it to just die :-)
THanks!
include/net/route.h +1 -1
@@ -106,7 +106,7 @@ extern int ip_rt_init(void);extern void ip_rt_redirect (__be32 old_gw,__be32 dst,__be32 new_gw,__be32 src,struct net_device *dev);extern void rt_cache_flush (struct net *net,int how); -extern void rt_cache_flush_batch (void ); +extern void rt_cache_flush_batch (struct net *net);extern int __ip_route_output_key (struct net *,struct rtable **,const struct flowi *flp);extern int ip_route_output_key (struct net *,struct rtable **,struct flowi *flp);extern int ip_route_output_flow (struct net *,struct rtable **rp,struct flowi *flp,struct sock *sk,int flags);
net/ipv4/fib_frontend.c +1 -1
@@ -999,7 +999,7 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vort_cache_flush (dev_net (dev),0 );break ;case NETDEV_UNREGISTER_BATCH : -rt_cache_flush_batch (); +rt_cache_flush_batch (dev_net (dev));break ; }return NOTIFY_DONE ;
net/ipv4/route.c +21 -33
88 lines not on this page · raw message
Quoted 9 lines · David Miller
Flush the routing cache only of entries that match the network namespace in which the purge event occurred.
Signed-off-by David S. Miller <[email protected]>---
Could I get some testing and performance analysis feedback on this change? I don't want it to just die :-)
I believe its fine, thanks !
I'll respin my __rcu patch, of course.
Quoted 9 lines · David Miller
Flush the routing cache only of entries that match the network namespace in which the purge event occurred.
Signed-off-by David S. Miller<[email protected]>---
Could I get some testing and performance analysis feedback on this change? I don't want it to just die :-)
Ok, will do in a couple of days.
Thanks
-- Daniel
Quoted 29 lines · David Miller
Flush the routing cache only of entries that match the network namespace in which the purge event occurred.
Signed-off-by David S. Miller <[email protected]>---
Could I get some testing and performance analysis feedback on this change? I don't want it to just die :-)
THanks!
include/net/route.h +1
-1@@ -106,7 +106,7 @@ extern int ip_rt_init(void);extern void ip_rt_redirect (__be32 old_gw,__be32 dst,__be32 new_gw,__be32 src,struct net_device *dev);extern void rt_cache_flush (struct net *net,int how); -extern void rt_cache_flush_batch (void ); +extern void rt_cache_flush_batch (struct net *net);extern int __ip_route_output_key (struct net *,struct rtable **,const struct flowi *flp);extern int ip_route_output_key (struct net *,struct rtable **,struct flowi *flp);extern int ip_route_output_flow (struct net *,struct rtable **rp,struct flowi *flp,struct sock *sk,int flags);net/ipv4/fib_frontend.c +0
-0
net/ipv4/fib_frontend.c static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo · line 1002
Quoted 5 lines
net/ipv4/fib_frontend.c +1
-1@@ -999,7 +999,7 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vort_cache_flush (dev_net (dev),0 );break ;case NETDEV_UNREGISTER_BATCH : -rt_cache_flush_batch (); +rt_cache_flush_batch (dev_net (dev));
It still has this incorrect conversion in it.
Eric
David Miller
maintainerFrom: [email protected] (Eric W. Biederman)
Date: Tue, 26 Oct 2010 12:05:39 -0700
Quoted 8 lines
net/ipv4/fib_frontend.c static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo · line 1002
Quoted 6 lines
net/ipv4/fib_frontend.c +1
-1@@ -999,7 +999,7 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vort_cache_flush (dev_net (dev),0 );break ;case NETDEV_UNREGISTER_BATCH : -rt_cache_flush_batch (); +rt_cache_flush_batch (dev_net (dev));It still has this incorrect conversion in it.
Sorry I missed that, what's the exact problem with it?
Quoted 12 lines · David Miller
From: [email protected] (Eric W. Biederman)
Date: Tue, 26 Oct 2010 12:05:39 -0700Quoted 8 lines
net/ipv4/fib_frontend.c static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo · line 1002
Quoted 6 lines
net/ipv4/fib_frontend.c +1
-1@@ -999,7 +999,7 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vort_cache_flush (dev_net (dev),0 );break ;case NETDEV_UNREGISTER_BATCH : -rt_cache_flush_batch (); +rt_cache_flush_batch (dev_net (dev));It still has this incorrect conversion in it.
Quoted 1 line
Sorry I missed that, what's the exact problem with it?
Because the way _BATCH operation is performed, we call it once...
rollback_registered_many() calls it for the first dev queued in the list.
So it should be net independant.
Quoted 15 lines · Eric Dumazet
Quoted 13 lines · David Miller
From: [email protected] (Eric W. Biederman)
Date: Tue, 26 Oct 2010 12:05:39 -0700Quoted 9 lines
net/ipv4/fib_frontend.c static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo · line 1003
Quoted 7 lines
net/ipv4/fib_frontend.c +1
-1@@ -999,7 +999,7 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vort_cache_flush (dev_net (dev),0 );break ;case NETDEV_UNREGISTER_BATCH : -rt_cache_flush_batch (); +rt_cache_flush_batch (dev_net (dev));It still has this incorrect conversion in it.
Quoted 9 lines
Quoted 2 lines
Sorry I missed that, what's the exact problem with it?
Because the way
_BATCHoperation is performed, we call it once...
rollback_registered_many()calls it for the first dev queued in the list.So it should be net independant.
Dave,
do you plan to send another version of this patch ? Or can I test it as it is ? Without removing a network device, I can check the routine, no ?
Thanks
-- Daniel
David Miller
maintainerFrom: Daniel Lezcano <[email protected]>
Date: Fri, 29 Oct 2010 23:41:40 +0200
Quoted 3 lines
do you plan to send another version of this patch ? Or can I test it as it is ? Without removing a network device, I can check the routine, no ?
I'm backlogged with the current merge window work and fixing bugs, so feel free to test what I posted if you have the time.
I'll post an updated version when time permits.
Thanks.
David Miller
maintainerFrom: Eric Dumazet <[email protected]>
Date: Tue, 26 Oct 2010 21:30:22 +0200
Quoted 13 lines · David Miller
Quoted 12 lines
From: [email protected] (Eric W. Biederman)
Date: Tue, 26 Oct 2010 12:05:39 -0700Quoted 8 lines
Review static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo · line 1002
Quoted 6 lines
(quoted diff) +1
-1@@ -999,7 +999,7 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo rt_cache_flush(dev_net(dev), 0); break; case NETDEV_UNREGISTER_BATCH: - rt_cache_flush_batch(); + rt_cache_flush_batch(dev_net(dev));It still has this incorrect conversion in it.
Quoted 8 lines
Quoted 1 line
Sorry I missed that, what's the exact problem with it?
Because the way
_BATCHoperation is performed, we call it once...
rollback_registered_many()calls it for the first dev queued in the list.So it should be net independant.
Thanks Eric. I finally got back to fixing this issue and respinning the patch.
Please review, in particular how I handled the RCU bits.
--------------------
ipv4: Flush per-ns routing cache more sanely.
Flush the routing cache only of entries that match the network namespace in which the purge event occurred.
--- include/net/route.h | 2 +- net/ipv4/fib_frontend.c | 6 +++- net/ipv4/route.c | 68 ++++++++++++++++++----------------------------- 3 files changed, 32 insertions(+), 44 deletions(-)
include/net/route.h +1 -1
@@ -114,7 +114,7 @@ extern int ip_rt_init(void);extern void ip_rt_redirect (__be32 old_gw,__be32 dst,__be32 new_gw,__be32 src,struct net_device *dev);extern void rt_cache_flush (struct net *net,int how); -extern void rt_cache_flush_batch (void ); +extern void rt_cache_flush_batch (struct net *net);extern int __ip_route_output_key (struct net *,struct rtable **,const struct flowi *flp);extern int ip_route_output_key (struct net *,struct rtable **,struct flowi *flp);extern int ip_route_output_flow (struct net *,struct rtable **rp,struct flowi *flp,struct sock *sk,int flags);
net/ipv4/fib_frontend.c +5 -1
@@ -987,7 +987,11 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vort_cache_flush (dev_net (dev),0 );break ;case NETDEV_UNREGISTER_BATCH : -rt_cache_flush_batch (); +/* The batch unregister is only called on the first +* device in the list of devices being unregistered. +* Therefore we should not pass dev_net(dev) in here. +*/ +rt_cache_flush_batch (NULL );break ; }return NOTIFY_DONE ;
net/ipv4/route.c +26 -42
104 lines not on this page · raw message
Signature · 1 line
1.7.3.4
Eric Dumazet
Acked-byQuoted 30 lines · David Miller
From: Eric Dumazet <[email protected]>
Date: Tue, 26 Oct 2010 21:30:22 +0200Quoted 13 lines · David Miller
Quoted 12 lines
From: [email protected] (Eric W. Biederman)
Date: Tue, 26 Oct 2010 12:05:39 -0700Quoted 8 lines
net/ipv4/fib_frontend.c static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo · line 1002
Quoted 6 lines
net/ipv4/fib_frontend.c +1
-1@@ -999,7 +999,7 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vort_cache_flush (dev_net (dev),0 );break ;case NETDEV_UNREGISTER_BATCH : -rt_cache_flush_batch (); +rt_cache_flush_batch (dev_net (dev));It still has this incorrect conversion in it.
Quoted 8 lines
Quoted 1 line
Sorry I missed that, what's the exact problem with it?
Because the way
_BATCHoperation is performed, we call it once...
rollback_registered_many()calls it for the first dev queued in the list.So it should be net independant.
Thanks Eric. I finally got back to fixing this issue and respinning the patch.
Please review, in particular how I handled the RCU bits.
Quoted 7 lines
--------------------
ipv4: Flush per-ns routing cache more sanely.Flush the routing cache only of entries that match the network namespace in which the purge event occurred.
Signed-off-by David S. Miller <[email protected]>
Seems fine to me, thanks !
David Miller
maintainerFrom: Eric Dumazet <[email protected]>
Date: Mon, 20 Dec 2010 18:13:53 +0100
Quoted 6 lines · David Miller
Quoted 5 lines
ipv4: Flush per-ns routing cache more sanely.
Flush the routing cache only of entries that match the network namespace in which the purge event occurred.
Quoted 6 lines
Quoted 1 line
Signed-off-by David S. Miller <[email protected]>Seems fine to me, thanks !
Acked-by Eric Dumazet <[email protected]>
Thanks for reviewing.