Skip to content

Unify SONiC breakout mode selection across name formats#2488

Merged
ideaship merged 1 commit into
mainfrom
unify-sonic-breakout-mode-selection
Jul 20, 2026
Merged

Unify SONiC breakout mode selection across name formats#2488
ideaship merged 1 commit into
mainfrom
unify-sonic-breakout-mode-selection

Conversation

@berendt

@berendt berendt commented Jul 18, 2026

Copy link
Copy Markdown
Member

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

🤖 Generated with Claude Code

https://claude.ai/code/session_016mkKSzFNC2UsAfgyQqTJxw

@berendt
berendt requested a review from ideaship July 18, 2026 19:02
@berendt berendt moved this from New to Ready for review in Human Board Jul 18, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • 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.
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.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@berendt
berendt force-pushed the unify-sonic-breakout-mode-selection branch from 7910c07 to ac45237 Compare July 18, 2026 19:06
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
berendt force-pushed the unify-sonic-breakout-mode-selection branch from ac45237 to 97c18d1 Compare July 18, 2026 19:08
@ideaship
ideaship merged commit b8136eb into main Jul 20, 2026
3 checks passed
@ideaship
ideaship deleted the unify-sonic-breakout-mode-selection branch July 20, 2026 20:54
@github-project-automation github-project-automation Bot moved this from Ready for review to Done in Human Board Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[bug] SONiC Interface Speed to Breakout Mode conversion handled differently

3 participants