[sonic_xcvr]Enhance to support QSFP port_id=0xC for access eeprom #334
+2
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: jostar-yang jostar_yang@edge-core.com
Description
This PR is for fix issue:#330
Cmd, sfputil show eeprom, will get fail when insert QSFP(port_id=0xC).
root@sonic:/home/admin# sfputil show eeprom
Traceback (most recent call last):
File "/usr/local/bin/sfputil", line 8, in
sys.exit(cli())
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 764, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/sfputil/main.py", line 673, in eeprom
output += convert_sfp_info_to_output_string(xcvr_info)
File "/usr/local/lib/python3.9/dist-packages/sfputil/main.py", line 336, in convert_sfp_info_to_output_string
sfp_type = sfp_info_dict['type']
Motivation and Context
Check code and found below code in ,
QSFP port id=0x0C should follow SPEC8436.
So modify to below ,
How Has This Been Tested?
After patch the code, sfputul show eeprom will fine as below,
Ethernet0: SFP EEPROM detected
Application Advertisement: N/A
Connector: No separable connector
Encoding: Unspecified
Extended Identifier: Power Class 1 Module (1.5W max. Power consumption), No CLEI code present in Page 02h, No CDR in TX, No CDR in RX
Extended RateSelect Compliance: QSFP+ Rate Select Version 1
Identifier: QSFP
Length Cable Assembly(m): 1.0
Nominal Bit Rate(100Mbs): 103
Specification compliance:
Additional Information (Optional)