From 192409a7db88b6558830793237c1e8725c15fe56 Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Sun, 13 Feb 2022 11:50:37 +0800 Subject: [PATCH] Fix issue: module id got from get_change_event is wrong (#9961) Signed-off-by: Stephen Sun --- .../mellanox/mlnx-platform-api/sonic_platform/sfp_event.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py index b06dd1b7e6..06948af328 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py @@ -360,16 +360,12 @@ class sfp_event: logical_port = sx_port_log_id_t_arr_getitem(logical_port_list, i) rc = sx_api_port_device_get(self.handle, 1 , 0, port_attributes_list, port_cnt_p) port_cnt = uint32_t_p_value(port_cnt_p) - x = 0 # x is the port index within a LC for i in range(port_cnt): port_attributes = sx_port_attributes_t_arr_getitem(port_attributes_list,i) if port_attributes.log_port == logical_port: - label_port = slot_id * DeviceDataManager.get_linecard_max_port_count() + x + 1 + label_port = slot_id * DeviceDataManager.get_linecard_max_port_count() + port_attributes.port_mapping.module_port break - if port_attributes.port_mapping.slot == slot_id: - x += 1 - if label_port is not None: label_port_list.append(label_port)