[PATCH net-next v4 0/5] seg6: add End.X PSP flavor support and selftests

From: Hangbin Liu

Date: Thu Nov 19 2026 - 08:55:59 EST


This series adds End.X PSP flavor handling in seg6local and extends the
SRv6 selftests to cover it.

Patch 1 splits the final forwarding step out of end_flv8986_core() so
RFC8986 flavor logic can be reused outside the End path.
Patch 2 uses that to add End.X PSP support through the same
end_flv8986_core() path.
Patches 3-4 refactor the PSP selftest setup/cleanup so flavor tests can
be added more cleanly.
Patch 5 adds End.X PSP connectivity coverage and updates the selftest
policy parser to accept an explicit action field.

The goal is to make End.X PSP behavior consistent with End PSP, while
keeping the selftest structure easier to extend for later flavors.

Run all srv6 selftests on debug kernel. All passed without error.

Signed-off-by: Hangbin Liu <liuhangbin@xxxxxxxxxx>
---
Changes in v4:
- Thanks for Andrea' reviewing. All the changes are based on Andrea's suggestion
- Patch 3:
- always report on every setup error
- keep adding proxy entry __setup_rt_policy
- Patch 4:
- update commit subject and description
- defer proxy route
- defer setup_hs_lo_addr
- Patch 5:
- add helper __get_srv6_node_id() and __get_srv6_adjacent_id to get
node id and adjacent id. Remove __get_srv6_rtcfg_all_id.
- merge three __get_*_func() to one __get_func() helper
- update build_csid() to use the 2 new add helper
- __setup_rt_policy
- add a check to drop incorrect policy
- use get_rt_sid() to get the policy
- read the element once, and pass only what setup_rt_endpoints() needs
- add a check of the kernel support for End.X PSP.
- add a own SID for each adjacency
- add consumed SRH testing for End.X
- Link to v3: https://patch.msgid.link/20261112-srv6_flavors_endx-v3-0-c9177bbbd965@xxxxxxxxxx

Changes in v3:
- Rebase on Andrea's "seg6: fixes for the PSP flavor of SRv6 End"
- Update selftest to support the new SID format
- Link to v2: https://lore.kernel.org/r/20261009-srv6_flavors_endx-v2-0-56ac7f838f41@xxxxxxxxxx

Changes in v2:
- rebase on Andrea's "seg6: ensure packet data is writable before modifying SRH and IPv6 DA"
- Patch 2: Update end_flv8986_core() comment for End.X
- Patch 3: Move ret check in this patch
- Patch 4: Do not remove noflv route
- Link to v1: https://lore.kernel.org/r/20260922-srv6_flavors_endx-v1-0-4d01c05c47b7@xxxxxxxxxx

---
Hangbin Liu (5):
seg6: split final End process out of flavor processing
seg6: add RFC8986 flavor support for End.X
selftests: seg6: move SRv6 End PSP setup into its own helper
selftests: seg6: explicit cleanup for SRv6 End PSP test
selftests: seg6: add PSP flavor testing for SRv6 End.X

net/ipv6/seg6_local.c | 31 +-
.../testing/selftests/net/srv6_end_flavors_test.sh | 408 +++++++++++++++++----
2 files changed, 365 insertions(+), 74 deletions(-)
---
base-commit: c88fd6989aea9237a60a4859139a265bfb7ddc0b
change-id: 20260922-srv6_flavors_endx-9489116d50c4

Best regards,
--
Hangbin Liu <liuhangbin@xxxxxxxxxx>