diff options
| author | Eric Dumazet <edumazet@google.com> | 2026-09-22 18:11:00 +0000 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-09-28 16:43:00 -0700 |
| commit | 0db0197ef9e1da4eb4718dff5e9568739394ff65 (patch) | |
| tree | 2f139b1f8da1d4593cffeeae239d4bba9ac0c067 /include | |
| parent | 0259a5f1279f7aa39d1325bc7cc1c897d65521e5 (diff) | |
| download | linux-next-0db0197ef9e1da4eb4718dff5e9568739394ff65.tar.gz linux-next-0db0197ef9e1da4eb4718dff5e9568739394ff65.zip | |
vxlan: convert configuration to RCU protection
Move 'struct vxlan_config' from an embedded structure inside
'struct vxlan_dev' to a dynamically allocated RCU-protected pointer
'vxlan->cfg'.
Updating configuration via vxlan_changelink() or vxlan_dev_configure()
allocates a new struct vxlan_config and publishes it with
rcu_assign_pointer(), freeing the previous config with kfree_rcu().
Readers are converted to use rcu_dereference() or rtnl_dereference().
In vxlan_xmit(), acquire rcu_read_lock() to protect config access.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260922181102.3989489-7-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/vxlan.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/vxlan.h b/include/net/vxlan.h index d323f91af236..7ced743ec881 100644 --- a/include/net/vxlan.h +++ b/include/net/vxlan.h @@ -229,6 +229,7 @@ struct vxlan_config { bool no_share; enum ifla_vxlan_df df; struct vxlanhdr reserved_bits; + struct rcu_head rcu; }; enum { @@ -302,7 +303,7 @@ struct vxlan_dev { struct gro_cells gro_cells; unsigned long flags; - struct vxlan_config cfg; + struct vxlan_config __rcu *cfg; struct vxlan_vni_group __rcu *vnigrp; |
