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. #10377

Merged
merged 11 commits into from
Jun 21, 2022

Conversation

keboliu
Copy link
Collaborator

@keboliu keboliu commented Mar 29, 2022

Signed-off-by: Kebo Liu kebol@nvidia.com

Why I did it

  1. SN2201 has a 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 be left with 'N/A', so XCVRD still can have a "TRANCEIVER_INFO|Ethernetx" populated to DB with type="RJ45" against an RJ45 port, and this new class will reject the lpmode, reset, etc. APIs call.
  2. Add support for a new type of SSD FW upgrade.
  3. Add support for SN2201 BIOS version fetch

How I did it

  1. Add util function to get the "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)

@lgtm-com
Copy link

lgtm-com bot commented Mar 29, 2022

This pull request introduces 3 alerts when merging 4fb3309343d8de5b0d49e487313f544d0b5cdfd5 into 8e64284 - view on LGTM.com

new alerts:

  • 1 for Unused import
  • 1 for Variable defined multiple times
  • 1 for Wrong number of arguments in a class instantiation

@lgtm-com
Copy link

lgtm-com bot commented Apr 1, 2022

This pull request introduces 1 alert when merging a7a0523387c9d500c2d40450c405a8bfc3301f0f into 0f488a8 - view on LGTM.com

new alerts:

  • 1 for Wrong number of arguments in a class instantiation

@keboliu
Copy link
Collaborator Author

keboliu commented Apr 1, 2022

This pull request introduces 1 alert when merging a7a0523 into 0f488a8 - view on LGTM.com

new alerts:

  • 1 for Wrong number of arguments in a class instantiation

This is a false alarm, LTGM is referring to a sfp_event definition in another vendors' implementation. This is a bug of LGTM.

@lgtm-com
Copy link

lgtm-com bot commented Apr 2, 2022

This pull request introduces 1 alert when merging f67156856bb072bb7114673676359b22f9aa3d97 into 8edc534 - view on LGTM.com

new alerts:

  • 1 for Wrong number of arguments in a class instantiation

@keboliu
Copy link
Collaborator Author

keboliu commented Apr 4, 2022

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@keboliu
Copy link
Collaborator Author

keboliu commented Apr 5, 2022

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list.

@keboliu
Copy link
Collaborator Author

keboliu commented Apr 5, 2022

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@keboliu keboliu force-pushed the platform_api_support_RJ45 branch from f671568 to fcfa115 Compare April 18, 2022 02:49
@lgtm-com
Copy link

lgtm-com bot commented Apr 18, 2022

This pull request introduces 1 alert when merging fcfa115 into a149457 - view on LGTM.com

new alerts:

  • 1 for Wrong number of arguments in a class instantiation

@keboliu
Copy link
Collaborator Author

keboliu commented Apr 18, 2022

This pull request introduces 1 alert when merging fcfa115 into a149457 - view on LGTM.com

new alerts:

  • 1 for Wrong number of arguments in a class instantiation

This is a false alarm, LTGM is referring to a sfp_event definition in another vendors' implementation. This is a bug of LGTM.

@stephenxs
Copy link
Collaborator

/azpw run Azure.sonic-buildimage

1 similar comment
@keboliu
Copy link
Collaborator Author

keboliu commented May 27, 2022

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@stephenxs
Copy link
Collaborator

Timer expired on kvmtest-t1-lag

@keboliu
Copy link
Collaborator Author

keboliu commented May 28, 2022

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@keboliu
Copy link
Collaborator Author

keboliu commented Jun 1, 2022

/azpw run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@keboliu keboliu requested a review from a team as a code owner June 2, 2022 02:29
keboliu and others added 7 commits June 6, 2022 09:54
Signed-off-by: Kebo Liu <kebol@nvidia.com>
Signed-off-by: Kebo Liu <kebol@nvidia.com>
Signed-off-by: Kebo Liu <kebol@nvidia.com>
* Revert the special handling of RJ45 ports

sfp.py
sfp_event.py
chassis.py

Signed-off-by: Stephen Sun <stephens@nvidia.com>

* Remove deadcode

Signed-off-by: Stephen Sun <stephens@nvidia.com>
A new class is introduced, deriving from ComponentCPLD and overloading _install_firmware
Change _install_firmware from private (starting with __) to protected, making it overloadable

Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
@keboliu keboliu force-pushed the platform_api_support_RJ45 branch from 210aeee to ae18fd1 Compare June 6, 2022 01:54
@lgtm-com
Copy link

lgtm-com bot commented Jun 8, 2022

This pull request introduces 1 alert when merging 720de68 into 6b70b44 - view on LGTM.com

new alerts:

  • 1 for Unused import

@liushilongbuaa
Copy link
Contributor

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Translate it to disconnect for RJ45 ports
Report error for xSFP ports

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

lgtm-com bot commented Jun 14, 2022

This pull request introduces 2 alerts when merging b14c965 into 6a4105a - view on LGTM.com

new alerts:

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

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

lgtm-com bot commented Jun 15, 2022

This pull request introduces 2 alerts when merging 4156651 into 8d299ca - view on LGTM.com

new alerts:

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

@keboliu
Copy link
Collaborator Author

keboliu commented Jun 15, 2022

This pull request introduces 2 alerts when merging 4156651 into 8d299ca - view on LGTM.com

new alerts:

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

Both of them are false alarms:

  1. for the first one, the import of SFP and deinitialize_sdk_handle are both used in the following function, somehow LGTM is not able to correctly parse it.

  2. for the second one, LTGM is referring to a sfp_event definition in another vendor's implementation. This is a bug of LGTM.

@prgeor prgeor merged commit 7ac590b into sonic-net:master Jun 21, 2022
yxieca pushed a commit that referenced this pull request Jul 28, 2022
…w components mgmt. (#10377)

* Support new platform SN2201 and RJ45 port

Signed-off-by: Kebo Liu <kebol@nvidia.com>

* remove unused import and redundant function

Signed-off-by: Kebo Liu <kebol@nvidia.com>

* fix error introduced by rebase

Signed-off-by: Kebo Liu <kebol@nvidia.com>

* Revert the special handling of RJ45 ports (#56)

* Revert the special handling of RJ45 ports

sfp.py
sfp_event.py
chassis.py

Signed-off-by: Stephen Sun <stephens@nvidia.com>

* Remove deadcode

Signed-off-by: Stephen Sun <stephens@nvidia.com>

* Support CPLD update for SN2201

A new class is introduced, deriving from ComponentCPLD and overloading _install_firmware
Change _install_firmware from private (starting with __) to protected, making it overloadable

Signed-off-by: Stephen Sun <stephens@nvidia.com>

* Initialize component BIOS/CPLD

Signed-off-by: Stephen Sun <stephens@nvidia.com>

* Remove swb_amb which doesn't on DVT board any more

Signed-off-by: Stephen Sun <stephens@nvidia.com>

* Remove the unexisted sensor - switch board ambient - from platform.json

Signed-off-by: Stephen Sun <stephens@nvidia.com>

* Do not report error on receiving unknown status on RJ45 ports

Translate it to disconnect for RJ45 ports
Report error for xSFP ports

Signed-off-by: Stephen Sun <stephens@nvidia.com>

* Add reinit for RJ45 to avoid exception

Signed-off-by: Stephen Sun <stephens@nvidia.com>

Co-authored-by: Stephen Sun <5379172+stephenxs@users.noreply.github.com>
Co-authored-by: Stephen Sun <stephens@nvidia.com>
skbarista pushed a commit to skbarista/sonic-buildimage that referenced this pull request Aug 17, 2022
…w components mgmt. (sonic-net#10377)

* Support new platform SN2201 and RJ45 port

Signed-off-by: Kebo Liu <kebol@nvidia.com>

* remove unused import and redundant function

Signed-off-by: Kebo Liu <kebol@nvidia.com>

* fix error introduced by rebase

Signed-off-by: Kebo Liu <kebol@nvidia.com>

* Revert the special handling of RJ45 ports (sonic-net#56)

* Revert the special handling of RJ45 ports

sfp.py
sfp_event.py
chassis.py

Signed-off-by: Stephen Sun <stephens@nvidia.com>

* Remove deadcode

Signed-off-by: Stephen Sun <stephens@nvidia.com>

* Support CPLD update for SN2201

A new class is introduced, deriving from ComponentCPLD and overloading _install_firmware
Change _install_firmware from private (starting with __) to protected, making it overloadable

Signed-off-by: Stephen Sun <stephens@nvidia.com>

* Initialize component BIOS/CPLD

Signed-off-by: Stephen Sun <stephens@nvidia.com>

* Remove swb_amb which doesn't on DVT board any more

Signed-off-by: Stephen Sun <stephens@nvidia.com>

* Remove the unexisted sensor - switch board ambient - from platform.json

Signed-off-by: Stephen Sun <stephens@nvidia.com>

* Do not report error on receiving unknown status on RJ45 ports

Translate it to disconnect for RJ45 ports
Report error for xSFP ports

Signed-off-by: Stephen Sun <stephens@nvidia.com>

* Add reinit for RJ45 to avoid exception

Signed-off-by: Stephen Sun <stephens@nvidia.com>

Co-authored-by: Stephen Sun <5379172+stephenxs@users.noreply.github.com>
Co-authored-by: Stephen Sun <stephens@nvidia.com>
@keboliu keboliu deleted the platform_api_support_RJ45 branch June 14, 2023 10:04
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