[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240208111646.535705-4-edumazet@google.com>
Date: Thu, 8 Feb 2024 11:16:45 +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 3/4] ipmr: 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/ipmr.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 3622298365105d99c0277f1c1616fb5fc63cdc2d..708c79c465e7212d24d2eb74165b227b9bde1c5f 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -3119,20 +3119,19 @@ static void __net_exit ipmr_net_exit(struct net *net)
ipmr_notifier_exit(net);
}
-static void __net_exit ipmr_net_exit_batch(struct list_head *net_list)
+static void __net_exit ipmr_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)
ipmr_rules_exit(net);
- rtnl_unlock();
}
static struct pernet_operations ipmr_net_ops = {
.init = ipmr_net_init,
.exit = ipmr_net_exit,
- .exit_batch = ipmr_net_exit_batch,
+ .exit_batch = ipmr_exit_batch_rtnl,
};
int __init ip_mr_init(void)
--
2.43.0.594.gd9cf4e227d-goog
Powered by blists - more mailing lists