Skip to content

vxlan: convert configuration to RCU and enable lockless dumps

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. v6 Latest8 patches 1 replyApplied 8/8
  2. v58 patches 0 repliesSuperseded
  3. v48 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v36 patches5 repliesSuperseded

Changes in v6 from the cover letter

- In vxlan_multicast_leave_vnigrp(), skip entries matching the device-default remote_ip and ignore -EADDRNOTAVAIL when multiple VNIs share a multicast group, matching vxlan_multicast_join_vnigrp() (patches 1, 7).
- In vxlan_changelink(), still attempt vxlan_multicast_join() after vxlan_config_apply() even if vxlan_multicast_leave() returned an error (patches 1, 6, 7).
- In vxlan_vni_update_group(), set oldrip to the previous effective remote IP when updating an existing VNI (!create) so replacing a VNI's group removes the previous default FDB rdst instead of accumulating duplicates
(patches 1, 7).
- In vxlan_update_default_fdb_entry(), still delete the newly added rdst on rollback (extack == NULL) if re-adding the previous rdst fails (patch 1).
- Link to v5: https://lore.kernel.org/netdev/[email protected]/

Patches in v6 All 8 applied

#Subject and filesSizeRepliesApplied
1/8vxlan: update default fdb entries when the lower device changesdrivers/net/vxlan/vxlan_core.c drivers/net/vxlan/vxlan_multicast.c drivers/net/vxlan/vxlan_private.h +1 more+106 -310 repliesApplied
2/8vxlan: vnifilter: use list_for_each_entry_rcu() in vxlan_vnifilter_dump_dev()drivers/net/vxlan/vxlan_vnifilter.c+18 -50 repliesApplied
3/8vxlan: vnifilter: signal interrupted RTM_GETTUNNEL dumpsdrivers/net/vxlan/vxlan_core.c drivers/net/vxlan/vxlan_private.h drivers/net/vxlan/vxlan_vnifilter.c+42 -60 repliesApplied
4/8vxlan: pass vxlan_config pointer to helper functionsdrivers/net/vxlan/vxlan_core.c drivers/net/vxlan/vxlan_mdb.c drivers/net/vxlan/vxlan_private.h +1 more+206 -1710 repliesApplied
5/8vxlan: move VXLAN_F_MDB to struct vxlan_dev flagsdrivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c drivers/net/vxlan/vxlan_core.c drivers/net/vxlan/vxlan_mdb.c +1 more+14 -50 repliesApplied
6/8vxlan: convert configuration to RCU protectiondrivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c drivers/net/vxlan/vxlan_core.c +4 more+263 -1280 repliesApplied
7/8vxlan: remove default_dst and use vxlan_config and lowerdevdrivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_vxlan.c drivers/net/vxlan/vxlan_core.c drivers/net/vxlan/vxlan_mdb.c +4 more+213 -1630 repliesApplied
8/8vxlan: no longer rely on RTNL in vxlan_fill_info()drivers/net/vxlan/vxlan_core.c+4 -10 repliesApplied

Reviews trailers per patch

6 of 8 patches have a Reviewed-by or Acked-by.

PatchKuniyuki Iwashima
1/8
2/8R-b
3/8
4/8R-b
5/8R-b
6/8R-b
7/8R-b
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 net-next 0/8] vxlan: convert configuration to RCU and enable lockless dumps

This patch series converts struct vxlan_config to RCU protection, eliminates redundant destination fields, and enables lockless RTNL-free link dumping in vxlan_fill_info().

Changes in v6:
- In vxlan_multicast_leave_vnigrp(), skip entries matching the device-default remote_ip and ignore -EADDRNOTAVAIL when multiple VNIs share a multicast group, matching vxlan_multicast_join_vnigrp() (patches 1, 7).
- In vxlan_changelink(), still attempt vxlan_multicast_join() after vxlan_config_apply() even if vxlan_multicast_leave() returned an error (patches 1, 6, 7).
- In vxlan_vni_update_group(), set oldrip to the previous effective remote IP when updating an existing VNI (!create) so replacing a VNI's group removes the previous default FDB rdst instead of accumulating duplicates
(patches 1, 7).
- In vxlan_update_default_fdb_entry(), still delete the newly added rdst on rollback (extack == NULL) if re-adding the previous rdst fails (patch 1).
- Link to v5: https://lore.kernel.org/netdev/[email protected]/

Changes in v5:
- Widen vxlan_multicast_leave() and vxlan_multicast_join() conditions in vxlan_changelink() to also run when VXLAN_F_VNIFILTER is set, so per-VNI multicast memberships are migrated across lower-device changes even when the device-default remote_ip is 0.0.0.0 (patches 1, 6, 7).
- Unwind already-updated per-VNI entries and the device-wide default FDB entry if vxlan_vnilist_update_group() fails partway through in vxlan_changelink() (patches 1, 7).
- Bump the vnifilter dump generation counter inside vxlan_vni_update_group() as soon as vninode->remote_ip is overwritten, so concurrent dumps still observe NLM_F_DUMP_INTR if a subsequent IGMP leave/join fails (patch 3).
- In vxlan_config_validate(), reject clearing IFLA_VXLAN_LINK when VXLAN_F_VNIFILTER has per-VNI multicast groups configured (patch 7).
- In vxlan_config_apply(), reset dev->needed_tailroom when detaching a lower device and use READ_ONCE()/WRITE_ONCE() for dev->mtu (patch 7).
- Link to v4: https://lore.kernel.org/netdev/[email protected]/

Changes in v4:
- Split out the default FDB update fix when the lower device changes into patch 1 with a Fixes: tag, and updated vxlan_vnilist_update_group() to refresh all VNIs (including those with explicit per-VNI multicast groups) so their FDB entries do not retain a stale remote_ifindex. Kept in this series rather than routing through net to avoid a cross-tree conflict with the default_dst removal in patch 7.
- Added patch 3 to signal interrupted RTM_GETTUNNEL dumps to user space via a per-netns atomic generation counter and nl_dump_check_consistent(), per Paolo's suggestion.
- Added an explicit VXLAN_DEV_F_MDB check in mlxsw_sp_nve_vxlan_can_offload() so moving VXLAN_F_MDB out of cfg->flags does not silently relax mlxsw's deny-by-default flag validation (patch 5).
- In vxlan_config_apply(), gated the MTU clamp on lowerdev_changed so that unrelated changelink operations do not shrink dev->mtu (patch 7).
- Documented in patch 7's changelog that cfg->remote_ifindex is now committed unconditionally and that IFLA_VXLAN_LINK=0 tears down the upper/lower adjacency.
- Link to v3: https://lore.kernel.org/netdev/[email protected]/

Changes in v3:
- Folded configuration conversion patches into a single patch to maintain clean bisectability and avoid intermediate mutable state.
- In vxlan_changelink(), pass lowerdev to vxlan_config_apply() to prevent truncating dev->needed_headroom and dev->needed_tailroom when lowerdev does not change.
- Cleaned up redundant NULL checks and unreachable error paths.

Eric Dumazet (8):
vxlan: update default fdb entries when the lower device changes
vxlan: vnifilter: use list_for_each_entry_rcu() in
vxlan_vnifilter_dump_dev()
vxlan: vnifilter: signal interrupted RTM_GETTUNNEL dumps
vxlan: pass vxlan_config pointer to helper functions
vxlan: move VXLAN_F_MDB to struct vxlan_dev flags
vxlan: convert configuration to RCU protection
vxlan: remove default_dst and use vxlan_config and lowerdev
vxlan: no longer rely on RTNL in vxlan_fill_info()

 .../mellanox/mlx5/core/en/tc_tun_vxlan.c      |  11 +-
 .../mellanox/mlxsw/spectrum_nve_vxlan.c       |  19 +-
 .../mellanox/mlxsw/spectrum_switchdev.c       |  57 +-
 drivers/net/vxlan/vxlan_core.c                | 762 +++++++++++-------
 drivers/net/vxlan/vxlan_mdb.c                 |  45 +-
 drivers/net/vxlan/vxlan_multicast.c           |  94 ++-
 drivers/net/vxlan/vxlan_private.h             |  34 +-
 drivers/net/vxlan/vxlan_vnifilter.c           | 206 +++--
 include/net/vxlan.h                           |  12 +-
 9 files changed, 798 insertions(+), 442 deletions(-)
Signature · 1 line
2.55.0.1082.g2b9226bbc0-goog