[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240208111646.535705-5-edumazet@google.com>
Date: Thu,  8 Feb 2024 11:16:46 +0000
From: Eric Dumazet <edumazet@...gle.com>
To: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, 
	Paolo Abeni <pabeni@...hat.com>
Cc: David Ahern <dsahern@...nel.org>, netdev@...r.kernel.org, eric.dumazet@...il.com, 
	Eric Dumazet <edumazet@...gle.com>
Subject: [PATCH net-next 4/4] ipv4: fib: use exit_batch_rtnl method
Using exit_batch_rtnl method instead of exit_batch avoids
one rtnl_lock()/rtnl_unlock() pair in netns dismantle.
Signed-off-by: Eric Dumazet <edumazet@...gle.com>
---
 net/ipv4/fib_frontend.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 390f4be7f7bec20f33aa80e9bf12d5e2f3760562..b5f52639aeda382ac959d3207a18d0d088bcb297 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -1631,21 +1631,19 @@ static void __net_exit fib_net_exit(struct net *net)
 	nl_fib_lookup_exit(net);
 }
 
-static void __net_exit fib_net_exit_batch(struct list_head *net_list)
+static void __net_exit fib_net_exit_batch_rtnl(struct list_head *net_list,
+					       struct list_head *dev_to_kill)
 {
 	struct net *net;
 
-	rtnl_lock();
 	list_for_each_entry(net, net_list, exit_list)
 		ip_fib_net_exit(net);
-
-	rtnl_unlock();
 }
 
 static struct pernet_operations fib_net_ops = {
 	.init = fib_net_init,
 	.exit = fib_net_exit,
-	.exit_batch = fib_net_exit_batch,
+	.exit_batch_rtnl = fib_net_exit_batch_rtnl,
 };
 
 void __init ip_fib_init(void)
-- 
2.43.0.594.gd9cf4e227d-goog
Powered by blists - more mailing lists
 
