netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: fib: Decrease one unnecessary rt cache flush in fib_disable_ip
@ 2017-04-26 11:04 gfree.wind
  2017-04-27 20:33 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: gfree.wind @ 2017-04-26 11:04 UTC (permalink / raw)
  To: davem, netdev; +Cc: Gao Feng

From: Gao Feng <fgao@ikuai8.com>

The func fib_flush already flushes the rt cache if necessary, so it
is not necessary to invoke rt_cache_flush again in fib_disable_ip.

Signed-off-by: Gao Feng <fgao@ikuai8.com>
---
 net/ipv4/fib_frontend.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 5a0e456..39bd1ed 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -1130,7 +1130,8 @@ static void fib_disable_ip(struct net_device *dev, unsigned long event,
 {
 	if (fib_sync_down_dev(dev, event, force))
 		fib_flush(dev_net(dev));
-	rt_cache_flush(dev_net(dev));
+	else
+		rt_cache_flush(dev_net(dev));
 	arp_ifdown(dev);
 }
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: fib: Decrease one unnecessary rt cache flush in fib_disable_ip
  2017-04-26 11:04 [PATCH] net: fib: Decrease one unnecessary rt cache flush in fib_disable_ip gfree.wind
@ 2017-04-27 20:33 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-04-27 20:33 UTC (permalink / raw)
  To: gfree.wind; +Cc: netdev, fgao

From: gfree.wind@foxmail.com
Date: Wed, 26 Apr 2017 19:04:04 +0800

> From: Gao Feng <fgao@ikuai8.com>
> 
> The func fib_flush already flushes the rt cache if necessary, so it
> is not necessary to invoke rt_cache_flush again in fib_disable_ip.
> 
> Signed-off-by: Gao Feng <fgao@ikuai8.com>

Looks good, applied to net-next, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-27 20:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-26 11:04 [PATCH] net: fib: Decrease one unnecessary rt cache flush in fib_disable_ip gfree.wind
2017-04-27 20:33 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).