linux/include/net
Kuniyuki Iwashima 7a60d91c69 net: Add ->exit_rtnl() hook to struct pernet_operations.
struct pernet_operations provides two batching hooks; ->exit_batch()
and ->exit_batch_rtnl().

The batching variant is beneficial if ->exit() meets any of the
following conditions:

  1) ->exit() repeatedly acquires a global lock for each netns

  2) ->exit() has a time-consuming operation that can be factored
     out (e.g. synchronize_rcu(), smp_mb(), etc)

  3) ->exit() does not need to repeat the same iterations for each
     netns (e.g. inet_twsk_purge())

Currently, none of the ->exit_batch_rtnl() functions satisfy any of
the above conditions because RTNL is factored out and held by the
caller and all of these functions iterate over the dying netns list.

Also, we want to hold per-netns RTNL there but avoid spreading
__rtnl_net_lock() across multiple locations.

Let's add ->exit_rtnl() hook and run it under __rtnl_net_lock().

The following patches will convert all ->exit_batch_rtnl() users
to ->exit_rtnl().

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Link: https://patch.msgid.link/20250411205258.63164-4-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-04-14 17:08:41 -07:00
..
9p
bluetooth Bluetooth: MGMT: Add LL Privacy Setting 2025-03-25 15:22:49 -04:00
caif
iucv
libeth libeth: move idpf_rx_csum_decoded and idpf_rx_extracted 2025-02-14 10:58:08 -08:00
mana RDMA v6.15 merge window pull request 2025-03-29 11:12:28 -07:00
netfilter netfilter pull request 25-03-23 2025-03-25 08:29:13 -07:00
netns udp_tunnel: create a fastpath GRO lookup. 2025-04-08 18:19:41 -07:00
nfc
page_pool page_pool: Track DMA-mapped pages and unmap them when destroying the pool 2025-04-14 16:30:29 -07:00
phonet
sctp Including fixes from netfilter. 2025-04-10 08:52:18 -07:00
tc_act
6lowpan.h
act_api.h
addrconf.h ipv6: Add __in6_dev_get_rtnl_net(). 2025-01-20 12:16:04 -08:00
af_ieee802154.h
af_rxrpc.h rxrpc: Allow the app to store private data on peer structs 2025-03-10 09:47:15 +00:00
af_unix.h unix: fix up for "apparmor: add fine grained af_unix mediation" 2025-03-26 09:31:18 -07:00
af_vsock.h
ah.h
amt.h
arp.h
atmclip.h
ax25.h ax25: Remove broken autobind 2025-03-24 10:26:53 +00:00
ax88796.h
bareudp.h
bond_3ad.h
bond_alb.h
bond_options.h
bonding.h bonding: check xdp prog when set bond mode 2025-03-25 08:00:09 -07:00
bpf_sk_storage.h
busy_poll.h net: gro: decouple GRO from the NAPI layer 2025-02-27 14:03:14 +01:00
calipso.h
cfg80211-wext.h
cfg80211.h wifi: cfg80211: expose cfg80211_chandef_get_width() 2025-03-12 09:50:24 +01:00
cfg802154.h
checksum.h
cipso_ipv4.h
cls_cgroup.h
codel_impl.h
codel_qdisc.h
codel.h
compat.h
datalink.h
dcbevent.h
dcbnl.h
devlink.h devlink: add devl guard 2025-01-16 13:04:58 -08:00
dropreason-core.h tcp: add LINUX_MIB_PAWS_TW_REJECTED counter 2025-04-10 18:29:26 -07:00
dropreason.h wifi: mac80211: Drop cooked monitor support 2025-02-11 11:58:17 +01:00
dsa_stubs.h
dsa.h net: dsa: implement get_ts_stats ethtool operation for user ports 2025-01-17 20:01:09 -08:00
dscp.h
dsfield.h
dst_cache.h
dst_metadata.h net: Add options as a flexible array to struct ip_tunnel_info 2025-02-20 13:17:16 -08:00
dst_ops.h
dst.h
eee.h
erspan.h
esp.h
espintcp.h
ethoc.h
failover.h
fib_notifier.h
fib_rules.h ipv4: fib_rules: Add port mask matching 2025-02-19 18:43:38 -08:00
firewire.h
flow_dissector.h
flow_offload.h
flow.h
fou.h
fq_impl.h
fq.h
garp.h
gen_stats.h
genetlink.h
geneve.h
gre.h
gro_cells.h
gro.h net: gro: expose GRO init/cleanup to use outside of NAPI 2025-02-27 14:03:14 +01:00
gso.h
gtp.h
gue.h
handshake.h
hotdata.h net: introduce per netns packet chains 2025-03-24 13:58:22 -07:00
hwbm.h
icmp.h
ieee8021q.h
ieee80211_radiotap.h
ieee802154_netdev.h
if_inet6.h
ife.h
inet_common.h
inet_connection_sock.h tcp/dccp: remove icsk->icsk_ack.timeout 2025-03-25 10:34:33 -07:00
inet_dscp.h
inet_ecn.h
inet_frag.h inet: frags: change inet_frag_kill() to defer refcount updates 2025-03-18 13:18:36 +01:00
inet_hashtables.h tcp: Rename tcp_or_dccp_get_hashinfo(). 2025-04-11 18:58:11 -07:00
inet_sock.h sctp: Prepare sctp_v4_get_dst() to dscp_t conversion. 2025-01-06 13:49:38 -08:00
inet_timewait_sock.h
inet6_connection_sock.h tcp/dccp: Remove inet_connection_sock_af_ops.addr2sockaddr(). 2025-03-24 12:10:13 -07:00
inet6_hashtables.h tcp: convert to dev_net_rcu() 2025-03-03 15:44:19 -08:00
inetpeer.h inetpeer: remove create argument of inet_getpeer() 2024-12-17 19:37:00 -08:00
ioam6.h
ip_fib.h ipv4: fib: Allocate fib_info_hash[] during netns initialisation. 2025-03-03 15:04:09 -08:00
ip_tunnels.h net: ip_tunnel: Use link netns in newlink() of rtnl_link_ops 2025-02-21 15:28:02 -08:00
ip_vs.h
ip.h net: use netif_disable_lro in ipv6_add_dev 2025-04-03 15:32:08 -07:00
ip6_checksum.h
ip6_fib.h
ip6_route.h
ip6_tunnel.h
ipcomp.h xfrm: ipcomp: Use crypto_acomp interface 2025-03-21 17:36:49 +08:00
ipconfig.h
ipv6_frag.h inet: frags: change inet_frag_kill() to defer refcount updates 2025-03-18 13:18:36 +01:00
ipv6_stubs.h
ipv6.h ipv6: fix _DEVADD() and _DEVUPD() macros 2025-03-25 07:31:24 -07:00
iw_handler.h
kcm.h
l3mdev.h vrf: use RCU protection in l3mdev_l3_out() 2025-02-10 18:09:09 -08:00
lag.h
lapb.h
llc_c_ac.h
llc_c_ev.h
llc_c_st.h
llc_conn.h
llc_if.h
llc_pdu.h
llc_s_ac.h
llc_s_ev.h
llc_s_st.h
llc_sap.h
llc.h
lwtunnel.h inet: fix lwtunnel_valid_encap_type() lock imbalance 2025-03-05 19:16:56 -08:00
mac80211.h wifi: mac80211: add ieee80211_iter_chan_contexts_mtx 2025-02-26 15:48:47 +01:00
mac802154.h
macsec.h net: macsec: Add endianness annotations in salt struct 2025-01-20 12:20:42 +00:00
mctp.h net: mctp: Remove unnecessary cast in mctp_cb 2025-03-21 18:18:12 +01:00
mctpdevice.h
mip6.h
mld.h
mpls_iptunnel.h
mpls.h
mptcp.h mptcp: sysctl: add available_path_managers 2025-03-20 10:14:49 +01:00
mrp.h
ncsi.h
ndisc.h
neighbour_tables.h
neighbour.h
net_debug.h
net_failover.h
net_namespace.h net: Add ->exit_rtnl() hook to struct pernet_operations. 2025-04-14 17:08:41 -07:00
net_ratelimit.h
net_shaper.h
net_trackers.h
netdev_lock.h netdev: add "ops compat locking" helpers 2025-04-09 17:01:51 -07:00
netdev_netlink.h net: add granular lock for the netdev netlink socket 2025-03-12 13:32:35 -07:00
netdev_queues.h netdev: depend on netdev->lock for qstats in ops locked drivers 2025-04-09 17:01:52 -07:00
netdev_rx_queue.h net: designate XSK pool pointers in queues as "ops protected" 2025-04-09 17:01:51 -07:00
netevent.h
netkit.h
netlabel.h
netlink.h netlink: Add nla_put_empty_nest helper 2025-02-17 16:46:03 -08:00
netmem.h net: generalise net_iov chunk owners 2025-02-06 16:27:30 -08:00
netprio_cgroup.h
netrom.h
nexthop.h
nl802154.h
nsh.h
p8022.h
pfcp.h
pie.h
ping.h
pkt_cls.h net: sched: refine software bypass handling in tc_run 2025-01-20 09:21:27 +00:00
pkt_sched.h
pptp.h
proto_memory.h
protocol.h
psample.h
psnap.h
raw.h
rawv6.h
red.h
regulatory.h
request_sock.h
rose.h
route.h ipv4: add RCU protection to ip4_dst_hoplimit() 2025-02-06 16:14:14 -08:00
rpl.h
rps.h net: rps: remove kfree_rcu_mightsleep() use 2025-04-08 12:30:55 -07:00
rsi_91x.h
rstreason.h net: Retire DCCP socket. 2025-04-11 18:58:10 -07:00
rtnetlink.h rtnetlink: Remove "net" from newlink params 2025-02-21 15:28:03 -08:00
rtnh.h
sch_generic.h net: sched: Fix truncation of offloaded action statistics 2025-02-05 18:32:06 -08:00
scm.h
secure_seq.h net: Retire DCCP socket. 2025-04-11 18:58:10 -07:00
seg6_hmac.h
seg6_local.h
seg6.h
selftests.h
slhc_vj.h
smc.h
snmp.h percpu: use TYPEOF_UNQUAL() in variable declarations 2025-03-16 22:05:53 -07:00
sock_reuseport.h
sock.h net: Unexport shared functions for DCCP. 2025-04-11 18:58:11 -07:00
Space.h
stp.h
strparser.h strparser: Add read_sock callback 2025-01-29 13:32:08 -08:00
switchdev.h
tc_wrapper.h
tcp_ao.h
tcp_states.h
tcp.h tcp: add TCP_RFC7323_TW_PAWS drop reason 2025-04-10 18:29:26 -07:00
tcx.h
timewait_sock.h
tipc.h
tls_prot.h
tls_toe.h
tls.h
transp_v6.h
tso.h
tun_proto.h
udp_tunnel.h udp: properly deal with xfrm encap and ADDRFORM 2025-04-14 14:29:01 -07:00
udp.h udp_tunnel: create a fastpath GRO lookup. 2025-04-08 18:19:41 -07:00
udplite.h
vsock_addr.h
vxlan.h
wext.h
x25.h
x25device.h
xdp_priv.h
xdp_sock_drv.h xsk: Add launch time hardware offload support to XDP Tx metadata 2025-02-20 15:13:45 -08:00
xdp_sock.h xsk: Add launch time hardware offload support to XDP Tx metadata 2025-02-20 15:13:45 -08:00
xdp.h xdp: double protect netdev->xdp_flags with netdev->lock 2025-04-09 17:01:52 -07:00
xfrm.h xfrm: check for PMTU in tunnel mode for packet offload 2025-02-21 08:08:15 +01:00
xsk_buff_pool.h xsk: add helper to get &xdp_desc's DMA and meta pointer in one go 2025-02-10 17:54:43 -08:00