netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net-next 00/14] net: Convert ->exit_batch_rtnl() to ->exit_rtnl().
@ 2025-04-11 20:52 Kuniyuki Iwashima
  2025-04-11 20:52 ` [PATCH v2 net-next 01/14] net: Factorise setup_net() and cleanup_net() Kuniyuki Iwashima
                   ` (15 more replies)
  0 siblings, 16 replies; 20+ messages in thread
From: Kuniyuki Iwashima @ 2025-04-11 20:52 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Simon Horman, Kuniyuki Iwashima, Kuniyuki Iwashima, netdev

While converting nexthop to per-netns RTNL, there are two blockers
to using rtnl_net_dereference(), flush_all_nexthops() and
__unregister_nexthop_notifier(), both of which are called from
->exit_batch_rtnl().

Instead of spreading __rtnl_net_lock() over each ->exit_batch_rtnl(),
we should convert all ->exit_batch_rtnl() to per-net ->exit_rtnl() and
run it under __rtnl_net_lock() because all ->exit_batch_rtnl() functions
do not have anything to factor out for batching.

Patch 1 & 2 factorise the undo mechanism against ->init() into a single
function, and Patch 3 adds ->exit_batch_rtnl().

Patch 4 ~ 13 convert all ->exit_batch_rtnl() users.

Patch 14 removes ->exit_batch_rtnl().

Later, we can convert pfcp and ppp to use ->exit_rtnl().


v2:
  * Collect tags
  * Patch2
    * Convert free_exit_list() under CONFIG_NET_NS=n

v1: https://lore.kernel.org/all/20250410022004.8668-1-kuniyu@amazon.com/


Kuniyuki Iwashima (14):
  net: Factorise setup_net() and cleanup_net().
  net: Add ops_undo_single for module load/unload.
  net: Add ->exit_rtnl() hook to struct pernet_operations.
  nexthop: Convert nexthop_net_exit_batch_rtnl() to ->exit_rtnl().
  vxlan: Convert vxlan_exit_batch_rtnl() to ->exit_rtnl().
  ipv4: ip_tunnel: Convert ip_tunnel_delete_nets() callers to
    ->exit_rtnl().
  ipv6: Convert tunnel devices' ->exit_batch_rtnl() to ->exit_rtnl().
  xfrm: Convert xfrmi_exit_batch_rtnl() to ->exit_rtnl().
  bridge: Convert br_net_exit_batch_rtnl() to ->exit_rtnl().
  bonding: Convert bond_net_exit_batch_rtnl() to ->exit_rtnl().
  gtp: Convert gtp_net_exit_batch_rtnl() to ->exit_rtnl().
  bareudp: Convert bareudp_exit_batch_rtnl() to ->exit_rtnl().
  geneve: Convert geneve_exit_batch_rtnl() to ->exit_rtnl().
  net: Remove ->exit_batch_rtnl().

 drivers/net/bareudp.c           |  16 +--
 drivers/net/bonding/bond_main.c |  23 ++--
 drivers/net/geneve.c            |  16 +--
 drivers/net/gtp.c               |  18 ++--
 drivers/net/vxlan/vxlan_core.c  |  18 ++--
 include/net/ip_tunnels.h        |   7 +-
 include/net/net_namespace.h     |   4 +-
 net/bridge/br.c                 |  17 ++-
 net/core/net_namespace.c        | 181 +++++++++++++++++---------------
 net/ipv4/ip_gre.c               |  27 +++--
 net/ipv4/ip_tunnel.c            |  25 ++---
 net/ipv4/ip_vti.c               |   9 +-
 net/ipv4/ipip.c                 |   9 +-
 net/ipv4/nexthop.c              |  13 +--
 net/ipv6/ip6_gre.c              |  22 ++--
 net/ipv6/ip6_tunnel.c           |  24 ++---
 net/ipv6/ip6_vti.c              |  27 ++---
 net/ipv6/sit.c                  |  23 ++--
 net/xfrm/xfrm_interface_core.c  |  34 +++---
 19 files changed, 213 insertions(+), 300 deletions(-)

-- 
2.49.0


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

end of thread, other threads:[~2025-04-15  0:30 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-11 20:52 [PATCH v2 net-next 00/14] net: Convert ->exit_batch_rtnl() to ->exit_rtnl() Kuniyuki Iwashima
2025-04-11 20:52 ` [PATCH v2 net-next 01/14] net: Factorise setup_net() and cleanup_net() Kuniyuki Iwashima
2025-04-11 20:52 ` [PATCH v2 net-next 02/14] net: Add ops_undo_single for module load/unload Kuniyuki Iwashima
2025-04-15  0:01   ` Jakub Kicinski
2025-04-15  0:12     ` Jakub Kicinski
2025-04-15  0:17       ` Kuniyuki Iwashima
2025-04-11 20:52 ` [PATCH v2 net-next 03/14] net: Add ->exit_rtnl() hook to struct pernet_operations Kuniyuki Iwashima
2025-04-11 20:52 ` [PATCH v2 net-next 04/14] nexthop: Convert nexthop_net_exit_batch_rtnl() to ->exit_rtnl() Kuniyuki Iwashima
2025-04-11 20:52 ` [PATCH v2 net-next 05/14] vxlan: Convert vxlan_exit_batch_rtnl() " Kuniyuki Iwashima
2025-04-11 20:52 ` [PATCH v2 net-next 06/14] ipv4: ip_tunnel: Convert ip_tunnel_delete_nets() callers " Kuniyuki Iwashima
2025-04-11 20:52 ` [PATCH v2 net-next 07/14] ipv6: Convert tunnel devices' ->exit_batch_rtnl() " Kuniyuki Iwashima
2025-04-11 20:52 ` [PATCH v2 net-next 08/14] xfrm: Convert xfrmi_exit_batch_rtnl() " Kuniyuki Iwashima
2025-04-11 20:52 ` [PATCH v2 net-next 09/14] bridge: Convert br_net_exit_batch_rtnl() " Kuniyuki Iwashima
2025-04-11 20:52 ` [PATCH v2 net-next 10/14] bonding: Convert bond_net_exit_batch_rtnl() " Kuniyuki Iwashima
2025-04-11 20:52 ` [PATCH v2 net-next 11/14] gtp: Convert gtp_net_exit_batch_rtnl() " Kuniyuki Iwashima
2025-04-11 20:52 ` [PATCH v2 net-next 12/14] bareudp: Convert bareudp_exit_batch_rtnl() " Kuniyuki Iwashima
2025-04-11 20:52 ` [PATCH v2 net-next 13/14] geneve: Convert geneve_exit_batch_rtnl() " Kuniyuki Iwashima
2025-04-11 20:52 ` [PATCH v2 net-next 14/14] net: Remove ->exit_batch_rtnl() Kuniyuki Iwashima
2025-04-14 14:12 ` [PATCH v2 net-next 00/14] net: Convert ->exit_batch_rtnl() to ->exit_rtnl() Sabrina Dubroca
2025-04-15  0:30 ` patchwork-bot+netdevbpf

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).