Re: [PATCH net-next 8/9] vxlan: remove default_dst and use vxlan_config and lowerdev
From: Kuniyuki Iwashima <kuniyu@google.com>
Date: 2026-09-05 04:44:55
On Thu, Sep 3, 2026 at 5:08 AM Eric Dumazet [off-list ref] wrote:
Now that vxlan->cfg is an RCU-protected pointer, storing default destination attributes (remote_ip, remote_vni, remote_ifindex) in vxlan->default_dst is redundant and creates potential data races for lockless readers. Furthermore, several fields of struct vxlan_rdst (remote_port, offloaded, list, rcu, dst_cache) in default_dst were completely unused. Replace vxlan->default_dst with a 'struct net_device *lowerdev' pointer in struct vxlan_dev to track adjacent upper/lower netdev topology under RTNL, and switch all remaining users over to reading configuration attributes from vxlan->cfg. Also update mlx5e_tc_tun_get_remote_ifindex() to read remote_ifindex from vxlan->cfg under rcu_read_lock(). While updating lowerdev handling in vxlan_changelink(), avoid clobbering lowerdev to NULL when unchanged, and properly unlink and clear vxlan->lowerdev if the lower device is removed. Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> [...]
quoted hunk ↗ jump to hunk
@@ -153,22 +158,22 @@ bool vxlan_group_used(struct vxlan_net *vn, struct vxlan_dev *dev, continue; if (family == AF_INET && - rtnl_dereference(vxlan->vn4_sock) != sock4) + rtnl_dereference(vxlan->vn4_sock) != sock4) continue; #if IS_ENABLED(CONFIG_IPV6) if (family == AF_INET6 && - rtnl_dereference(vxlan->vn6_sock) != sock6) + rtnl_dereference(vxlan->vn6_sock) != sock6)
nit: if v2 is needed, the two indentation changes above look unnecessary