545b526a49
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 |
||
---|---|---|
.. | ||
accton | ||
alphanetworks | ||
arista | ||
barefoot | ||
broadcom/x86_64-bcm_xlr-r0 | ||
celestica | ||
centec | ||
cig | ||
common | ||
dell | ||
delta | ||
facebook/x86_64-facebook_wedge100-r0 | ||
ingrasys | ||
inventec | ||
juniper | ||
marvell | ||
mellanox | ||
mitac/x86_64-mitac_ly1200_b32h0_c3-r0 | ||
nokia/armhf-nokia_ixs7215_52x-r0 | ||
pegatron/x86_64-pegatron_porsche-r0 | ||
quanta | ||
virtual/x86_64-kvm_x86_64-r0 | ||
wnc/x86_64-wnc_osw1800-r0 |