Gate SONiC EthernetN breakout on port topology#2497
Merged
Conversation
The loose SONiC-name breakout path treats any four consecutive
EthernetN interfaces at <=50G as a 4xNG breakout without consulting
the port_config topology. Unifying breakout mode selection widened
this path to also emit 4x10G (via BREAKOUT_MODE_BY_SPEED), so a switch
whose native low-speed ports happen to be named Ethernet0..3 is now
misdetected as a breakout -- e.g. AS5835-54T (native 10G) or
DellEMC-S5212f / AS7326-56X (native 25G) fabricate a 4x10G/4x25G cage
that does not exist.
Add a topology gate on this path: accept the group as a breakout only
when the port_config confirms a single multi-lane master (Ethernet
{base}) whose intermediate lanes Ethernet{base+1..base+3} are absent
-- they materialize only when the cage is actually broken out. Four
separate single-lane entries are native ports and are now skipped.
Unlike the EthX/Y/Z path, a bare EthernetN name carries no explicit
breakout signal, so the port_config is the only local evidence.
This is a necessary-not-sufficient negative filter: it removes the
known native-port false positives but cannot by itself prove breakout
intent. A follow-up will add an explicit per-port breakout_mode
declaration as the authoritative signal.
Add a regression test covering four native single-lane 25G ports.
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Roger Luethi <luethi@osism.tech>
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The new multi-lane/topology gating logic duplicates lane-handling assumptions used elsewhere (e.g., the 400G sub-path); consider extracting a shared helper for "is multi-lane master with absent intermediates" to keep this consistent and easier to update in one place.
- The new early-continue checks rely on comma-separated lane strings only; if future hwskus introduce range-form lane specs, this will silently misclassify ports, so it may be worth centralizing and normalizing lane parsing now (or at least asserting the expected format).
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new multi-lane/topology gating logic duplicates lane-handling assumptions used elsewhere (e.g., the 400G sub-path); consider extracting a shared helper for "is multi-lane master with absent intermediates" to keep this consistent and easier to update in one place.
- The new early-continue checks rely on comma-separated lane strings only; if future hwskus introduce range-form lane specs, this will silently misclassify ports, so it may be worth centralizing and normalizing lane parsing now (or at least asserting the expected format).Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
ideaship
marked this pull request as draft
July 21, 2026 05:43
ideaship
marked this pull request as ready for review
July 21, 2026 06:28
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.
Follow-up to the unified breakout mode selection.
Problem
The loose SONiC-name breakout path treats any four consecutive
EthernetNinterfaces at <=50G as a 4xNG breakout without consulting the
port_configtopology. Unifying breakout mode selection routed this path through
BREAKOUT_MODE_BY_SPEED, which newly enables4x10Ghere — so a switch whosenative low-speed ports happen to be named
Ethernet0..3is now misdetectedas a breakout. For example AS5835-54T (native 10G) or DellEMC-S5212f /
AS7326-56X (native 25G) fabricate a
4x10G/4x25Gcage that does not exist.Change
Add a topology gate on this path: accept the group as a breakout only when
port_configconfirms a single multi-lane master (Ethernet{base}) whoseintermediate lanes
Ethernet{base+1..base+3}are absent — they onlymaterialize when the cage is actually broken out. Four separate single-lane
entries are native ports and are now skipped.
BREAKOUT_MODE_BY_SPEEDis untouched(the NetBox
EthX/Y/Zpath legitimately needs its10Gentry).Scope / known limitations
native-port false positives but cannot by itself prove breakout intent. A
planned follow-up will add an explicit per-port
breakout_modedeclaration asthe authoritative signal (making the bare-
EthernetNpath safe withoutinference).
detection sites (the offset-multiplier logic and the 400G path). Range-form
lane specs (
1-4) are not used by any bundled hwsku; normalizing lane parsingacross all detection sites is deliberately left as a separate change.
Related:
🤖 Generated with Claude Code