Skip to content

net: more factorization in cleanup_net() paths

Eric Dumazet netdev 4 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest15 patches 3 repliesApplied 15/15
  2. v315 patches 4 repliesSuperseded
  3. v216 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v116 patches3 repliesSuperseded

Patches in v4 All 15 applied

#Subject and filesSizeRepliesApplied
1/15net: add exit_batch_rtnl() methodinclude/net/net_namespace.h net/core/net_namespace.c+33 -10 repliesApplied
2/15nexthop: convert nexthop_net_exit_batch to exit_batch_rtnl methodnet/ipv4/nexthop.c+12 -71 replyApplied
3/15bareudp: use exit_batch_rtnl() methoddrivers/net/bareudp.c+4 -90 repliesApplied
4/15bonding: use exit_batch_rtnl() methoddrivers/net/bonding/bond_main.c+26 -110 repliesApplied
5/15geneve: use exit_batch_rtnl() methoddrivers/net/geneve.c+10 -130 repliesApplied
6/15gtp: use exit_batch_rtnl() methoddrivers/net/gtp.c+10 -100 repliesApplied
7/15ipv4: add __unregister_nexthop_notifier()include/net/nexthop.h net/ipv4/nexthop.c+14 -61 replyApplied
8/15vxlan: use exit_batch_rtnl() methoddrivers/net/vxlan/vxlan_core.c+19 -310 repliesApplied
9/15ip6_gre: use exit_batch_rtnl() methodnet/ipv6/ip6_gre.c+5 -70 repliesApplied
10/15ip6_tunnel: use exit_batch_rtnl() methodnet/ipv6/ip6_tunnel.c+5 -70 repliesApplied
11/15ip6_vti: use exit_batch_rtnl() methodnet/ipv6/ip6_vti.c+5 -70 repliesApplied
12/15sit: use exit_batch_rtnl() methodnet/ipv6/sit.c+5 -80 repliesApplied
13/15ip_tunnel: use exit_batch_rtnl() methodinclude/net/ip_tunnels.h net/ipv4/ip_gre.c net/ipv4/ip_tunnel.c +2 more+31 -220 repliesApplied
14/15bridge: use exit_batch_rtnl() methodnet/bridge/br.c+5 -100 repliesApplied
15/15xfrm: interface: use exit_batch_rtnl() methodnet/xfrm/xfrm_interface_core.c+6 -80 repliesApplied

Reviews trailers per patch

3 of 15 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

Patch[email protected]Jay VosburghAntoine TenartDavid Ahern
SeriesReported-and-tested-by R-b
1/15
2/15R-b
3/15
4/15A-b
5/15
6/15
7/15R-b
8/15
9/15
10/15
11/15
12/15
13/15
14/15
15/15

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v4 thread

Cover letter [PATCH v4 net-next 00/15] net: more factorization in cleanup_net() paths

This series is inspired by recent syzbot reports hinting to RTNL and workqueue abuses.

rtnl_lock() is unfair to (single threaded) cleanup_net(), because many threads can cause contention on it.

This series adds a new (struct pernet_operations) method, so that cleanup_net() can hold RTNL longer once it finally acquires it.

It also factorizes unregister_netdevice_many(), to further reduce stalls in cleanup_net().

v4: Changed geneve patch (Antoine Tenart feedback)
Changed vxlan patch (Paolo Abeni feedback)

v3: Dropped "net: convert default_device_exit_batch() to exit_batch_rtnl method"
Jakub (and KASAN) reported issues with bridge, but the root cause was with this patch. default_device_exit_batch() is the catch-all method, it includes "lo" device dismantle.

v2: Antoine Tenart feedback in
https://lore.kernel.org/netdev/170688415193.5216.10499830272732622816@kwain/
- Added bond_net_pre_exit() method to make sure bond_destroy_sysfs() is called before we unregister the devices in bond_net_exit_batch_rtnl()

Eric Dumazet (15):
net: add exit_batch_rtnl() method
nexthop: convert nexthop_net_exit_batch to exit_batch_rtnl method
bareudp: use exit_batch_rtnl() method
bonding: use exit_batch_rtnl() method
geneve: use exit_batch_rtnl() method
gtp: use exit_batch_rtnl() method
ipv4: add __unregister_nexthop_notifier()
vxlan: use exit_batch_rtnl() method
ip6_gre: use exit_batch_rtnl() method
ip6_tunnel: use exit_batch_rtnl() method
ip6_vti: use exit_batch_rtnl() method
sit: use exit_batch_rtnl() method
ip_tunnel: use exit_batch_rtnl() method
bridge: use exit_batch_rtnl() method
xfrm: interface: use exit_batch_rtnl() method

 drivers/net/bareudp.c           | 13 +++------
 drivers/net/bonding/bond_main.c | 37 ++++++++++++++++--------
 drivers/net/geneve.c            | 23 +++++++--------
 drivers/net/gtp.c               | 20 ++++++-------
 drivers/net/vxlan/vxlan_core.c  | 50 +++++++++++++--------------------
 include/net/ip_tunnels.h        |  3 +-
 include/net/net_namespace.h     |  3 ++
 include/net/nexthop.h           |  1 +
 net/bridge/br.c                 | 15 ++++------
 net/core/net_namespace.c        | 31 +++++++++++++++++++-
 net/ipv4/ip_gre.c               | 24 ++++++++++------
 net/ipv4/ip_tunnel.c            | 10 +++----
 net/ipv4/ip_vti.c               |  8 ++++--
 net/ipv4/ipip.c                 |  8 ++++--
 net/ipv4/nexthop.c              | 38 ++++++++++++++++---------
 net/ipv6/ip6_gre.c              | 12 ++++----
 net/ipv6/ip6_tunnel.c           | 12 ++++----
 net/ipv6/ip6_vti.c              | 12 ++++----
 net/ipv6/sit.c                  | 13 ++++-----
 net/xfrm/xfrm_interface_core.c  | 14 ++++-----
 20 files changed, 190 insertions(+), 157 deletions(-)
Signature · 1 line
2.43.0.594.gd9cf4e227d-goog