[Nexthop][fboss2-dev] Add fboss2-dev config arp proactive subcommand#1297
Open
vybhav-nexthop wants to merge 1 commit into
Open
[Nexthop][fboss2-dev] Add fboss2-dev config arp proactive subcommand#1297vybhav-nexthop wants to merge 1 commit into
vybhav-nexthop wants to merge 1 commit into
Conversation
vybhav-nexthop
commented
Jun 16, 2026
83ca3a8 to
356f8f0
Compare
Wire `config arp proactive [enabled|disabled]` into the existing arp config family, mutating SwitchConfig.proactiveArp. proactiveArp is declared in switch_config.thrift but is not yet consumed by the agent (no read in ApplyThriftConfig.cpp, no switch_state.thrift field), so the write is a no-op at runtime today and is applied HITLESS. The CLI is wired ahead of agent support; a code comment flags this. ## Changed files | File | Change | |------|--------| | `CmdConfigArp.cpp` | Add `proactive` to valid attrs; parse `enabled`/`disabled`; dispatch to `swConfig.proactiveArp()` | | `CmdConfigArp.h` | Add `getBoolValue()` / `boolValue_`; update `addCliArg()` help text to mention `proactive` | | `test/config/CmdConfigArpTest.cpp` | Unit tests for arg validation + `queryClient` round-trip for `proactive` | | `test/integration_test/ConfigArpTest.cpp` | Integration test: set/commit/verify round-trip via running agent config | | `test/integration_test/Fboss2IntegrationTest.h` | Add two-arg `getSwConfigField(field, default)` overload + private `getSwConfigFieldOpt<T>` helper for optional/defaulted config fields | ## Integration Test Results — NH-4010-F Ran `ConfigArpTest` suite on DUT after latest changes: ``` [==========] Running 5 tests from 1 test suite. [ PASSED ] ConfigArpTest.SetTimeout (159 ms) [ PASSED ] ConfigArpTest.SetAgeInterval (117 ms) [ PASSED ] ConfigArpTest.SetMaxProbes (118 ms) [ PASSED ] ConfigArpTest.SetStaleInterval (119 ms) [ PASSED ] ConfigArpTest.SetProactive (118 ms) [==========] 5 tests from 1 test suite ran. (633 ms total) [ PASSED ] 5 tests. ``` ## Test plan - [x] Unit test: `bazel test //fboss/cli/fboss2/test/config:CmdConfigArpTest` - [x] Integration test on DUT: `fboss2-dev config arp proactive enabled` → commit → verify `proactiveArp: true` in running config → restore ## Notes proactiveArp is not yet consumed by the agent; the integration test only proves the value round-trips through the config (set → commit → read back), not that proactive ARP behavior changes.
356f8f0 to
a9b0d45
Compare
Contributor
|
@vybhav-nexthop Let's abandon this PR since this cc: @benoit-nexthop |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit installpre-commit runSummary
fboss2-dev config arp proactive [enabled|disabled]to the existingconfig arpcommand familySwitchConfig.proactiveArp(declared inswitch_config.thrift) and persists viaHITLESSconfig save — no agent restart requiredproactiveArpis not yet consumed by the agent (ApplyThriftConfig.cpphas no read,switch_state.thrifthas no corresponding field); the CLI is wired ahead of agent support. A code comment flags this explicitly.Changed files
CmdConfigArp.cppproactiveto valid attrs; parseenabled/disabled; dispatch toswConfig.proactiveArp()CmdConfigArp.hgetBoolValue()/boolValue_; updateaddCliArg()help text to mentionproactivetest/config/CmdConfigArpTest.cppqueryClientround-trip forproactivetest/integration_test/ConfigArpTest.cpptest/integration_test/Fboss2IntegrationTest.hgetSwConfigField(field, default)overload + privategetSwConfigFieldOpt<T>helper for optional/defaulted config fieldsFboss2IntegrationTest.hrefactoricmpV4UnavailableSrcAddressis optional in the agent config — devices that have never configured it have no entry in the JSON. The integration test needs to read the field with a fallback to the agent's implicit default (192.0.0.8) when absent.To support this without duplicating the type-dispatch logic (
bool/int/string/double), the existinggetSwConfigFieldis refactored:getSwConfigFieldOpt<T>helper does the actual field lookup and type conversion, returningstd::optional<T>.getSwConfigFielddelegates to it and throws whennullopt(required fields — existing callers unaffected).nullopt(optional fields).Integration Test Results — NH-4010-F
Ran
ConfigArpTestsuite on DUT after latest changes:Test plan
bazel test //fboss/cli/fboss2/test/config:CmdConfigArpTestfboss2-dev config arp proactive enabled→ commit → verifyproactiveArp: truein running config → restoreNotes
proactiveArpis not yet consumed by the agent; the integration test onlyproves the value round-trips through the config (set → commit → read back),
not that proactive ARP behavior changes.
Review Findings
Pre-publication review (3 correctness angles × 7 candidates, 1-vote verify).
Issues found and fixed before push:
result.empty()fallback inqueryClientreplaced with explicit result assignment per branch (eliminates latentgetValue()trap for future boolean attrs)Fboss2IntegrationTest.h: single-arggetSwConfigFieldrestored to inline form with distinct "missing 'sw' object" vs "missing field" error messagesEXPECT_THROWunit tests forgetValue()/getBoolValue()cross-kind accessor guardsNo issues above confidence threshold remain.