Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

arfeigin
Copy link
Contributor

Why I did it

To return the correct Model Number for MLNX platforms rather than Part Number.

Work item tracking
  • Microsoft ADO (number only):

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)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

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)

@arfeigin arfeigin requested a review from lguohan as a code owner February 17, 2025 15:11
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@arfeigin
Copy link
Contributor Author

/azp run Azure.sonic-buildimage

Copy link

Commenter does not have sufficient privileges for PR 21763 in repo sonic-net/sonic-buildimage

@arfeigin
Copy link
Contributor Author

/azp run

Copy link

Commenter does not have sufficient privileges for PR 21763 in repo sonic-net/sonic-buildimage

@arfeigin
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liat-grozovik
Copy link
Collaborator

please dont merge till @keboliu will approve it

@mssonicbld
Copy link
Collaborator

/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)
Copy link
Collaborator

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

Copy link
Contributor Author

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.

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants