nexthop: convert nexthop_net_exit_batch to exit_batch_rtnl method
authorEric Dumazet <edumazet@google.com>
Tue, 6 Feb 2024 14:42:59 +0000 (14:42 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 8 Feb 2024 02:55:11 +0000 (18:55 -0800)
commita7ec2512ad7b23340059f59f3fd710cab056791a
treee40d9ddaba613228fb6cdc071a67d068b67d17db
parentfd4f101edbd9f99567ab2adb1f2169579ede7c13
nexthop: convert nexthop_net_exit_batch to exit_batch_rtnl method

exit_batch_rtnl() is called while RTNL is held.

This saves one rtnl_lock()/rtnl_unlock() pair.

We also need to create nexthop_net_exit()
to make sure net->nexthop.devhash is not freed too soon,
otherwise we will not be able to unregister netdev
from exit_batch_rtnl() methods.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Antoine Tenart <atenart@kernel.org>
Link: https://lore.kernel.org/r/20240206144313.2050392-4-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/nexthop.c