Skip to content

Commit 865f196

Browse files
authored
[Mellanox] Add new SN5640 platform and HwSKU (sonic-net#3742)
- What I did Add support for Mellanox SN5640 new platform and hwSKUs - How I did it Add new files and folders to support the new platform and modified relevant existing files - How to verify it Install image with the change on Mellanox SN5640 setup and run tests
1 parent 5fa8502 commit 865f196

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

generic_config_updater/field_operation_validators.py

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def get_asic_name():
3636
spc2_hwskus = asic_mapping["mellanox_asics"]["spc2"]
3737
spc3_hwskus = asic_mapping["mellanox_asics"]["spc3"]
3838
spc4_hwskus = asic_mapping["mellanox_asics"]["spc4"]
39+
spc5_hwskus = asic_mapping["mellanox_asics"]["spc5"]
3940
if hwsku.lower() in [spc1_hwsku.lower() for spc1_hwsku in spc1_hwskus]:
4041
asic = "spc1"
4142
return asic
@@ -48,6 +49,9 @@ def get_asic_name():
4849
if hwsku.lower() in [spc4_hwsku.lower() for spc4_hwsku in spc4_hwskus]:
4950
asic = "spc4"
5051
return asic
52+
if hwsku.lower() in [spc5_hwsku.lower() for spc5_hwsku in spc5_hwskus]:
53+
asic = "spc5"
54+
return asic
5155
if asic_type == 'broadcom' or asic_type == 'vs':
5256
broadcom_asics = asic_mapping["broadcom_asics"]
5357
for asic_shorthand, hwskus in broadcom_asics.items():

generic_config_updater/gcu_field_operation_validators.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"spc3": [ "ACS-MSN4700", "ACS-MSN4600", "ACS-MSN4600C", "ACS-MSN4410", "ACS-SN4280", "Mellanox-SN4600C-D112C8", "Mellanox-SN4600C-C64", "Mellanox-SN4700-O8C48", "Mellanox-SN4600C-D100C12S2", "Mellanox-SN4600C-D48C40","Mellanox-SN4700-O32","Mellanox-SN4700-V64",
2424
"Mellanox-SN4700-A96C8V8", "Mellanox-SN4700-C128", "Mellanox-SN4700-O28", "Mellanox-SN4700-O8V48", "Mellanox-SN4700-V48C32", "Mellanox-SN4280-O28"],
2525
"spc4": [ "ACS-SN5600", "Mellanox-SN5600-O128", "Mellanox-SN5600-V256", "Mellanox-SN5600-C256S1", "ACS-SN5400", "Mellanox-SN5600-C224O8", "Mellanox-SN5610N-C256S2", "Mellanox-SN5610N-C224O8" ],
26-
"spc5": ["ACS-SN5640"]
26+
"spc5": ["ACS-SN5640", "Mellanox-SN5640-C512S2", "Mellanox-SN5640-C448O16" ]
2727
},
2828
"broadcom_asics": {
2929
"th": [ "Force10-S6100", "Arista-7060CX-32S-C32", "Arista-7060CX-32S-C32-T1", "Arista-7060CX-32S-D48C8", "Celestica-DX010-C32", "Seastone-DX010" ],

tests/generic_config_updater/field_operation_validator_test.py

+8
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,14 @@ def test_get_asic_spc4(self, mock_popen, mock_get_sonic_version_info):
425425
mock_popen.return_value.communicate.return_value = ["Mellanox-SN2700-A1", 0]
426426
self.assertEqual(fov.get_asic_name(), "spc1")
427427

428+
@patch('sonic_py_common.device_info.get_sonic_version_info')
429+
@patch('subprocess.Popen')
430+
def test_get_asic_spc5(self, mock_popen, mock_get_sonic_version_info):
431+
mock_get_sonic_version_info.return_value = {'asic_type': 'mellanox'}
432+
mock_popen.return_value = mock.Mock()
433+
mock_popen.return_value.communicate.return_value = ["Mellanox-SN5640-C512S2", 0]
434+
self.assertEqual(fov.get_asic_name(), "spc5")
435+
428436
@patch('sonic_py_common.device_info.get_sonic_version_info')
429437
@patch('subprocess.Popen')
430438
def test_get_asic_th(self, mock_popen, mock_get_sonic_version_info):

0 commit comments

Comments
 (0)