sonic-buildimage/device/mellanox/x86_64-mlnx_msn2700-r0
Sudharsan Dhamal Gopalarathnam 545b526a49
[202012][mellanox]Fix lpmode set when logical port is larger than 64 (#14137)
This PR is to backport #14138 to 202012.

- Why I did it
In sfplpm API, the number of logical ports is hardcoded as 64. When a system contains more port than this, the SDK APIs would fail with a trace as below

Enabling low-power mode for port Ethernet0... Traceback (most recent call last):
File "/usr/share/sonic/platform/plugins/sfplpmset.py", line 167, in
set_lpmode(handle, cmd, sfp_module)
File "/usr/share/sonic/platform/plugins/sfplpmset.py", line 128, in set_lpmode
SX_MGMT_PHY_MOD_PWR_ATTR_PWR_MODE_E, SX_MGMT_PHY_MOD_PWR_MODE_LOW_E)
File "/usr/share/sonic/platform/plugins/sfplpmset.py", line 115, in pwr_attr_set
mgmt_phy_mod_pwr_attr_set(handle, module_id, attr_type, power_mode)
File "/usr/share/sonic/platform/plugins/sfplpmset.py", line 84, in mgmt_phy_mod_pwr_attr_set
assert SX_STATUS_SUCCESS == rc, "sx_mgmt_phy_mod_pwr_attr_set failed"
AssertionError: sx_mgmt_phy_mod_pwr_attr_set failed
Error! Unable to set LPM for 1, rc = 1, err msg: [+] opening sdk
Mar 07 03:25:28 INFO LOG: Initializing SX log with STDOUT as output file.
Mar 07 03:25:28 ERROR SX_API_PORT: sx_mgmt_phy_mod_pwr_attr_get: This API is deprecated and will be removed in the future. Please use sx_mgmt_phy_module_pwr_attr_get in its place.
Mar 07 03:25:28 ERROR SX_API_PORT: sx_mgmt_phy_mod_pwr_attr_set: This API is deprecated and will be removed in the future. Please use sx_mgmt_phy_module_pwr_attr_set in its place.

- How I did it
Remove the hardcoded value of 64. Obtained the number of logical ports from SDK

- How to verify it
Manual testing
2023-03-09 00:04:09 +02:00
..
ACS-MSN2700 [Reclaim buffer][202012] Reclaim unused buffers by applying zero buffer profiles (#9063) 2021-12-09 17:34:56 +02:00
Mellanox-SN2700 [Reclaim buffer][202012] Reclaim unused buffers by applying zero buffer profiles (#9063) 2021-12-09 17:34:56 +02:00
Mellanox-SN2700-C28D8 [Reclaim buffer][202012] Reclaim unused buffers by applying zero buffer profiles (#9063) 2021-12-09 17:34:56 +02:00
Mellanox-SN2700-D40C8S8 [Reclaim buffer][202012] Reclaim unused buffers by applying zero buffer profiles (#9063) 2021-12-09 17:34:56 +02:00
Mellanox-SN2700-D48C8 Support queue 7 in dual ToR scenario (#11570) 2022-08-01 09:27:49 +08:00
plugins [202012][mellanox]Fix lpmode set when logical port is larger than 64 (#14137) 2023-03-09 00:04:09 +02:00
default_sku [updategraph] add support to use preset config instead of default minigraph (#2050) 2018-09-21 22:01:10 -07:00
installer.conf [installer]: Move platform-specific files under new device/ tree (#450) 2017-03-29 04:17:49 -07:00
pcie.yaml add pcied config files for mellanox platform (#5669) 2020-11-02 19:45:36 -08:00
platform_components.json [Mellanox] Update platform components config files. (#5685) 2020-10-25 19:44:37 +02:00
platform_reboot [Mellanox] platform_reboot - sync & umount fs before power cycle (#3430) 2019-09-17 09:38:30 -07:00
platform_wait [mellanox]: Enhance pmon synchronization with hw-mgmt platform counters. (#3885) 2019-12-17 10:58:55 -08:00
platform.json [Mellanox] [202012] Enhance the platform.json with adding more platform device facts. (#7496) 2021-05-09 10:45:36 +03:00
pmon_daemon_control.json [Mellanox] Enhance Python3 support for platform API (#7410) (#7910) 2021-06-18 09:46:41 -07:00
sensors.conf [Mellanox] Add sensors labels for human readable output for MSN2700 (#5661) 2020-10-19 16:02:27 -07:00
system_health_monitoring_config.json [system-health] Add support for monitoring system health (#4835) 2020-10-12 11:12:49 +03:00
thermal_policy.json [Mellanox] Never disable kernel thermal algorithm at real-time (#4638) 2020-05-26 10:46:29 -07:00