[PATCH net-next v2 0/4] udp_tunnel: remove rtnl_lock dependency

Stanislav Fomichev posted 4 patches 4 months ago
There is a newer version of this series
.../net/ethernet/broadcom/bnx2x/bnx2x_main.c  |  3 +-
drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 42 ++++---------------
drivers/net/ethernet/emulex/benet/be_main.c   |  3 +-
drivers/net/ethernet/intel/i40e/i40e_main.c   |  1 -
drivers/net/ethernet/intel/ice/ice_main.c     |  1 -
.../net/ethernet/mellanox/mlx4/en_netdev.c    |  3 +-
.../net/ethernet/mellanox/mlx5/core/en_main.c |  3 +-
.../ethernet/netronome/nfp/nfp_net_common.c   |  3 +-
.../net/ethernet/qlogic/qede/qede_filter.c    |  3 --
.../net/ethernet/qlogic/qlcnic/qlcnic_main.c  |  1 -
drivers/net/ethernet/sfc/ef10.c               |  1 -
drivers/net/netdevsim/netdevsim.h             |  2 -
drivers/net/netdevsim/udp_tunnels.c           | 12 ------
include/net/udp_tunnel.h                      |  8 ++--
net/core/dev.c                                |  2 -
net/ipv4/udp_tunnel_nic.c                     | 30 +++++++------
.../drivers/net/netdevsim/udp_tunnel_nic.sh   | 10 -----
17 files changed, 31 insertions(+), 97 deletions(-)
[PATCH net-next v2 0/4] udp_tunnel: remove rtnl_lock dependency
Posted by Stanislav Fomichev 4 months ago
Recently bnxt had to grow back a bunch of rtnl dependencies because
of udp_tunnel's infra. Add separate (global) mutext to protect
udp_tunnel state.

v2:
- move the lock into udp_tunnel_nic (Jakub)
- reorder the lock ordering (Jakub)
- move udp_ports_sleep removal into separate patch and update the test
  (Jakub)

Cc: Michael Chan <michael.chan@broadcom.com>

Stanislav Fomichev (4):
  udp_tunnel: remove rtnl_lock dependency
  net: remove redundant ASSERT_RTNL() in queue setup functions
  netdevsim: remove udp_ports_sleep
  Revert "bnxt_en: bring back rtnl_lock() in the bnxt_open() path"

 .../net/ethernet/broadcom/bnx2x/bnx2x_main.c  |  3 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 42 ++++---------------
 drivers/net/ethernet/emulex/benet/be_main.c   |  3 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c   |  1 -
 drivers/net/ethernet/intel/ice/ice_main.c     |  1 -
 .../net/ethernet/mellanox/mlx4/en_netdev.c    |  3 +-
 .../net/ethernet/mellanox/mlx5/core/en_main.c |  3 +-
 .../ethernet/netronome/nfp/nfp_net_common.c   |  3 +-
 .../net/ethernet/qlogic/qede/qede_filter.c    |  3 --
 .../net/ethernet/qlogic/qlcnic/qlcnic_main.c  |  1 -
 drivers/net/ethernet/sfc/ef10.c               |  1 -
 drivers/net/netdevsim/netdevsim.h             |  2 -
 drivers/net/netdevsim/udp_tunnels.c           | 12 ------
 include/net/udp_tunnel.h                      |  8 ++--
 net/core/dev.c                                |  2 -
 net/ipv4/udp_tunnel_nic.c                     | 30 +++++++------
 .../drivers/net/netdevsim/udp_tunnel_nic.sh   | 10 -----
 17 files changed, 31 insertions(+), 97 deletions(-)

-- 
2.49.0
Re: [PATCH net-next v2 0/4] udp_tunnel: remove rtnl_lock dependency
Posted by Jakub Kicinski 4 months ago
On Mon,  9 Jun 2025 09:25:37 -0700 Stanislav Fomichev wrote:
> Recently bnxt had to grow back a bunch of rtnl dependencies because
> of udp_tunnel's infra. Add separate (global) mutext to protect
> udp_tunnel state.

Appears to break the selftest, unfortunately:
https://netdev.bots.linux.dev/contest.html?test=udp-tunnel-nic-sh&branch=net-next-2025-06-09--21-00
-- 
pw-bot: cr
Re: [PATCH net-next v2 0/4] udp_tunnel: remove rtnl_lock dependency
Posted by Stanislav Fomichev 4 months ago
On 06/09, Jakub Kicinski wrote:
> On Mon,  9 Jun 2025 09:25:37 -0700 Stanislav Fomichev wrote:
> > Recently bnxt had to grow back a bunch of rtnl dependencies because
> > of udp_tunnel's infra. Add separate (global) mutext to protect
> > udp_tunnel state.
> 
> Appears to break the selftest, unfortunately:
> https://netdev.bots.linux.dev/contest.html?test=udp-tunnel-nic-sh&branch=net-next-2025-06-09--21-00

Argh, should have run it locally first :-(
Looks like there is a test that sets up pretty high sleep time (1 sec)
and expects entry to not appear during next 'ethtool --show-tunnels' run.

Gonna double check and remove the case if my understanding is correct.
Don't think there is much value in keeping the debugfs knob just for the
sake of this test? LMK if you disagree; otherwise gonna repost tomorrow.
Re: [PATCH net-next v2 0/4] udp_tunnel: remove rtnl_lock dependency
Posted by Jakub Kicinski 4 months ago
On Mon, 9 Jun 2025 16:19:34 -0700 Stanislav Fomichev wrote:
> On 06/09, Jakub Kicinski wrote:
> > On Mon,  9 Jun 2025 09:25:37 -0700 Stanislav Fomichev wrote:  
> > > Recently bnxt had to grow back a bunch of rtnl dependencies because
> > > of udp_tunnel's infra. Add separate (global) mutext to protect
> > > udp_tunnel state.  
> > 
> > Appears to break the selftest, unfortunately:
> > https://netdev.bots.linux.dev/contest.html?test=udp-tunnel-nic-sh&branch=net-next-2025-06-09--21-00  
> 
> Argh, should have run it locally first :-(
> Looks like there is a test that sets up pretty high sleep time (1 sec)
> and expects entry to not appear during next 'ethtool --show-tunnels' run.
> 
> Gonna double check and remove the case if my understanding is correct.
> Don't think there is much value in keeping the debugfs knob just for the
> sake of this test? LMK if you disagree; otherwise gonna repost tomorrow.

Hm, I see you partially deleted the sleep support in patch 3.
Maybe it's easier to keep it since we now always sleep?
No strong preference, tho.