Skip to content

[minigraph] remove number of lanes check for changing speed from 400G to 100G and set speed setting before lane reconfiguration #15721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/sonic-config-engine/minigraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,9 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
port_default_speed = port_speeds_default.get(port_name, None)
port_png_speed = port_speed_png[port_name]

# set Port Speed before lane update
ports.setdefault(port_name, {})['speed'] = port_png_speed

# when the port speed is changes from 400g to 100g/40g
# update the port lanes, use the first 4 lanes of the 400G port to support 100G/40G port
if port_default_speed == '400000' and (port_png_speed == '100000' or port_png_speed == '40000'):
Expand All @@ -1781,7 +1784,6 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
updated_lanes = ",".join(port_lanes[:4])
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it better to update lane map when the number of lanes is 8? Is taking first 4 lanes always right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in both cases when a port has 4 lanes or 8 lanes, if we want to transition from 400G to 100G, we need only first 4 lanes, so we are right in that regard.

ports[port_name]['lanes'] = updated_lanes

ports.setdefault(port_name, {})['speed'] = port_speed_png[port_name]

for port_name, port in list(ports.items()):
# get port alias from port_config.ini
Expand Down
Loading