Skip to content

[Cisco][fboss2] Add CLI support for SRv6 tunnels - #1970

Closed
prapty wants to merge 3 commits into
meta:mainfrom
prapty:srv6-tunnel-cli
Closed

prapty wants to merge 3 commits into
meta:mainfrom
prapty:srv6-tunnel-cli

Conversation

@prapty

@prapty prapty commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Pre-submission checklist

  • I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running pip install -r requirements-dev.txt && pre-commit install
  • pre-commit run

Summary

Add fboss2 commands to create, update, and delete SRv6 encap and decap tunnel configuration through the standard FBOSS config session.

The new commands validate tunnel identifiers and attributes, preserve unspecified fields during partial updates, prevent changing an existing tunnel between encap and decap, enforce the single-decap-tunnel constraint, and allow selected optional fields to be reset. SRv6 encap requires an existing underlay interface and an IPv6 source address; SRv6 decap does not use an underlay interface. Changes are staged in the agent configuration at the hitless action level and can be reviewed with fboss2 config session diff before commit.

Both BUCK and CMake build definitions are updated, with unit coverage for argument validation, fresh configuration, partial updates, direction checks, optional-attribute reset, full deletion, and idempotent deletion.

SRv6 decap hardware programming remains dependent on ASIC and SDK support. Unsupported builds retain the configuration but log a warning and skip SAI decap tunnel creation. The termination-type option is persisted in SRv6 configuration and state, but it is not currently consumed by SaiSrv6TunnelManager.

Test Plan

  • pre-commit run --from-ref main --to-ref HEAD
  • Verified the BUCK and CMake additions have no file-list inconsistencies with fboss/oss/scripts/buck_cmake_dep_checker.py --check-files --check-sorted --from-commit main.
  • Built a downstream G200 FBOSS installer image with this change.
  • Validated on a Cisco C8501 / MORGAN800CC using fboss2-dev:
    • Created and committed SRv6 encap and decap tunnels.
    • Verified the generated srv6Tunnels fields in the running agent configuration.
    • Updated an encap tunnel while preserving unspecified fields.
    • Reset an optional tunnel attribute.
    • Deleted complete encap and decap tunnels.
    • Confirmed fboss_sw_agent.service remained active after each commit.
    • Confirmed committed changes with fboss2-dev show config running agent.

Replacement for #1638, which was automatically closed.

@prapty
prapty requested review from a team as code owners November 12, 2026 20:11
@meta-cla meta-cla Bot added the CLA Signed label Nov 12, 2026
@prapty prapty changed the title [Cisco] Add fboss2 CLI support for SRv6 tunnels [Cisco][fboss2] Add CLI support for SRv6 tunnels Nov 12, 2026
@github-actions github-actions Bot added cisco project:fboss2 FBOSS project: fboss2 labels Nov 12, 2026
@@ -0,0 +1,48 @@
/*

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prapty : Can you address the pre-commit action failure?
We recently enforced a new copyright header for any new cpp files. You can find out more from https://github.com/meta/fboss/actions/runs/43297841198/job/131460795732?pr=1969

@meta-codesync

meta-codesync Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@joseph5wu has imported this pull request. If you are a Meta employee, you can view this in D131864056.

@meta-codesync meta-codesync Bot closed this in 531e673 Nov 14, 2026
@meta-codesync meta-codesync Bot added the Merged label Nov 14, 2026
@meta-codesync

meta-codesync Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

@joseph5wu merged this pull request in 531e673.

@joseph5wu

Copy link
Copy Markdown
Contributor

Since this PR was originally prepared, Srv6Tunnel::underlayIntfID became optional to support decap tunnels without an underlay interface. We updated the PR to match the current schema: encap validation now checks that the optional has a value before dereferencing it, and the decap unit test verifies that the field is unset rather than expecting a default value of 0. The full config test suite passes with these updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants