diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 550b17a5b6..09a1102fc4 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -1709,18 +1709,15 @@ 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] - # Add a check for for voq, T1 - if results['DEVICE_METADATA']['localhost']['type'].lower() == 'leafrouter' or switch_type == 'voq': - # when the port speed is changes from 400g to 100g - # update the port lanes, use the first 4 lanes of the 400G port to support 100G port - if port_default_speed == '400000' and port_png_speed == '100000': - port_lanes = ports[port_name].get('lanes', '').split(',') - # check if the 400g port has only 8 lanes - if len(port_lanes) != 8: - continue - updated_lanes = ",".join(port_lanes[:4]) - ports[port_name]['lanes'] = updated_lanes - + # 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'): + port_lanes = ports[port_name].get('lanes', '').split(',') + # check if the 400g port has only 8 lanes + if len(port_lanes) != 8: + continue + updated_lanes = ",".join(port_lanes[:4]) + ports[port_name]['lanes'] = updated_lanes ports.setdefault(port_name, {})['speed'] = port_speed_png[port_name]