Skip to content

controller: make MaxUserTunnelSlots configurable via flag#3751

Open
nikw9944 wants to merge 4 commits into
mainfrom
nikw9944/doublezero-3745
Open

controller: make MaxUserTunnelSlots configurable via flag#3751
nikw9944 wants to merge 4 commits into
mainfrom
nikw9944/doublezero-3745

Conversation

@nikw9944
Copy link
Copy Markdown
Contributor

@nikw9944 nikw9944 commented May 21, 2026

Summary of Changes

  • Add --max-user-tunnel-slots CLI flag on the controller to override the per-device user-tunnel slot count at runtime (default remains 128).
  • Rename the package constant MaxUserTunnelSlotsDefaultMaxUserTunnelSlots to make the override path explicit; update all internal callers (controller, e2e tests).
    Resolves: controller: make MaxUserTunnelSlots configurable via flag/config #3745

Diff Breakdown

Category Files Lines (+/-) Net
Tests 6 +117 / -27 +90
Core logic 2 +33 / -20 +13
Scaffolding 2 +22 / -16 +6
Docs 1 +2 / -0 +2
Total 11 +174 / -63 +111

Testing Verification

  • New unit tests in server_test.go

@nikw9944 nikw9944 marked this pull request as ready for review May 21, 2026 22:59
@nikw9944 nikw9944 requested a review from elitegreg May 22, 2026 14:02
@nikw9944 nikw9944 force-pushed the nikw9944/doublezero-3745 branch 2 times, most recently from 1fb63f2 to d22dcf9 Compare May 22, 2026 16:04
nikw9944 added 3 commits May 22, 2026 17:01
Add --max-user-tunnel-slots CLI flag to override the per-device user
tunnel slot count at runtime. The package constant MaxUserTunnelSlots
is renamed DefaultMaxUserTunnelSlots and supplies the default (128);
NewController validates 1 <= n <= 1024 (Arista EOS hard cap) and returns
ErrInvalidMaxUserTunnelSlots otherwise. NewDevice takes the slot count
as a parameter rather than reading the package constant.

Enables the GRE Tunnel Capacity Study stress controller (tracker #3744)
to render up to 1024 slots end-to-end without touching production code
paths. No onchain or wire-format changes.

Fixes #3745
- errors.Is in TestMaxUserTunnelSlotsOption so future error wrapping
  in NewController stays compatible
- ErrInvalidMaxUserTunnelSlots is now a bare sentinel; NewController
  wraps it with fmt.Errorf to include the offending value
- WithMaxUserTunnelSlots godoc notes validation timing
- NewDevice godoc states the tunnelSlots precondition

Refs #3745
- drop the upper-bound hard cap; only require a positive integer
- remove block comments on NewDevice and WithMaxUserTunnelSlots
- shorten CHANGELOG entry

Refs #3745
@nikw9944 nikw9944 force-pushed the nikw9944/doublezero-3745 branch from d22dcf9 to a493e06 Compare May 22, 2026 17:01
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.

controller: make MaxUserTunnelSlots configurable via flag/config

2 participants