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] Enhance Platform API to support SN2201 - RJ45 ports and new components mgmt. #10299

Closed
wants to merge 20 commits into from

Conversation

keboliu
Copy link
Collaborator

@keboliu keboliu commented Mar 21, 2022

Why I did it

  1. SN2201 has new type of interface - RJ45 ports which need to be supported in platform API.
    The solution is to inherit a class from sfp_base to manage RJ45 ports, this class will only return the port type with "RJ45",
    other fields will left with 'N/A', so XCVRD still can have a "TRANCEIVER_INFO|Ethernetx" populated to DB with type="RJ45" against a RJ45 port, and this new class will reject the lpmode, reset, etc. APIs call.
  2. Add support for new type of SSD FW upgrade.
  3. Add support for SN2201 BIOS version fetch

How I did it

  1. Add util function to get "RJ45" port list from hwsku.json
  2. Add a new class RJ45Port which was inherited from sfp class to manage RJ45 ports, and enhance the sfp_event
  3. update SSD FW upgrade scripts: mlnx-ssd-fw-update.sh
  4. New implementation to support SN2201 BIOS ComponentBIOSSN2201
  5. Add unit test for new code change

How to verify it

Run platform test on SN2201 platform

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

keboliu and others added 20 commits March 21, 2022 16:12
Signed-off-by: Kebo Liu <kebol@nvidia.com>
Do not check ONIE version on SN2201.
In legacy switches, upgrading firmware from ONIE was supported from a certain version
while it is supported from the very beginning on SN2201.
So we do not need to check ONIE version on SN2201

Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
1. A derived class representing RJ45 ports is introduced. get_presence always returns True
2. SFP error event is leveraged to represent "unknown" and "not present" states.
   By doing so, most of code change for supporting RJ45 is restricted in platform API and CLI
   xcvrd won't need to be updated for this

Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
- Hide the logic to convert port_change to error_dict inside sfp_event
- In case there are some RJ45 ports are down (not present),
  report them as sfp_event during the first round of get_change_event
  This is because SDK/FW will never report port change occurred before init
  We must make compensation for it in platform API

Signed-off-by: Stephen Sun <stephens@nvidia.com>
- Report unknown event for RJ45 ports
- Fix syntax error

Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Kebo Liu <kebol@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
…s_index_return []

Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
…sd fw update scripts

Signed-off-by: Kebo Liu <kebol@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
@lgtm-com
Copy link

lgtm-com bot commented Mar 21, 2022

This pull request introduces 2 alerts when merging 7232264 into 1017ee6 - view on LGTM.com

new alerts:

  • 1 for Unused import
  • 1 for Wrong number of arguments in a class instantiation

@keboliu keboliu deleted the platform-api-support-RJ45 branch June 14, 2023 10:00
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.

2 participants