-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Mellanox] Update the method of reading model number for MLNX platforms #21763
base: master
Are you sure you want to change the base?
[Mellanox] Update the method of reading model number for MLNX platforms #21763
Conversation
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run Azure.sonic-buildimage |
Commenter does not have sufficient privileges for PR 21763 in repo sonic-net/sonic-buildimage |
/azp run |
Commenter does not have sufficient privileges for PR 21763 in repo sonic-net/sonic-buildimage |
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
please dont merge till @keboliu will approve it |
/azp run Azure.sonic-buildimage |
Returns: | ||
Returns True if spectrum version is higher than Spectrum-4 according to sku number | ||
""" | ||
p = subprocess.Popen(self.GET_HWSKU_CMD, universal_newlines=True, stdout=subprocess.PIPE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may be able to get this info directly from the vpd_data file(multi fields can be used: 'Part Number', 'SYS_DISPLAY', 'Platform Name', etc... ), and there is a function implemented to parse the vpd_data: https://github.com/sonic-net/sonic-buildimage/blob/master/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py#L928
root@sonic:/home/admin# cat /var/run/hw-management/eeprom/vpd_data
Part Number: MSN2700-CS2FO
Serial Number: MT2020T04244
Base MAC Address: 1c34daa19680
Manufacture Date: 05/18/2020 11:05:43
Device Version: 17
MAC Addresses: 128
SN: MT2020T04244
PN: MSN2700-CS2FO
REV: BA
MFG_DATE: 3253955
PROD_NAME: Panther Eth 100
HW_MGT_ID: 80
HW_MGT_REV: 17
SW_MGT_ID: 2700
SYS_DISPLAY: MSN2700
MAX_POWER: 0
CRIT_AMB_TEMP: 0
CRIT_IC_TEMP: 0
ALERT_AMB_TEMP: 0
ALERT_IC_TEMP: 0
FAN_DIR: 0
LENGTH: 0
WIDTH: 0
LED: 0
GUID_TYPE: 0xd
BASE_MAC_1: 1C:34:DA:A1:96:80
MAC_RANGE_1: 0x8000
BASE_GUID_1: 1C:34:DA:03:00:A1:96:80
FEATURE_EN_0: 0
FEATURE_EN_1: 70
FEATURE_EN_2: 0
FEATURE_EN_3: 0
FEATURE_EN_4: 8
FEATURE_EN_5: 0
FEATURE_EN_6: 5
FEATURE_EN_7: 5
FEATURE_EN_8: 5
FEATURE_EN_9: 5
FEATURE_EN_10: 0
FEATURE_EN_11: 0
NUM_SCHEME: 0
EN_PORTS_NUM: 32
PORTS_INC_SCHEME: 0
PORTS_INC_ORDER_0: 0
PORTS_INC_ORDER_1: 0
PORTS_INC_ORDER_2: 0
PORTS_INC_ORDER_3: 0
Manufacturer: Mellanox
Platform Name: x86_64-mlnx_msn2700-r0
Product Name: MSN2700
ONIE Version: 2023.11-5.3.0011-9600
CHSUM_FIELD: 0X878FA694
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed it, the idea to separate implementation for previous SPCs to ensure backward compatibility. It is not guaranteed that SYS_DISPLAY had the desired value for all previous platforms.
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
Why I did it
To return the correct Model Number for MLNX platforms rather than Part Number.
Work item tracking
How I did it
For SPC1-3 read it from eeprom.part_number and for SPC4 and newer read it from VPD file, SYS_DISPLAY value.
How to verify it
Manual testing: 'show platform summary' for each spectrum.
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)