sonic-buildimage/device/mellanox
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
..
x86_64-mlnx_lssn2700-r0 add pcied config files for mellanox platform (#5669) 2020-11-02 19:45:36 -08:00
x86_64-mlnx_msn2010-r0 [Reclaim buffer][202012] Reclaim unused buffers by applying zero buffer profiles (#9063) 2021-12-09 17:34:56 +02:00
x86_64-mlnx_msn2100-r0 [Reclaim buffer][202012] Reclaim unused buffers by applying zero buffer profiles (#9063) 2021-12-09 17:34:56 +02:00
x86_64-mlnx_msn2410-r0 [Reclaim buffer][202012] Reclaim unused buffers by applying zero buffer profiles (#9063) 2021-12-09 17:34:56 +02:00
x86_64-mlnx_msn2700_simx-r0 Removed platform specific reboot files for mellanox simx platforms (#10806) 2022-05-16 23:28:02 +00:00
x86_64-mlnx_msn2700-r0 [202012][mellanox]Fix lpmode set when logical port is larger than 64 (#14137) 2023-03-09 00:04:09 +02:00
x86_64-mlnx_msn2740-r0 [Reclaim buffer][202012] Reclaim unused buffers by applying zero buffer profiles (#9063) 2021-12-09 17:34:56 +02:00
x86_64-mlnx_msn3420-r0 [Reclaim buffer][202012] Reclaim unused buffers by applying zero buffer profiles (#9063) 2021-12-09 17:34:56 +02:00
x86_64-mlnx_msn3700_simx-r0 Removed platform specific reboot files for mellanox simx platforms (#10806) 2022-05-16 23:28:02 +00:00
x86_64-mlnx_msn3700-r0 [202012] [Mellanox] Add sensor conf file for new version of MSN3700/3700C/4600C platforms (#11358) 2022-07-14 08:59:10 +03:00
x86_64-mlnx_msn3700c-r0 [202012] [Mellanox] Add sensor conf file for new version of MSN3700/3700C/4600C platforms (#11358) 2022-07-14 08:59:10 +03:00
x86_64-mlnx_msn3800-r0 Fix typo and missing files in SN3800 and SN4600C's buffer templates (#9537) 2021-12-23 03:28:43 +00:00
x86_64-mlnx_msn4410-r0 [202012] [Mellanox] Add new sensor conf to support SN4410 A1 system (#8379) (#11530) 2022-07-29 17:41:44 +02:00
x86_64-mlnx_msn4600-r0 [Reclaim buffer][202012] Reclaim unused buffers by applying zero buffer profiles (#9063) 2021-12-09 17:34:56 +02:00
x86_64-mlnx_msn4600c-r0 [202012] [Mellanox] Add sensor conf file for new version of MSN3700/3700C/4600C platforms (#11358) 2022-07-14 08:59:10 +03:00
x86_64-mlnx_msn4700_simx-r0 Removed platform specific reboot files for mellanox simx platforms (#10806) 2022-05-16 23:28:02 +00:00
x86_64-mlnx_msn4700-r0 [202012] [Mellanox] [SKU] Mellanox-SN4700-V48C32 SKU added (#12150) 2022-10-13 16:52:59 +03:00
x86_64-mlnx_msn4800-r0/ACS-MSN4800 [Reclaim buffer][202012] Reclaim unused buffers by applying zero buffer profiles (#9063) 2021-12-09 17:34:56 +02:00
x86_64-mlnx_x86-r5.0.1400 [updategraph] add support to use preset config instead of default minigraph (#2050) 2018-09-21 22:01:10 -07:00