-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sonic_xcvr/cmis] Tune to set_lpmode status for 400G-ZR #327
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -965,7 +965,11 @@ def set_lpmode(self, lpmode): | |
# Force module transition to LowPwr under SW control | ||
lpmode_val = lpmode_val | (1 << CmisApi.LowPwrRequestSW) | ||
self.xcvr_eeprom.write(consts.MODULE_LEVEL_CONTROL, lpmode_val) | ||
time.sleep(0.1) | ||
for retries in range(50): | ||
if self.get_lpmode(): | ||
break | ||
time.sleep(0.1) | ||
|
||
return self.get_lpmode() | ||
else: | ||
# Force transition from LowPwr to HighPower state under SW control. | ||
|
@@ -975,7 +979,8 @@ def set_lpmode(self, lpmode): | |
self.xcvr_eeprom.write(consts.MODULE_LEVEL_CONTROL, lpmode_val) | ||
time.sleep(1) | ||
mstate = self.get_module_state() | ||
return True if mstate == 'ModuleReady' else False | ||
return True if mstate == 'ModuleReady' or mstate=='ModulePwrUp' else False | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ModulePwrUp is a transient state. Why do we need to check this state here?. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because we try to do retry, it seems need 3-4sec until status=True on ZR. Or can you advise? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wait for ModuleReady on ZR will need 3-4sec on ZR, so we try to use ModulePwrUp. And it can get status=True. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We must check the steady state of the module. i.e. We will have to wait till the module reaches "ModuleReady" state. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I retest and check spend time for set_lpmode=on. It spend time from 0.24 to 0.4sec on 400G-ZR until it get status=True. For set off, it speed time about 55sec until get ModuleReady. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jostar-yang please try using get_datapath_init_duration() timeout to know how much time module can takes to transition from LowPwr to ModuleReady There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Call self.get_datapath_deinit_duration() after self.get_lpmode()==True. API,get_datapath_init_duration, return "5000". What is unit for the API return code? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jostar-yang Thanks. Please use this timeout value to wait upto max timeout duration. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you means use "dp_deinit_time=5000" to be timeout value? What is it's unit? Is unit ms or us? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I Check sonic_xcvr/codes/public/cmis.py and CMIS SPEC. Unit seems is ms. "5000" is from "0111b" that mapping to "1 s <= Tstate < 5 s" |
||
|
||
return False | ||
|
||
def get_loopback_capability(self): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please get the exact time taken by the module to get into LP mode?.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We test set lpmode to on, need 2sec and can get status=True.
For lpmode=off, it need 3-4sec and can get get status=True. Otherwise , they will get false in current code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jostar-yang please use get_datapath_deinit_duration() to know how much time it take for module to transition to LowPwr mode i.e
ModuleDeactivatedT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call get_datapath_init_duration until mstate == 'ModuleReady'. It get "60000".
root@sonic:~# sfputil lpmode off Ethernet248
Disabling low-power mode for port Ethernet248 ... 1:spend set_lpmdoe=off ,use 54.217353sec
BB:get dp_init_time=60000.000000
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jostar-yang please update the code to read the timeout value and wait max duration for the advertised timeout