From: Eric Dumazet <edumazet@google.com>
To: "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>,
Kuniyuki Iwashima <kuniyu@google.com>,
Ido Schimmel <idosch@nvidia.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
netdev@vger.kernel.org, eric.dumazet@gmail.com,
Eric Dumazet <edumazet@google.com>
Subject: [PATCH net-next 0/9] vxlan: convert configuration to RCU and drop RTNL in vxlan_fill_info()
Date: Thu, 3 Sep 2026 12:08:31 +0000 [thread overview]
Message-ID: <20260903120840.1024153-1-edumazet@google.com> (raw)
This series converts VXLAN device configuration (struct vxlan_config) to RCU
protection and removes the RTNL dependency from vxlan_fill_info(), enabling
lockless netlink link dumps (RTM_GETLINK) for VXLAN devices.
Patches 1-3 fix pre-existing issues uncovered while auditing RCU and VNIFILTER
paths:
- Patch 1 zero-initializes _md on the stack in vxlan_xmit_one() to avoid
leaking uninitialized stack bytes into GBP header fields when metadata
options are absent.
- Patch 2 fixes a use-after-free in vxlan_vnigroup_uninit() where
struct vxlan_vni_group was freed synchronously instead of via RCU.
- Patch 3 fixes lockless iteration over vg->vni_list in
vxlan_vnifilter_dump_dev() to use list_for_each_entry_rcu(), and clears
cb->args[1] on early returns to avoid leaking dump state across devices.
Patches 4-7 convert vxlan->cfg to an RCU-protected pointer:
- Patch 4 refactors RX, TX, MDB, and VNIFILTER helpers to take a
const struct vxlan_config * pointer parameter.
- Patch 5 moves the internal runtime state flag VXLAN_F_MDB out of
struct vxlan_config into atomic bitops (VXLAN_DEV_F_MDB) on
vxlan->flags, avoiding RCU reallocation of vxlan_config on MDB updates.
- Patch 6 converts struct vxlan_config from an embedded struct in
struct vxlan_dev to a dynamically allocated pointer.
- Patch 7 adds RCU annotations (__rcu), updates configuration changes to
publish new configs via rcu_assign_pointer() and free old ones via
kfree_rcu(), and protects readers under rcu_read_lock().
Patches 8-9 clean up redundant state and remove RTNL from dumps:
- Patch 8 removes vxlan->default_dst (struct vxlan_rdst), tracks the
lower netdevice via vxlan->lowerdev, and switches remaining readers to
access attributes directly from vxlan->cfg.
- Patch 9 updates vxlan_fill_info() to dereference vxlan->cfg under
rcu_read_lock() instead of relying on RTNL.
Eric Dumazet (9):
vxlan: initialize _md in vxlan_xmit_one()
vxlan: vnifilter: free vxlan_vni_group via RCU in
vxlan_vnigroup_uninit()
vxlan: vnifilter: use list_for_each_entry_rcu() in
vxlan_vnifilter_dump_dev()
vxlan: pass vxlan_config pointer to helper functions
vxlan: move VXLAN_F_MDB to struct vxlan_dev flags
vxlan: dynamically allocate struct vxlan_config
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 | 14 +-
.../mellanox/mlxsw/spectrum_switchdev.c | 57 +-
drivers/net/vxlan/vxlan_core.c | 720 +++++++++++-------
drivers/net/vxlan/vxlan_mdb.c | 45 +-
drivers/net/vxlan/vxlan_multicast.c | 80 +-
drivers/net/vxlan/vxlan_private.h | 18 +-
drivers/net/vxlan/vxlan_vnifilter.c | 77 +-
include/net/vxlan.h | 12 +-
9 files changed, 625 insertions(+), 409 deletions(-)
--
2.55.0.970.g62bdec98f9-goog
next reply other threads:[~2026-09-03 12:08 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 12:08 Eric Dumazet [this message]
2026-09-03 12:08 ` [PATCH net-next 1/9] vxlan: initialize _md in vxlan_xmit_one() Eric Dumazet
2026-09-05 3:42 ` Kuniyuki Iwashima
2026-09-03 12:08 ` [PATCH net-next 2/9] vxlan: vnifilter: free vxlan_vni_group via RCU in vxlan_vnigroup_uninit() Eric Dumazet
2026-09-05 4:51 ` Kuniyuki Iwashima
2026-09-06 15:40 ` Eric Dumazet
2026-09-07 6:11 ` netdev-bot+sashiko
2026-09-07 6:33 ` Eric Dumazet
2026-09-03 12:08 ` [PATCH net-next 3/9] vxlan: vnifilter: use list_for_each_entry_rcu() in vxlan_vnifilter_dump_dev() Eric Dumazet
2026-09-05 3:56 ` Kuniyuki Iwashima
2026-09-07 6:11 ` netdev-bot+sashiko
2026-09-03 12:08 ` [PATCH net-next 4/9] vxlan: pass vxlan_config pointer to helper functions Eric Dumazet
2026-09-05 4:09 ` Kuniyuki Iwashima
2026-09-03 12:08 ` [PATCH net-next 5/9] vxlan: move VXLAN_F_MDB to struct vxlan_dev flags Eric Dumazet
2026-09-05 4:13 ` Kuniyuki Iwashima
2026-09-07 6:11 ` netdev-bot+sashiko
2026-09-03 12:08 ` [PATCH net-next 6/9] vxlan: dynamically allocate struct vxlan_config Eric Dumazet
2026-09-05 4:29 ` Kuniyuki Iwashima
2026-09-07 6:11 ` netdev-bot+sashiko
2026-09-07 6:39 ` Eric Dumazet
2026-09-03 12:08 ` [PATCH net-next 7/9] vxlan: convert configuration to RCU protection Eric Dumazet
2026-09-05 4:33 ` Kuniyuki Iwashima
2026-09-07 6:11 ` netdev-bot+sashiko
2026-09-03 12:08 ` [PATCH net-next 8/9] vxlan: remove default_dst and use vxlan_config and lowerdev Eric Dumazet
2026-09-05 4:44 ` Kuniyuki Iwashima
2026-09-07 6:11 ` netdev-bot+sashiko
2026-09-03 12:08 ` [PATCH net-next 9/9] vxlan: no longer rely on RTNL in vxlan_fill_info() Eric Dumazet
2026-09-05 4:45 ` Kuniyuki Iwashima
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260903120840.1024153-1-edumazet@google.com \
--to=edumazet@google.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.