[SFP-Refactor]Fix vendor revision key issue#249
Merged
prgeor merged 2 commits intosonic-net:masterfrom Dec 8, 2021
Merged
Conversation
prgeor
previously approved these changes
Dec 6, 2021
4 tasks
prgeor
approved these changes
Dec 7, 2021
prgeor
approved these changes
Dec 8, 2021
5 tasks
oleksandrivantsiv
pushed a commit
to oleksandrivantsiv/sonic-platform-common
that referenced
this pull request
Oct 25, 2024
… present; fix read side logic for ycable (sonic-net#249) Description This PR fixes the MUX_CABLE_INFO table insertion logic which was not done before this PR. If the muxcable is plugged in, with this change if the config DB states that it is a muxcable then the logic populates the MUX_CABLE_INFO with 'N/A' or 'unknown' entries. This was not done before This PR also fixes the read_side logic, which if initialized with a -1 value would never be updated to the correct value, this PR makes sure that if the read_side is read correctly if cable not powered on/disconnected from server side, and the read_side is populated correctly in state DB. Before this change the read_side was not populated correctly if the cable was not powered from server side/disconnected. Motivation and Context Required for the logic of services looking for MUX_CABLE_INFO values which require this be populated without cable presence. read_side fix logic makes sure that if the cable is powered off/disconnected from server side then the cable driver works well in those cases How Has This Been Tested? Unit-Tests and tested in the lab Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
sfputil show eeprom CLI crashes as "vendor_rev" key is not available in sff8436/8636.
Motivation and Context
hardware_rev key is used in place of vendor_rev and it causes the crash.
How Has This Been Tested?
Verified in DellEMC Z9332f platform.
Additional Information (Optional)
Before fix:
sfputil show eeprom -p Ethernet80
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 557, in eeprom
output += convert_sfp_info_to_output_string(xcvr_info)
File "/usr/local/lib/python3.9/dist-packages/sfputil/main.py", line 279, in convert_sfp_info_to_output_string
output += '{}{}: {}\n'.format(indent, QSFP_DATA_MAP[key], sfp_info_dict[key])
TypeError: 'NoneType' object is not subscriptable
root@sonic-10431:
After fix:
sfputil show eeprom -p Ethernet80
Ethernet80: 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+ or later with SFF-8636 or SFF-8436
Length Cable Assembly(m): 1.0
Nominal Bit Rate(100Mbs): 103
Specification compliance:
10/40G Ethernet Compliance Code: 40GBASE-CR4
Fibre Channel Link Length: Medium (M)
Fibre Channel Speed: Unknown
Fibre Channel Transmission Media: Twin Axial Pair (TW)
Fibre Channel Transmitter Technology: Unknown
Gigabit Ethernet Compliant Codes: Unknown
SAS/SATA Compliance Codes: Unknown
SONET Compliance Codes: Unknown
Vendor Date Code(YYYY-MM-DD Lot): 2019-01-09
Vendor Name: Amphenol
Vendor OUI: 78-a7-14
Vendor PN: 616750000
Vendor Rev: C
Vendor SN: CN01M31V9172909
root@sonic-10431:~#