End.MAP is the simplest of the SRv6 Mobile User Plane (RFC 9433)
behaviors: it replaces the IPv6 destination address with the
configured mapped SID and forwards via the IPv6 FIB without consuming
the SRH. This series is the first per-behavior rebuild of the SRv6
Mobile User Plane v2 submission [1], split one series per behavior
following upstream review.
Because End.MAP is the first behavior to land, this series also
introduces the SRv6 Mobile User Plane lwtunnel framework that the
subsequent per-behavior series plug into:
* a new LWTUNNEL_ENCAP_SEG6_MOBILE encap type with a
CONFIG_IPV6_SEG6_MOBILE build option,
* net/ipv6/seg6_mobile.c, which hosts the action dispatch table,
* include/uapi/linux/seg6_mobile.h, a dedicated SEG6_MOBILE_*
attribute namespace, so that attributes whose semantics differ
between the mobility behaviors and the RFC 8986 behaviors do
not overload the SEG6_LOCAL_* table.
This layout follows the discussion on the v2 thread; feedback on it
from the lwtunnel maintainers is particularly welcome. Per the same
discussion, netfilter hook integration, VRF support and SRv6-specific
drop reasons are left out of this initial series and will be
revisited separately.
The LLM review of v2 flagged that seg6_hmac_validate_skb() reads the
SRH from skb_transport_header(), which on this path still points at
the first extension header. seg6_local.c reaches the helper the same
way, so End.MAP inherits the behavior rather than introducing it; a
fix, if wanted, belongs outside this series.
A matching iproute2 series adding the "seg6mobile" encap keyword
follows shortly after this posting, since the selftest needs it to
run.
[1]
https://lore.kernel.org/netdev/[email protected]/
Signed-off-by: Yuya Kusakabe <[email protected]>
---
Changes in v3:
- Silence the shellcheck SC2154 reports for the namespace variables
setup_ns assigns
- Fix the checkpatch alignment and __func__ reports in the selftest
helper
- Link to v2:
https://lore.kernel.org/r/[email protected]
Changes in v2:
- End.MAP: patch the L4 checksum also for an SRH with no segments
left and for first fragments; selftest cases added for both.
- Use nla_parse_nested() for the nested attributes.
- Rework the selftest helper and cases; wait for counters instead of
sampling them; add CONFIG_IPV6_SEG6_MOBILE to the selftests config.
- Rename the SEG6_MOBILE_NH6 attribute and the nh6 keyword to
SEG6_MOBILE_MAPPED_SID/mapped_sid to match the RFC 9433 "mapped
SID" wording and avoid clashing with the SEG6_LOCAL_NH6 nexthop
semantics.
- Trim the Kconfig help; add Assisted-by tags.
- Link to v1:
https://lore.kernel.org/r/[email protected]
---
Yuya Kusakabe (2):
seg6: add support for the SRv6 End.MAP behavior
selftests: seg6: add selftest for End.MAP behavior
include/net/seg6.h | 8 +
include/uapi/linux/lwtunnel.h | 1 +
include/uapi/linux/seg6_mobile.h | 61 ++
net/core/lwtunnel.c | 2 +
net/ipv6/Kconfig | 10 +
net/ipv6/Makefile | 1 +
net/ipv6/seg6.c | 7 +
net/ipv6/seg6_mobile.c | 701 +++++++++++++++++++++++
tools/testing/selftests/net/.gitignore | 1 +
tools/testing/selftests/net/Makefile | 2 +
tools/testing/selftests/net/config | 1 +
tools/testing/selftests/net/srv6_end_map_test.sh | 400 +++++++++++++
tools/testing/selftests/net/srv6_mobile_send.c | 262 +++++++++
13 files changed, 1457 insertions(+)
---
base-commit: 87b80c2f6b05cad9f0ff9136709c62a0f59923e3
change-id: 20260523-seg6-mobile-end-map-9cec24191817
Best regards,
--
Yuya Kusakabe <[email protected]>