Skip to content

Commit 712d4b9

Browse files
stepanblyschakyxieca
authored andcommitted
[mlnx] fix incorrect attr assignment in mlnx-sfpd (#2913)
* [mlnx] fix incorrect attr assignment in mlnx-sfpd Signed-off-by: Stepan Blyschak <[email protected]> * [mlnx] on_pmpe returns bool and not SX_STATUS_SUCCESS Signed-off-by: Stepan Blyschak <[email protected]> * [mlnx] fix typo Signed-off-by: Stepan Blyschak <[email protected]>
1 parent 82cd144 commit 712d4b9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

platform/mellanox/mlnx-sfpd/scripts/mlnx-sfpd

+4-4
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class MlnxSfpd:
120120
raise RuntimeError("sx_api_host_ifc_open exited with error, rc {}".format(rc))
121121

122122
self.user_channel_p.type = SX_USER_CHANNEL_TYPE_FD
123-
self.user_channel_p.fd = self.rx_fd_p
123+
self.user_channel_p.channel.fd = self.rx_fd_p
124124

125125
rc = sx_api_host_ifc_trap_id_register_set(self.handle,
126126
SX_ACCESS_CMD_REGISTER,
@@ -170,8 +170,8 @@ class MlnxSfpd:
170170

171171
for fd in read:
172172
if fd == self.rx_fd_p.fd:
173-
rc, port_list, module_state = self.on_pmpe(self.rx_fd_p)
174-
if rc != SX_STATUS_SUCCESS:
173+
success, port_list, module_state = self.on_pmpe(self.rx_fd_p)
174+
if not success:
175175
raise RuntimeError("failed to read from {}".format(fd))
176176

177177
sfp_state = sfp_value_status_dict.get(module_state, STATUS_UNKNOWN)
@@ -187,7 +187,7 @@ class MlnxSfpd:
187187

188188
def send_sfp_notification(self, port, state):
189189
sfp_notify = [port, state]
190-
msg = json.dumps(sfp_notify, seperators=(',', ':'))
190+
msg = json.dumps(sfp_notify, separators=(',', ':'))
191191
self.state_db.publish('STATE_DB', 'TRANSCEIVER_NOTIFY', msg)
192192

193193
def update_sfpd_liveness_key(self, timeout_secs):

0 commit comments

Comments
 (0)