Commit 1cdf344
committed
[device/nvidia-bluefield]: Fix brkout mode in platform/vs/docker-sonic-vs/platform-nvda-bf.json (sonic-net#113)
Why I did it
We will use the following command to generate the config_db.json. But the default_brkout_mode should fully equal than what was declared in the platform file, hwsku.json. Otherwise it will raise the following exception.
sonic-cfggen -p /usr/share/sonic/device/x86_64-kvm_x86_64-r0/platform-nvda-bf.json -k Nvidia-MBF2H536C --print-data
Traceback (most recent call last):
File "/usr/local/bin/sonic-cfggen", line 454, in <module>
main()
File "/usr/local/bin/sonic-cfggen", line 314, in main
(ports, _, _) = get_port_config(hwsku, platform, args.port_config, asic_id)
File "/usr/local/lib/python3.7/dist-packages/portconfig.py", line 139, in get_port_config
return parse_platform_json_file(hwsku_json_file, port_config_file)
File "/usr/local/lib/python3.7/dist-packages/portconfig.py", line 354, in parse_platform_json_file
child_ports = get_child_ports(intf, brkout_mode, platform_json_file)
File "/usr/local/lib/python3.7/dist-packages/portconfig.py", line 327, in get_child_ports
mode_handler = BreakoutCfg(interface, breakout_mode, port_dict[INTF_KEY][interface])
File "/usr/local/lib/python3.7/dist-packages/portconfig.py", line 255, in __init__
raise RuntimeError("Unsupported breakout mode {}!".format(bmode))
RuntimeError: Unsupported breakout mode 1x100G!
How I did it
Add breakout_modes in platform-nvda-bf.json.
How to verify it
root@850b4902a518:/# sonic-cfggen -p /usr/share/sonic/device/x86_64-kvm_x86_64-r0/platform-nvda-bf.json -k Nvidia-MBF2H536C --print-data
{
"DEVICE_METADATA": {
"localhost": {
"hwsku": "Nvidia-MBF2H536C"
}
},
"PORT": {
"Ethernet0": {
"alias": "etp1",
"lanes": "0,1,2,3",
"speed": "100000",
"index": "1"
},
"Ethernet4": {
"alias": "etp2",
"lanes": "4,5,6,7",
"speed": "100000",
"index": "2"
}
},
"BREAKOUT_CFG": {
"Ethernet0": {
"brkout_mode": "1x100G"
},
"Ethernet4": {
"brkout_mode": "1x100G"
}
}
}
Signed-off-by: Ze Gan <[email protected]>1 parent 49d6938 commit 1cdf344
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
0 commit comments