Using SFP refactoring framework in PDDF sfp class#10047
Using SFP refactoring framework in PDDF sfp class#10047prgeor merged 2 commits intosonic-net:masterfrom
Conversation
|
@prgeor |
| device = 'PORT{}'.format(self.port_index) | ||
| path = self.pddf_obj.get_path(device, 'xcvr_txdisable') | ||
|
|
||
| # TODO: put the optic based reset logic using EEPROM |
There was a problem hiding this comment.
Again, if CPLD setting is present for tx_disable then that would be used. Else common SfpOptoeBase implementation is used. I think this common implementation does the same eeprom register set operations which was removed from here.
| return None | ||
| return lpmode | ||
|
|
||
| def get_intr_status(self): |
There was a problem hiding this comment.
can this be removed if NOT used?
There was a problem hiding this comment.
Some platforms do have CPLD reg setting to read the xcvr interrupt status, hence it was added.
| else: | ||
| return None | ||
| # Use common SfpOptoeBase implementation for get_lpmode | ||
| lpmode = super().get_lpmode() |
There was a problem hiding this comment.
will the 'else' part be executed for QSFP-DD optics?
There was a problem hiding this comment.
Yes, given that lpmode setting cant be done via CPLD for any given platform.
| else: | ||
| tx_fault = False | ||
| else: | ||
| # Use common SfpOptoeBase implementation for get_tx_dault |
| rx_los = (sffbase().test_bit(data, 1) != 0) | ||
|
|
||
| else: | ||
| if output: |
There was a problem hiding this comment.
why override sfp_optoe_base class's get_rx_los ?
There was a problem hiding this comment.
In some platforms, rxlos can be set via CPLD. In such cases, PDDF JSON file would have the details of CPLD address, offset etc. If it is found, then we use PDDF parsing to write to the CPLD reg. If no such CPLD setting is present, then we use sf_optoe_base class's implementation.
| @@ -749,42 +136,19 @@ def get_tx_fault(self): | |||
| Note : TX fault status is lached until a call to get_tx_fault or a reset. | |||
There was a problem hiding this comment.
if CPLD setting for get_tx_fault() is present for any platform, that needs to be used. Else the common get_tx_fault() implementation of SfpOptoeBase
| # SFP doesnt support this | ||
| return 0 | ||
|
|
||
| def get_lpmode(self): |
There was a problem hiding this comment.
if CPLD setting for lpmode is present for any platform, that needs to be used. Else the common get_lpmode implementation of SfpOptoeBase
FuzailBrcm
left a comment
There was a problem hiding this comment.
replied to the comments
Why I did it
All the SFP platform API classes need to use SFP refactoring framework. The platforms which use PDDF, derive their SFP API class from a common pddf_sfp.py. Hence pddf_sfp.py needs to comply with SFP refactoring.
How I did it
Used sfpOptoeBase class in PddfSfp
How to verify it
Verified with the following logs on AS7326 platform.
Which release branch to backport (provide reason below if selected)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)