Skip to content

Commit 9aa9ca5

Browse files
authored
Fix build failures and add return type
1 parent ca78496 commit 9aa9ca5

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

sonic-xcvrd/xcvrd/xcvrd.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -980,8 +980,9 @@ def reset_app_code_and_reinit_all_lanes(self, api):
980980
"""
981981
api.set_application(0xff, 0, 0)
982982
api.set_datapath_deinit(0xff)
983-
api.scs_apply_datapath_init(0xff)
984-
return
983+
if not api.scs_apply_datapath_init(0xff):
984+
return False
985+
return True
985986

986987
def is_cmis_app_code_reset_required(self, api, app_new):
987988
"""
@@ -992,9 +993,8 @@ def is_cmis_app_code_reset_required(self, api, app_new):
992993
if app_cur != 0 and app_cur != app_new:
993994
self.log_notice("Changing from default AppSel {} to non default AppSel code {}. Reset AppSel "
994995
"code for all lanes".format(app_cur, app_new))
995-
self.reset_app_code_and_reinit_all_lanes(api)
996-
break
997-
return
996+
return self.reset_app_code_and_reinit_all_lanes(api)
997+
return True
998998

999999
def is_cmis_application_update_required(self, api, app_new, host_lanes_mask):
10001000
"""
@@ -1442,8 +1442,11 @@ def task_worker(self):
14421442
else:
14431443
self.log_notice("{} Successfully configured Tx power = {}".format(lport, tx_power))
14441444

1445-
# Reset and DP Init when non default app code needs to be configured
1446-
self.is_cmis_app_code_reset_required(api, appl)
1445+
# Reset and DP Init when non default app code needs to be configured
1446+
if not self.is_cmis_app_code_reset_required(api, appl):
1447+
self.log_notice("{}: unable to reset application and DP reinit".format(lport))
1448+
self.force_cmis_reinit(lport, retries + 1)
1449+
continue
14471450

14481451
need_update = self.is_cmis_application_update_required(api, appl, host_lanes_mask)
14491452

0 commit comments

Comments
 (0)