Skip to content

Commit

Permalink
Update sonic-utilities to support new SKU Mellanox-SN5600-O128 (#3236)
Browse files Browse the repository at this point in the history
This is to back port PR #3236 to 202311 branch

Update sonic-utilities to support new SKU Mellanox-SN5600-O128

1. Add the SKU to the generic configuration updater
2. Simplify the logic of the buffer migrator to support the new SKU

Manual and unit tests
  • Loading branch information
stephenxs committed May 6, 2024
1 parent d52dc8e commit 4167876
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"spc2": [ "ACS-MSN3800", "Mellanox-SN3800-D112C8", "ACS-MSN3420", "ACS-MSN3700C", "ACS-MSN3700", "Mellanox-SN3800-C64", "Mellanox-SN3800-D100C12S2", "Mellanox-SN3800-D24C52", "Mellanox-SN3800-D28C49S1", "Mellanox-SN3800-D28C50" ],
"spc3": [ "ACS-MSN4700", "ACS-MSN4600", "ACS-MSN4600C", "ACS-MSN4410", "Mellanox-SN4600C-D112C8", "Mellanox-SN4600C-C64", "Mellanox-SN4700-O8C48", "Mellanox-SN4600C-D100C12S2", "Mellanox-SN4600C-D48C40",
"Mellanox-SN4700-A96C8V8", "Mellanox-SN4700-C128", "Mellanox-SN4700-O28", "Mellanox-SN4700-O8V48", "Mellanox-SN4700-V48C32"],
"spc4": [ "ACS-SN5600"]
"spc4": [ "ACS-SN5600", "Mellanox-SN5600-O128"]
},
"broadcom_asics": {
"th": [ "Force10-S6100", "Arista-7060CX-32S-C32", "Arista-7060CX-32S-C32-T1", "Arista-7060CX-32S-D48C8", "Celestica-DX010-C32", "Seastone-DX010" ],
Expand Down
9 changes: 4 additions & 5 deletions scripts/mellanox_buffer_migrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,9 @@ def __init__(self, configDB, appDB, stateDB):
self.spc2_platforms = ["x86_64-mlnx_msn3700-r0", "x86_64-mlnx_msn3700c-r0"]
self.spc3_platforms = ["x86_64-mlnx_msn4600-r0", "x86_64-mlnx_msn4600c-r0", "x86_64-mlnx_msn4700-r0"]

msftskus = ["Mellanox-SN2700", "Mellanox-SN2700-C28D8", "Mellanox-SN2700-D48C8", "Mellanox-SN2700-D40C8S8",
"Mellanox-SN3800-C64", "Mellanox-SN3800-D24C52", "Mellanox-SN3800-D112C8", "Mellanox-SN3800-D28C50"]
dynamic_model_skus = ["Mellanox-SN5600-O128"]

self.is_msft_sku = self.sku in msftskus
self.is_default_traditional_model = self.sku and self.sku.startswith("Mellanox-") and not self.sku in dynamic_model_skus

self.pending_update_items = list()
self.default_speed_list = ['1000', '10000', '25000', '40000', '50000', '100000', '200000', '400000']
Expand Down Expand Up @@ -822,7 +821,7 @@ def mlnx_flush_new_buffer_configuration(self):
if not self.ready:
return True

if not self.is_buffer_config_default and not self.is_buffer_config_empty or self.is_msft_sku:
if not self.is_buffer_config_default and not self.is_buffer_config_empty or self.is_default_traditional_model:
log.log_notice("No item pending to be updated")
metadata = self.configDB.get_entry('DEVICE_METADATA', 'localhost')
metadata['buffer_model'] = 'traditional'
Expand All @@ -840,7 +839,7 @@ def mlnx_flush_new_buffer_configuration(self):
return True

def mlnx_is_buffer_model_dynamic(self):
return self.is_buffer_config_default and not self.is_msft_sku
return self.is_buffer_config_default and not self.is_default_traditional_model

def mlnx_reorganize_buffer_tables(self, buffer_table, name):
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"VERSIONS|DATABASE": {
"VERSION": "version_3_0_3"
},
"DEVICE_METADATA|localhost": {
"synchronous_mode": "enable",
"docker_routing_config_mode": "separated",
"platform": "x86_64-nvidia_sn5600-r0",
"hwsku": "Mellanox-SN5600-O128"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"DEVICE_METADATA|localhost": {
"platform": "x86_64-nvidia_sn5600-r0",
"hwsku": "Mellanox-SN5600-O128"
}
}
1 change: 1 addition & 0 deletions tests/db_migrator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def check_appl_db(self, result, expected):
['empty-config',
'empty-config-with-device-info-generic',
'empty-config-with-device-info-traditional',
'empty-config-with-device-info-nvidia',
'non-default-config',
'non-default-xoff',
'non-default-lossless-profile-in-pg',
Expand Down

0 comments on commit 4167876

Please sign in to comment.