Unify SONiC breakout mode selection across name formats#2488
Merged
Conversation
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The new
BREAKOUT_MODE_BY_SPEEDdict is keyed in Mbps (e.g.10000), but the added test parametrization uses values like10_000_000, which suggests a unit mismatch between the production code and tests that should be aligned or clarified. - Since the SONiC
EthernetXpath is constrained to<= 50G, consider either constrainingBREAKOUT_MODE_BY_SPEEDto the same range or adding a short comment where it is declared to clarify why 100G/200G entries exist but are only used by the NetBox path.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new `BREAKOUT_MODE_BY_SPEED` dict is keyed in Mbps (e.g. `10000`), but the added test parametrization uses values like `10_000_000`, which suggests a unit mismatch between the production code and tests that should be aligned or clarified.
- Since the SONiC `EthernetX` path is constrained to `<= 50G`, consider either constraining `BREAKOUT_MODE_BY_SPEED` to the same range or adding a short comment where it is declared to clarify why 100G/200G entries exist but are only used by the NetBox path.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
berendt
force-pushed
the
unify-sonic-breakout-mode-selection
branch
from
July 18, 2026 19:06
7910c07 to
ac45237
Compare
detect_breakout_ports mapped subport speed to breakout mode with two independent tables: the NetBox EthX/Y/Z path supported 4x10G, 4x25G, 4x50G, 4x100G and 4x200G, while the SONiC EthernetX path only knew 4x25G and 4x50G. A 4x10G breakout of a 40G/100G port (e.g. on an Edgecore AS7726-32X) was therefore silently dropped when the interfaces are named in the SONiC format. Move the speed-to-mode table into the shared constant BREAKOUT_MODE_BY_SPEED and use it at both detection sites. The EthernetX path keeps its <= 50G group membership filter, so it now covers 4x10G, 4x25G and 4x50G; 4x100G stays with the dedicated 400G branch that matches ports spaced by two. Closes #2482 Assisted-by: Claude:claude-fable-5 Signed-off-by: Christian Berendt <berendt@osism.tech>
berendt
force-pushed
the
unify-sonic-breakout-mode-selection
branch
from
July 18, 2026 19:08
ac45237 to
97c18d1
Compare
ideaship
approved these changes
Jul 20, 2026
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.
detect_breakout_portsmapped subport speed to breakout mode with two independent tables: the NetBoxEthX/Y/Zpath supported 4x10G, 4x25G, 4x50G, 4x100G and 4x200G, while the SONiCEthernetXpath only knew 4x25G and 4x50G. A 4x10G breakout of a 40G/100G port (e.g. on an Edgecore AS7726-32X) was therefore silently dropped when the interfaces are named in the SONiC format.Move the speed-to-mode table into the shared constant
BREAKOUT_MODE_BY_SPEEDand use it at both detection sites. TheEthernetXpath keeps its <= 50G group membership filter, so it now covers 4x10G, 4x25G and 4x50G; 4x100G stays with the dedicated 400G branch that matches ports spaced by two.Closes #2482
🤖 Generated with Claude Code
https://claude.ai/code/session_016mkKSzFNC2UsAfgyQqTJxw