Message ID | 20250410022004.8668-6-kuniyu@amazon.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: Convert ->exit_batch_rtnl() to ->exit_rtnl(). | expand |
On 4/10/25 05:19, Kuniyuki Iwashima wrote: > vxlan_exit_batch_rtnl() iterates the dying netns list and > performs the same operations for each. > > Let's use ->exit_rtnl(). > > Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> > --- > Cc: Andrew Lunn <andrew+netdev@lunn.ch> > --- > drivers/net/vxlan/vxlan_core.c | 18 +++++++----------- > 1 file changed, 7 insertions(+), 11 deletions(-) > > diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c > index 8c49e903cb3a..6ee61334719b 100644 > --- a/drivers/net/vxlan/vxlan_core.c > +++ b/drivers/net/vxlan/vxlan_core.c > @@ -4966,19 +4966,15 @@ static void __net_exit vxlan_destroy_tunnels(struct vxlan_net *vn, > vxlan_dellink(vxlan->dev, dev_to_kill); > } > > -static void __net_exit vxlan_exit_batch_rtnl(struct list_head *net_list, > - struct list_head *dev_to_kill) > +static void __net_exit vxlan_exit_rtnl(struct net *net, > + struct list_head *dev_to_kill) > { > - struct net *net; > - > - ASSERT_RTNL(); > - list_for_each_entry(net, net_list, exit_list) { > - struct vxlan_net *vn = net_generic(net, vxlan_net_id); > + struct vxlan_net *vn = net_generic(net, vxlan_net_id); > > - __unregister_nexthop_notifier(net, &vn->nexthop_notifier_block); > + ASSERT_RTNL_NET(net); > > - vxlan_destroy_tunnels(vn, dev_to_kill); > - } > + __unregister_nexthop_notifier(net, &vn->nexthop_notifier_block); > + vxlan_destroy_tunnels(vn, dev_to_kill); > } > > static void __net_exit vxlan_exit_net(struct net *net) > @@ -4992,7 +4988,7 @@ static void __net_exit vxlan_exit_net(struct net *net) > > static struct pernet_operations vxlan_net_ops = { > .init = vxlan_init_net, > - .exit_batch_rtnl = vxlan_exit_batch_rtnl, > + .exit_rtnl = vxlan_exit_rtnl, > .exit = vxlan_exit_net, > .id = &vxlan_net_id, > .size = sizeof(struct vxlan_net), Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c index 8c49e903cb3a..6ee61334719b 100644 --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c @@ -4966,19 +4966,15 @@ static void __net_exit vxlan_destroy_tunnels(struct vxlan_net *vn, vxlan_dellink(vxlan->dev, dev_to_kill); } -static void __net_exit vxlan_exit_batch_rtnl(struct list_head *net_list, - struct list_head *dev_to_kill) +static void __net_exit vxlan_exit_rtnl(struct net *net, + struct list_head *dev_to_kill) { - struct net *net; - - ASSERT_RTNL(); - list_for_each_entry(net, net_list, exit_list) { - struct vxlan_net *vn = net_generic(net, vxlan_net_id); + struct vxlan_net *vn = net_generic(net, vxlan_net_id); - __unregister_nexthop_notifier(net, &vn->nexthop_notifier_block); + ASSERT_RTNL_NET(net); - vxlan_destroy_tunnels(vn, dev_to_kill); - } + __unregister_nexthop_notifier(net, &vn->nexthop_notifier_block); + vxlan_destroy_tunnels(vn, dev_to_kill); } static void __net_exit vxlan_exit_net(struct net *net) @@ -4992,7 +4988,7 @@ static void __net_exit vxlan_exit_net(struct net *net) static struct pernet_operations vxlan_net_ops = { .init = vxlan_init_net, - .exit_batch_rtnl = vxlan_exit_batch_rtnl, + .exit_rtnl = vxlan_exit_rtnl, .exit = vxlan_exit_net, .id = &vxlan_net_id, .size = sizeof(struct vxlan_net),
vxlan_exit_batch_rtnl() iterates the dying netns list and performs the same operations for each. Let's use ->exit_rtnl(). Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> --- Cc: Andrew Lunn <andrew+netdev@lunn.ch> --- drivers/net/vxlan/vxlan_core.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-)