Default SFF8472 xcvr cable type to Unknown#606
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@lotus-nexthop , removing this PR from chassis project, this is not t2 right? thanks. |
|
@lotus-nexthop what is the call stack for xcvrd crash? |
Hi @prgeor I added the call stack to the PR description |
There was a problem hiding this comment.
Pull request overview
This PR aligns the SFF-8472 transceiver info behavior with other module APIs by defaulting cable_type to "Unknown" instead of None, preventing downstream failures when transceiver info is marshaled into DB field/value pairs (per sonic-buildimage#24369).
Changes:
- Default
Sff8472Api.get_transceiver_info()cable_typeto"Unknown"when no supported/positive length type is detected.
| len_types = ["Length SMF (km)", "Length SMF (100m)", "Length OM2 (10m)", "Length OM1(10m)", "Length OM4(10m)", "Length OM3(10m)"] | ||
| cable_len = 0 | ||
| cable_type = None | ||
| cable_type = "Unknown" |
There was a problem hiding this comment.
This change prevents returning None for cable_type, but there’s no unit test asserting the new behavior. Consider adding/adjusting a test to verify get_transceiver_info() returns cable_type == "Unknown" (and a string type) when all SFF-8472 length fields are 0/unsupported, to guard against regressions that could reintroduce xcvrd DB-marshalling crashes.
There was a problem hiding this comment.
@lotus-nexthop looks to be a valid comment that you can address in new PR?
Follow the pattern from sff8436.py and default to "Unknown" to prevent
None being returned.
Fixes sonic-net/sonic-buildimage#24369
Description
If the transceiver does not have one of the expected length-types, it
will be returned as None, which will cause an exception in xcvrd's
post_port_sfp_info_to_db() when it tries to marshal that data into a
swsscommon.FieldValuePairs because None is not a string.
Motivation and Context
We were seeing a continuous crash loop on NH-4010 when loopback
transceivers were installed.
How Has This Been Tested?
Verified it stopped the continuous crash loop on NH-4010 when the
appropriate loopbacks are installed.
Additional Information (Optional)
Crash logs