Skip to content

srv6: add per-nexthop encap source address#642

Open
rjarry wants to merge 7 commits into
DPDK:mainfrom
rjarry:srv6-nh-encap-src
Open

srv6: add per-nexthop encap source address#642
rjarry wants to merge 7 commits into
DPDK:mainfrom
rjarry:srv6-nh-encap-src

Conversation

@rjarry

@rjarry rjarry commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

FRR 10.8 added a per-nexthop encapsulation source address to nexthop_add_srv6_seg6(). This series adds per-nexthop encap_src support to grout's SRv6 output nexthops and plumbs it through the FRR dplane plugin.

When an SRv6 output nexthop has an explicit encap_src set, the datapath uses it directly as the outer IPv6 source instead of the global tunnel source or the interface preferred address. An internal flags field avoids a 16-byte comparison in the hot path.

The series also updates FRR build support: bumps 10.5 to 10.5.4, adds 10.7 (rc1), and changes the default build version to 10.6.

Summary

  • Add per-nexthop SRv6 encap-src support end-to-end (CLI → control plane API structs → FRR dplane plugin → datapath encapsulation).
  • Propagate an explicit encap_src as the outer IPv6 header source; when encap_src is unspecified, fall back to the configured tunnel source / interface preferred address.
  • Extend SRv6 nexthop output state with an encap_src field plus SR_ENCAP_F_SRC presence flag, and in srv6_output_process() use the flagged encap_src directly to avoid doing a 16-byte IPv6 comparison in the datapath hot path.
  • Update SRv6 nexthop equality/import/export logic to include encap_src, setting SR_ENCAP_F_SRC only when it’s not the unspecified IPv6 address.
  • Add rte_ipv6_addr_is_unspec() helper in api/gr_net_compat.h to detect unspecified IPv6 addresses by checking all 16 bytes.
  • Update CLI parsing and display for SRv6 nexthops/seglists to accept an optional SRC parameter and to show ENCAP_SRC only when encap_src is not unspecified.
  • Extend FRR dplane SRv6 SR output nexthop handling to propagate encap_src to nexthop_add_srv6_seg6() for FRR >= 10.8.0, and populate the plugin-side encap_src from the FRR seglist source when building GR_NH_T_SR6_OUTPUT.
  • Bump API handshake version GR_API_VERSION from 3 to 4.
  • Add smoke tests validating per-nexthop encap-source behavior: smoke/srv6_test.sh and smoke/srv6_encapsrc_frr_test.sh (skips when installed FRR < 10.8.0).
  • Update FRR build/compat support: default frr_version to 10.6, add 10.7 (rc1) support, bump 10.5 wrap to 10.5.4, and adjust CI build matrix to use 10.7 for the gcc-14 aarch64 configuration.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ae35917d-3f66-4f74-a544-00094df60151

📥 Commits

Reviewing files that changed from the base of the PR and between e2e1fc7 and c903ada.

📒 Files selected for processing (14)
  • .github/workflows/check.yml
  • api/gr_api.h
  • api/gr_net_compat.h
  • frr/rt_grout.c
  • meson_options.txt
  • modules/srv6/api/gr_srv6.h
  • modules/srv6/cli/route.c
  • modules/srv6/control/route.c
  • modules/srv6/control/srv6.h
  • modules/srv6/datapath/srv6_output.c
  • smoke/srv6_encapsrc_frr_test.sh
  • smoke/srv6_test.sh
  • subprojects/frr-10.5.wrap
  • subprojects/frr-10.7.wrap
✅ Files skipped from review due to trivial changes (1)
  • subprojects/frr-10.5.wrap
🚧 Files skipped from review as they are similar to previous changes (10)
  • meson_options.txt
  • subprojects/frr-10.7.wrap
  • api/gr_api.h
  • api/gr_net_compat.h
  • modules/srv6/control/route.c
  • .github/workflows/check.yml
  • modules/srv6/datapath/srv6_output.c
  • modules/srv6/api/gr_srv6.h
  • modules/srv6/control/srv6.h
  • modules/srv6/cli/route.c

📝 Walkthrough

Walkthrough

Adds optional per-nexthop SRv6 encapsulation source handling across public and private nexthop data, CLI parsing and display, control-plane conversion, datapath header construction, and FRR route installation. Updates FRR version options, packages, and CI coverage. Adds smoke tests that configure explicit encapsulation sources and verify captured outer IPv6 source addresses.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

rjarry added 7 commits July 11, 2026 18:03
Update the FRR 10.5 wrap file to the latest bugfix release.

Signed-off-by: Robin Jarry <rjarry@redhat.com>
Add a wrap file for FRR 10.7.0-rc1 and add it to the meson build
options and CI test matrix.

Signed-off-by: Robin Jarry <rjarry@redhat.com>
FRR 10.6 has been stable for a few months now. Make it the default
build target instead of 10.5.

Signed-off-by: Robin Jarry <rjarry@redhat.com>
Allow SRv6 output nexthops to carry an explicit encapsulation source
address. When set, the datapath uses it directly as the outer IPv6
source instead of the global tunnel source or the interface preferred
address.

An internal SR_ENCAP_F_SRC flag avoids a 16-byte address comparison
in the datapath hot path.

Signed-off-by: Robin Jarry <rjarry@redhat.com>
FRR 10.8 added a per-nexthop encap source address to
nexthop_add_srv6_seg6(). Forward the encap_src field from grout SRv6
output nexthops to FRR, and copy it back when importing nexthops from
FRR.

Signed-off-by: Robin Jarry <rjarry@redhat.com>
Add a test case that creates an SRv6 output nexthop with an explicit
source address and verifies the encapsulated packets use it as the
outer IPv6 source with tcpdump.

Signed-off-by: Robin Jarry <rjarry@redhat.com>
Test that FRR 10.8 per-nexthop encap source addresses are synced
through the dplane plugin. The test configures an SRv6 route with
encap-source in FRR and verifies grout encapsulates packets with the
correct outer IPv6 source address.

Requires FRR >= 10.8, skipped on older versions.

Signed-off-by: Robin Jarry <rjarry@redhat.com>
@rjarry
rjarry force-pushed the srv6-nh-encap-src branch from e2e1fc7 to c903ada Compare July 11, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant