From: Zhefu Peng <ilskdw@gmail.com>
To: netdev@vger.kernel.org
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
kuniyu@google.com, mschiffer@universe-factory.net,
nicolas.dichtel@6wind.com, shuah@kernel.org,
linux-kselftest@vger.kernel.org
Subject: [PATCH net v6 0/2] vxlan: reset the remote's dst cache when snooping moves a MAC
Date: Thu, 19 Nov 2026 17:52:54 +0800 [thread overview]
Message-ID: <20261119095256.42005-1-ilskdw@gmail.com> (raw)
When a learning VXLAN device snoops a known MAC from another VTEP, it
rewrites the remote's IP address in place but keeps the remote's
dst_cache and remote_ifindex. Traffic to the moved MAC can then use the
route cached for the previous remote and be blackholed. Patch 1 updates
the remote the way vxlan_fdb_replace() does, under vxlan->hash_lock,
and compares remote_ifindex in the early return only for link-local
sources, so a "via" device set on a dynamic entry is kept. Patch 2 adds
a selftest.
Results on net with 1, 2 and 4 CPUs, per selftest case (move behind a
router, move to link-local, via kept):
- without patch 1: 0/7, 0/7, 7/7
- with v5 of patch 1: 7/7, 7/7, 7/7
- with this version: 14/14, 14/14, 14/14
- with this version and CONFIG_PROVE_LOCKING: 7/7 for each case, no
lockdep splats
v6:
- update the remote under vxlan->hash_lock and check the entry again
once the lock is held, so concurrent snoops cannot mix remote_ip and
remote_ifindex (Sashiko)
- selftest: pin pings to an allowed CPU instead of CPU 0, skip when
setup_ns fails, and drop the CPU pinning from the IPv6 case, which
does not test the route cache (Sashiko)
v5: https://lore.kernel.org/netdev/20261115040609.61134-1-ilskdw@gmail.com/
- compare remote_ifindex in the early return only for link-local
sources, so traffic from the same remote no longer resets a "via"
device to 0 (Sashiko)
- selftest: add a case for the above and keep lines within 80 columns
v4: https://lore.kernel.org/netdev/20261113155133.75090-1-ilskdw@gmail.com/
- add the selftest (Nicolas Dichtel)
v3: https://lore.kernel.org/netdev/20261111180001.2475-1-ilskdw@gmail.com/
- use my real name in From: and Signed-off-by:
v2: https://lore.kernel.org/netdev/20261110153020.9635-1-ilskdw@gmail.com/
- also update remote_ifindex and clear offloaded, as vxlan_fdb_replace() does
- add the IPv6 link-local case to the changelog and a second Fixes tag
v1: https://lore.kernel.org/netdev/20261106144406.66035-1-ilskdw@gmail.com/
Zhefu Peng (2):
vxlan: reset the remote's dst cache when snooping moves a MAC
selftests: net: add a test for vxlan snooping moving a MAC
drivers/net/vxlan/vxlan_core.c | 59 ++++-
tools/testing/selftests/net/Makefile | 1 +
.../selftests/net/test_vxlan_snoop_move.sh | 222 ++++++++++++++++++
3 files changed, 274 insertions(+), 8 deletions(-)
create mode 100755 tools/testing/selftests/net/test_vxlan_snoop_move.sh
--
2.54.0
next reply other threads:[~2026-11-19 9:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 9:52 Zhefu Peng [this message]
2026-11-19 9:52 ` [PATCH net v6 1/2] vxlan: reset the remote's dst cache when snooping moves a MAC Zhefu Peng
2026-11-19 9:52 ` [PATCH net v6 2/2] selftests: net: add a test for vxlan snooping moving " Zhefu Peng
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=20261119095256.42005-1-ilskdw@gmail.com \
--to=ilskdw@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kselftest@vger.kernel.org \
--cc=mschiffer@universe-factory.net \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox