Re: [PATCH v2 net 2/3] net: udp_tunnel: convert state flags to atomic bitops
From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-06-25 15:08:55
From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-06-25 15:08:55
On Thu, 25 Jun 2026 06:59:37 +0000 Eric Dumazet wrote:
These flags can be modified concurrently from different contexts: - RTNL-locked paths (like add_port/del_port) write to need_sync and work_pending.
These should hold utn->lock. Not sure why udp_tunnel_nic_lock() is locking in the callers rather than directly in __udp_tunnel_nic_add_port() / __udp_tunnel_nic_del_port()..
- The RTNL-less reset path (reset_ntf, used by netdevsim) writes to need_sync and need_replay under utn->lock.
I'd rather add asserts to confirm utn lock is held everywhere. This code is hard enough to follow as is, without having to think through potential concurrent accesses.