Skip to content

[Nexthop][fboss2-dev] Add fboss2-dev config ptp transparent-clock CLI command#1200

Open
vybhav-nexthop wants to merge 1 commit into
facebook:mainfrom
nexthop-ai:ptp-config
Open

[Nexthop][fboss2-dev] Add fboss2-dev config ptp transparent-clock CLI command#1200
vybhav-nexthop wants to merge 1 commit into
facebook:mainfrom
nexthop-ai:ptp-config

Conversation

@vybhav-nexthop
Copy link
Copy Markdown

@vybhav-nexthop vybhav-nexthop commented May 15, 2026

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

  • Adds fboss2-dev config ptp transparent-clock <enable|disable> to toggle ptpTcEnable in SwitchSettings
  • Action level: HITLESS (no agent restart required):
    • SAI path: SaiSwitch.cpp:1910–1921switchManager().setPtpTcEnabled() + portManager().setPtpTcEnable() — in-service per-port config, no link bounce
    • BCM path: BcmSwitchSettings::setPtpTc()BcmPtpTcMgr::enablePtpTc() / disablePtpTc() → iterates all ports calling bcm_port_timesync_config_set() and bcm_switch_control_port_set(bcmSwitchTimesyncEgressTimestampingMode) — live BCM SDK reconfiguration, no port re-init or link bounce; warm-boot state tracked via BcmWarmBootCache::ptpTcEnabled_
  • Parent branch node config ptp follows the same pattern as config l2

Files

New:

  • commands/config/ptp/CmdConfigPtp.{h,cpp} — parent branch node
  • commands/config/ptp/transparent_clock/CmdConfigPtpTransparentClock.{h,cpp} — leaf handler
  • test/config/CmdConfigPtpTransparentClockTest.cpp — unit tests (arg validation + queryClient)
  • test/integration_test/ConfigPtpTest.cpp — E2E toggle + idempotency tests

Modified: CmdListConfig.cpp, cmake/CliFboss2.cmake, cmake/CliFboss2TestConfig.cmake, cmake/CliFboss2TestIntegrationTest.cmake, fboss2/BUCK, test/config/BUCK, test/integration_test/BUCK

Test plan

  • Unit tests: CmdConfigPtpTransparentClockTest (arg validation, enable/disable transitions, already-enabled/already-disabled symmetric no-op cases)
213/926 Test #213: CmdConfigPtpTransparentClockTestFixture.argValidation ......   Passed    0.73 sec
214/926 Test #214: CmdConfigPtpTransparentClockTestFixture.disableWhenEnabled .   Passed    0.72 sec
215/926 Test #215: CmdConfigPtpTransparentClockTestFixture.enableWhenDisabled .   Passed    0.71 sec
216/926 Test #216: CmdConfigPtpTransparentClockTestFixture.alreadyEnabled .....   Passed    0.71 sec
  • Integration test: ConfigPtpTest.ToggleTransparentClock + ConfigPtpTest.IdempotentToggle on a DUT
[----------] 2 tests from ConfigPtpTest
[ RUN      ] ConfigPtpTest.ToggleTransparentClock
[       OK ] ConfigPtpTest.ToggleTransparentClock (127 ms)
[ RUN      ] ConfigPtpTest.IdempotentToggle
[       OK ] ConfigPtpTest.IdempotentToggle (98 ms)
[----------] 2 tests from ConfigPtpTest (225 ms total)

Implements `fboss2-dev config ptp transparent-clock <enable|disable>`
to toggle the ptpTcEnable field in SwitchSettings. The change is
HITLESS (no agent restart required).
@vybhav-nexthop vybhav-nexthop requested review from a team as code owners May 15, 2026 06:10
@meta-cla meta-cla Bot added the CLA Signed label May 15, 2026
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.

1 participant