Skip to content

Commit 6833e6c

Browse files
authored
Support Mellanox Spectrum4 ASIC in generic configuration update (#3018)
* Support Mellanox Spectrum4 ASIC in generic configuration update --------- Signed-off-by: Stephen Sun <[email protected]>
1 parent ae22a17 commit 6833e6c

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

generic_config_updater/field_operation_validators.py

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def get_asic_name():
3434
spc1_hwskus = asic_mapping["mellanox_asics"]["spc1"]
3535
spc2_hwskus = asic_mapping["mellanox_asics"]["spc2"]
3636
spc3_hwskus = asic_mapping["mellanox_asics"]["spc3"]
37+
spc4_hwskus = asic_mapping["mellanox_asics"]["spc4"]
3738
if hwsku.lower() in [spc1_hwsku.lower() for spc1_hwsku in spc1_hwskus]:
3839
asic = "spc1"
3940
return asic
@@ -43,6 +44,9 @@ def get_asic_name():
4344
if hwsku.lower() in [spc3_hwsku.lower() for spc3_hwsku in spc3_hwskus]:
4445
asic = "spc3"
4546
return asic
47+
if hwsku.lower() in [spc4_hwsku.lower() for spc4_hwsku in spc4_hwskus]:
48+
asic = "spc4"
49+
return asic
4650
if asic_type == 'broadcom' or asic_type == 'vs':
4751
broadcom_asics = asic_mapping["broadcom_asics"]
4852
for asic_shorthand, hwskus in broadcom_asics.items():

generic_config_updater/gcu_field_operation_validators.conf.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"mellanox_asics": {
2020
"spc1": [ "ACS-MSN2700", "ACS-MSN2740", "ACS-MSN2100", "ACS-MSN2410", "ACS-MSN2010", "Mellanox-SN2700", "Mellanox-SN2700-D48C8" ],
2121
"spc2": [ "ACS-MSN3800", "Mellanox-SN3800-D112C8" ],
22-
"spc3": [ "ACS-MSN4700", "ACS-MSN4600", "ACS-MSN4600C", "ACS-MSN4410", "Mellanox-SN4600C-D112C8", "Mellanox-SN4600C-C64", "Mellanox-SN4700-O8C48" ]
22+
"spc3": [ "ACS-MSN4700", "ACS-MSN4600", "ACS-MSN4600C", "ACS-MSN4410", "Mellanox-SN4600C-D112C8", "Mellanox-SN4600C-C64", "Mellanox-SN4700-O8C48" ],
23+
"spc4": [ "ACS-SN5600"]
2324
},
2425
"broadcom_asics": {
2526
"th": [ "Force10-S6100", "Arista-7060CX-32S-C32", "Arista-7060CX-32S-C32-T1", "Arista-7060CX-32S-D48C8", "Celestica-DX010-C32", "Seastone-DX010" ],
@@ -47,6 +48,7 @@
4748
"spc1": "20181100",
4849
"spc2": "20191100",
4950
"spc3": "20220500",
51+
"spc4": "20221100",
5052
"td2": "20181100",
5153
"th": "20181100",
5254
"th2": "20181100",
@@ -72,6 +74,7 @@
7274
"spc1": "20191100",
7375
"spc2": "20191100",
7476
"spc3": "20220500",
77+
"spc4": "20221100",
7578
"td2": "",
7679
"th": "20221100",
7780
"th2": "20221100",
@@ -95,6 +98,7 @@
9598
"spc1": "20181100",
9699
"spc2": "20191100",
97100
"spc3": "20220500",
101+
"spc4": "20221100",
98102
"td2": "20181100",
99103
"th": "20181100",
100104
"th2": "20181100",
@@ -111,6 +115,7 @@
111115
"spc1": "20191100",
112116
"spc2": "20191100",
113117
"spc3": "20220500",
118+
"spc4": "20221100",
114119
"td2": "",
115120
"th": "20221100",
116121
"th2": "20221100",
@@ -136,6 +141,7 @@
136141
"spc1": "20181100",
137142
"spc2": "20191100",
138143
"spc3": "20220500",
144+
"spc4": "20221100",
139145
"td2": "20181100",
140146
"th": "20181100",
141147
"th2": "20181100",

tests/generic_config_updater/field_operation_validator_test.py

+8
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,14 @@ def test_get_asic_spc3(self, mock_popen, mock_get_sonic_version_info):
214214
mock_popen.return_value.communicate.return_value = ["Mellanox-SN4600C-C64", 0]
215215
self.assertEqual(fov.get_asic_name(), "spc3")
216216

217+
@patch('sonic_py_common.device_info.get_sonic_version_info')
218+
@patch('subprocess.Popen')
219+
def test_get_asic_spc4(self, mock_popen, mock_get_sonic_version_info):
220+
mock_get_sonic_version_info.return_value = {'asic_type': 'mellanox'}
221+
mock_popen.return_value = mock.Mock()
222+
mock_popen.return_value.communicate.return_value = ["ACS-SN5600", 0]
223+
self.assertEqual(fov.get_asic_name(), "spc4")
224+
217225
@patch('sonic_py_common.device_info.get_sonic_version_info')
218226
@patch('subprocess.Popen')
219227
def test_get_asic_th(self, mock_popen, mock_get_sonic_version_info):

0 commit comments

Comments
 (0)