[minigraph.py]: Enable 400G to 100G/40G speed change via minigraph for all platforms (#14736)

There are chassis-packet and Single asic platforms which support this 400G to 100G/40G speed change via config.
Enabling this feature for all platforms which can support this. Keeping it enabled for all does not affect the platforms
which do not support this feature yet.

Signed-off-by: anamehra anamehra@cisco.com
This commit is contained in:
anamehra 2023-05-05 13:52:40 -07:00 committed by GitHub
parent 50fb266c16
commit ab7bcb43b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]