Support declared breakout_mode - #2568
Draft
ideaship wants to merge 1 commit into
Draft
Conversation
9 tasks
berendt
force-pushed
the
sonic-e2e-v2-breakout-declared
branch
from
August 5, 2026 15:10
c345a67 to
15e11df
Compare
ideaship
force-pushed
the
sonic-e2e-v2-breakout-declared
branch
from
August 5, 2026 19:51
15e11df to
9e46638
Compare
berendt
force-pushed
the
sonic-e2e-v2-breakout-declared
branch
from
August 6, 2026 10:56
9e46638 to
d6432c9
Compare
ideaship
force-pushed
the
sonic-e2e-v2-breakout-declared
branch
from
August 6, 2026 12:10
d6432c9 to
26aa4fc
Compare
Give SONiC breakout detection an explicit, authoritative signal instead of inferring breakout structure from incidental NetBox artifacts. A device-level custom field sonic_parameters.breakout maps a master port (NetBox Eth1/N or canonical EthernetN, normalized via the hwsku port_config) to a mode string NxSpeedG. When a declaration is present for a resolvable master it is authoritative and fail-closed: the master is claimed into suppressed_masters before validation, so the inference path is suppressed for it even when the declared mode is invalid or two keys collide. The mode is validated structurally against the port_config lane count (L % N == 0); children and their exact per-child lane slices are computed from the mode (fixing 2x*/8x* which the count-based inference never handled), the physical port comes from the port_config index (correct on mixed-lane platforms), and config_generator uses the declared per-child speed and lanes ahead of any NetBox-derived value. Absent a breakout map, behaviour is unchanged by construction: the declared pass no-ops, suppressed_masters stays empty, and the inference branches (which only consult the set, never populate it) and their existing dedup are untouched. Structural validation only; the platform (platform.json) may still reject a structurally-valid mode. Adds unit coverage for the parsers, the resolver, mode emission across 4x/2x/8x/4x100G, key normalization, mixed-layout port index, collision and invalid/unresolvable/single-lane/malformed declarations, and the declared-child downstream precedence. Adds a third device, e2e-breakout-declared, to the SONiC E2E golden test: an Accton-AS9726-32D leaf carrying an authoritative sonic_parameters.breakout map with no sub-ports modelled in NetBox, so the committed golden proves the declared-mode path end to end rather than the inference fallback. It declares three splits on the 8-lane platform -- Ethernet0 4x100G, Ethernet8 2x50G, and physical key Eth1/9 (Ethernet64) 8x50G -- exercising key normalization, the 2x/8x cases count-based inference never handled, and the mixed-lane port_config index. This adds no new config_db table; coverage stays at 32 of 38 and the golden is the assertion that the new code path works. Regenerating on a fresh stack left the six existing goldens byte-unchanged. The declared path needs the same protection the detected paths now have. A declared breakout names its children after the master's lane offsets, so on Accton-AS7726-32X a 4x declaration on Ethernet124 would claim Ethernet125 and Ethernet126 -- two independent 10G SFP+ ports -- and silently rewrite their lanes, speed and alias, because a breakout_ports entry is authoritative for a port's lanes and speed. 2x50G collides the same way, on Ethernet126 alone. Reuse _breakout_child_collisions() and refuse before mutating anything, leaving BREAKOUT_CFG unset so the master stays an ordinary port and the declaration is dropped whole rather than half-applied. Tests cover both directions against the real shipped .ini via the existing real_port_config fixture. Assisted-by: Claude:claude-sonnet-5 Signed-off-by: Roger Luethi <luethi@osism.tech>
ideaship
force-pushed
the
sonic-e2e-v2-breakout-declared
branch
from
August 6, 2026 12:19
26aa4fc to
6016efe
Compare
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.
Part of the series tracked in #2562, which explains the ordering and what each PR covers. Based on the preceding PR in the stack, so review only the top commits here.
The only PR in the series that changes generator behaviour rather than adding
coverage: support for an authoritative device-level
sonic_parameters.breakoutmap, pinning the explicit-declaration path rather than the inference fallback.
It also extends the collision guard from #2560 to this new path. A declared
breakout names its children after the master's lane offsets, so on
Accton-AS7726-32X a 4x declaration on Ethernet124 would claim Ethernet125 and
Ethernet126 — two independent 10G SFP+ ports — and silently rewrite their lanes,
speed and alias. It reuses
_breakout_child_collisions()and thereal_port_configfixture that PR already put on main, rather than adding itsown copies.