[PATCH net v2 0/2] seg6: fix dst_cache sharing in seg6 lwtunnel

Andrea Mayer posted 2 patches 3 hours ago
net/ipv6/seg6_iptunnel.c                      |  34 ++--
tools/testing/selftests/net/Makefile          |   1 +
.../selftests/net/srv6_iptunnel_cache.sh      | 177 ++++++++++++++++++
3 files changed, 201 insertions(+), 11 deletions(-)
create mode 100755 tools/testing/selftests/net/srv6_iptunnel_cache.sh
[PATCH net v2 0/2] seg6: fix dst_cache sharing in seg6 lwtunnel
Posted by Andrea Mayer 3 hours ago
The seg6 lwtunnel encap uses a single per-route dst_cache shared
between seg6_input_core() and seg6_output_core(). These two paths
can perform the post-encap SID lookup in different routing contexts
(e.g., ip rules matching on the ingress interface, or VRF table
separation). Whichever path runs first populates the cache, and the
other reuses it blindly, bypassing its own lookup.

Patch 1 fixes this by splitting the cache into cache_input and
cache_output. Patch 2 adds a selftest that validates the isolation.

Changes v1 -> v2:
 - Patch 2: fix SKIP message wording (Nicolas)

Andrea Mayer (2):
  seg6: separate dst_cache for input and output paths in seg6 lwtunnel
  selftests: seg6: add test for dst_cache isolation in seg6 lwtunnel

 net/ipv6/seg6_iptunnel.c                      |  34 ++--
 tools/testing/selftests/net/Makefile          |   1 +
 .../selftests/net/srv6_iptunnel_cache.sh      | 177 ++++++++++++++++++
 3 files changed, 201 insertions(+), 11 deletions(-)
 create mode 100755 tools/testing/selftests/net/srv6_iptunnel_cache.sh

-- 
2.43.0