From c60b3f267c262f95903a6e1206319feab212fe14 Mon Sep 17 00:00:00 2001 From: Stephen Sun Date: Thu, 10 Feb 2022 04:07:17 +0000 Subject: [PATCH] Fix issue: module id got from get_change_event is wrong 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 b06dd1b7e65..06948af3286 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 @@ def on_pmpe(self, fd_p): 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)