Skip to content

Commit faf89eb

Browse files
committed
[minigraph] remove number of lanes check for changing speed from 400G to 100G and set speed setting before lane reconfiguration (sonic-net#15721)
8111 800G interface, split to 2x400G (each has 4 lanes) fails to change interface speed from 400G to 100G during deploy mg. In minigraph.xml, the interface speed configuration is good, but fails to generate the right value to config_db.json. In order to support this SKU the speed transitioning should support both 4 lanes and 8 lanes in the port_config.ini. Why I did it before this change for a 400G to 100G transition, in all cases except when lanes are 8, we would continue and the line ports.setdefault(port_name, {})['speed'] = port_speed_png[port_name] would not be executed, hence the default speed will never be set for a case and config_db will not be updated, where speed is transitioning from 400G to 100G or 40G, but lanes are not equal to 8. In order for those cases to pass where lanes are not specifically 8, we need the change Work item tracking 24242657 Signed-off-by: vaibhav-dahiya <[email protected]>
1 parent d032586 commit faf89eb

File tree

4 files changed

+2499
-11
lines changed

4 files changed

+2499
-11
lines changed

src/sonic-config-engine/minigraph.py

+12-11
Original file line numberDiff line numberDiff line change
@@ -1688,18 +1688,19 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
16881688
port_default_speed = port_speeds_default.get(port_name, None)
16891689
port_png_speed = port_speed_png[port_name]
16901690

1691-
if switch_type == 'voq':
1692-
# when the port speed is changes from 400g to 100g
1693-
# update the port lanes, use the first 4 lanes of the 400G port to support 100G port
1694-
if port_default_speed == '400000' and port_png_speed == '100000':
1695-
port_lanes = ports[port_name].get('lanes', '').split(',')
1696-
# check if the 400g port has only 8 lanes
1697-
if len(port_lanes) != 8:
1698-
continue
1699-
updated_lanes = ",".join(port_lanes[:4])
1700-
ports[port_name]['lanes'] = updated_lanes
1691+
# set Port Speed before lane update
1692+
ports.setdefault(port_name, {})['speed'] = port_png_speed
1693+
1694+
# when the port speed is changes from 400g to 100g/40g
1695+
# update the port lanes, use the first 4 lanes of the 400G port to support 100G/40G port
1696+
if port_default_speed == '400000' and (port_png_speed == '100000' or port_png_speed == '40000'):
1697+
port_lanes = ports[port_name].get('lanes', '').split(',')
1698+
# check if the 400g port has only 8 lanes
1699+
if len(port_lanes) != 8:
1700+
continue
1701+
updated_lanes = ",".join(port_lanes[:4])
1702+
ports[port_name]['lanes'] = updated_lanes
17011703

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

17041705
for port_name, port in list(ports.items()):
17051706
# get port alias from port_config.ini

0 commit comments

Comments
 (0)