-
Notifications
You must be signed in to change notification settings - Fork 175
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
[sfp-refactoring] Initial support for CMIS application initialization #219
Changes from 1 commit
2a8bfa6
a1a01cd
f53683d
dd0de8d
8c74905
26c95e6
54ca77e
54cd97a
bea277e
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 |
---|---|---|
|
@@ -892,10 +892,14 @@ def reset(self): | |
A boolean, True if successful, False if not | ||
""" | ||
if self.reset_module(True): | ||
# minimum waiting time for the TWI to be functional again | ||
time.sleep(2) | ||
# buffer time | ||
for retries in range(5): | ||
time.sleep(1) | ||
if self.get_module_state() != 'Unknown': | ||
state = self.get_module_state() | ||
if state in ['ModuleReady']: | ||
return True | ||
time.sleep(1) | ||
return False | ||
|
||
def get_lpmode(self): | ||
|
@@ -1916,15 +1920,15 @@ def set_application(self, channel, appl_code): | |
# Apply DataPathInit | ||
return self.xcvr_eeprom.write("%s_%d" % (consts.STAGED_CTRL_APPLY_DPINIT_FIELD, 0), channel) | ||
|
||
def get_num_channels(self): | ||
if self.get_module_type_abbreviation() == 'QSFP+C': | ||
return 4 | ||
return self.NUM_CHANNELS | ||
|
||
def get_error_description(self): | ||
dp_state = self.get_datapath_state() | ||
conf_state = self.get_config_datapath_hostlane_status() | ||
for lane in range(self.get_num_channels()): | ||
for lane in range(self.NUM_CHANNELS): | ||
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. can you define a function (get_cmis_num_channels()) to get the count?. Optics like DR4 has only 4 channels. we can't assume 8 as default number of channels. 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. Done, but please note these are host lanes connected to the MAC/ASIC, hence it's 8 lanes in DR4, as to QSFP+ CMIS, it's most likely 4 lanes. e.g. Here is an example of INNOLIGHT 400G DR4, the ConfigError reside at 0x94a, while DPState are at 0x900
|
||
name = "{}_{}_{}".format(consts.STAGED_CTRL_APSEL_FIELD, 0, lane + 1) | ||
appl = self.xcvr_eeprom.read(name) | ||
if (appl is None) or ((appl >> 4) == 0): | ||
continue | ||
Comment on lines
+1927
to
+1930
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. this api should return error state of datapath and module any time it is called. but looks like that is not the case. 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. It does return the failure in the current application init sequence. |
||
|
||
name = "DP{}State".format(lane + 1) | ||
if dp_state[name] != CmisCodes.DATAPATH_STATE[4]: | ||
return dp_state[name] | ||
|
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.
module won't transition to 'ModuleReady' state from 'ModuleLowPwr' unless LowPwrS is FALSE so this check will fail on those cases where LowPwrS is TRUE. so we should expect the module to be in one of the steady state i.e either ModuleReady or ModuleLowPwr
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.
The trick is, the reset_module() always clear LowPwrS, but yes, I could improve the reset() accordingly