sfputil: skip displaying the values that are not supported. #3773
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.
What I did
Skip displaying the fields which are unsupported for CMIS specific transceivers.
How I did it
Skip the key with "N/A" value in convert_sfp_info_to_output_string()
How to verify it
Verified 'show interfaces transceiver info' and 'sfputil show eeprom -p' outputs on an Arista testbed.
Previous command output (if the output of a command-line utility has changed)
sfputil show eeprom -d -p Ethernet0
Ethernet0: SFP EEPROM detected
Active App Selection Host Lane 1: 5
Active App Selection Host Lane 2: 5
Active App Selection Host Lane 3: 5
Active App Selection Host Lane 4: 5
Active App Selection Host Lane 5: 5
Active App Selection Host Lane 6: 5
Active App Selection Host Lane 7: 5
Active App Selection Host Lane 8: 5
Application Advertisement: 400GAUI-4-L C2M (Annex 120G) - Host Assign (0x11) - 400GBASE-DR4 (Cl 124) - Media Assign (0x11)
400GAUI-4-S C2M (Annex 120G) - Host Assign (0x11) - 400GBASE-DR4 (Cl 124) - Media Assign (0x11)
100GAUI-1-L C2M (Annex 120G) - Host Assign (0xff) - 100GBASE-DR (Cl 140) - Media Assign (0xff)
100GAUI-1-S C2M (Annex 120G) - Host Assign (0xff) - 100GBASE-DR (Cl 140) - Media Assign (0xff)
200GAUI-2-L C2M (Annex 120G) - Host Assign (0x55) - Undefined - Media Assign (0x55)
200GAUI-2-S C2M (Annex 120G) - Host Assign (0x55) - Undefined - Media Assign (0x55)
800G L C2M (placeholder) - Host Assign (0x1) - 800GBASE-DR8 (placeholder) - Media Assign (0x1)
CMIS Revision: 5.1
Connector: MPO 2x12
Encoding: N/A
Extended Identifier: Power Class 8 (16.0W Max)
Extended RateSelect Compliance: N/A
Hardware Revision: 1.0
Host Electrical Interface: 400GAUI-4-L C2M (Annex 120G)
Host Lane Assignment Options: 17
Host Lane Count: 4
Identifier: OSFP 8X Pluggable Transceiver
Length Cable Assembly(m): 0.0
Media Interface Code: 400GBASE-DR4 (Cl 124)
Media Interface Technology: 1310 nm EML
Media Lane Assignment Options: 17
Media Lane Count: 4
Nominal Bit Rate(100Mbs): 0
Specification compliance: sm_media_interface
Supported Max Laser Frequency: N/AGHz
Supported Max TX Power: N/AdBm
Supported Min Laser Frequency: N/AGHz
Supported Min TX Power: N/AdBm
Vendor Date Code(YYYY-MM-DD Lot): 2024-04-25
Vendor Name: FINISAR CORP.
Vendor OUI: 00-90-65
Vendor PN: FTCE4517E1PCA-2F
Vendor Rev: A0
Vendor SN: XACB0QQ
New command output (if the output of a command-line utility has changed)
sfputil show eeprom -p Ethernet0
Ethernet0: SFP EEPROM detected
Active App Selection Host Lane 1: 5
Active App Selection Host Lane 2: 5
Active App Selection Host Lane 3: 5
Active App Selection Host Lane 4: 5
Active App Selection Host Lane 5: 5
Active App Selection Host Lane 6: 5
Active App Selection Host Lane 7: 5
Active App Selection Host Lane 8: 5
Application Advertisement: 400GAUI-4-L C2M (Annex 120G) - Host Assign (0x11) - 400GBASE-DR4 (Cl 124) - Media Assign (0x11)
400GAUI-4-S C2M (Annex 120G) - Host Assign (0x11) - 400GBASE-DR4 (Cl 124) - Media Assign (0x11)
100GAUI-1-L C2M (Annex 120G) - Host Assign (0xff) - 100GBASE-DR (Cl 140) - Media Assign (0xff)
100GAUI-1-S C2M (Annex 120G) - Host Assign (0xff) - 100GBASE-DR (Cl 140) - Media Assign (0xff)
200GAUI-2-L C2M (Annex 120G) - Host Assign (0x55) - Undefined - Media Assign (0x55)
200GAUI-2-S C2M (Annex 120G) - Host Assign (0x55) - Undefined - Media Assign (0x55)
800G L C2M (placeholder) - Host Assign (0x1) - 800GBASE-DR8 (placeholder) - Media Assign (0x1)
CMIS Revision: 5.1
Connector: MPO 2x12
Extended Identifier: Power Class 8 (16.0W Max)
Hardware Revision: 1.0
Host Electrical Interface: 400GAUI-4-L C2M (Annex 120G)
Host Lane Assignment Options: 17
Host Lane Count: 4
Identifier: OSFP 8X Pluggable Transceiver
Length Cable Assembly(m): 0.0
Media Interface Code: 400GBASE-DR4 (Cl 124)
Media Interface Technology: 1310 nm EML
Media Lane Assignment Options: 17
Media Lane Count: 4
Nominal Bit Rate(100Mbs): 0
Specification compliance: sm_media_interface
Vendor Date Code(YYYY-MM-DD Lot): 2024-04-25
Vendor Name: FINISAR CORP.
Vendor OUI: 00-90-65
Vendor PN: FTCE4517E1PCA-2F
Vendor Rev: A0
Vendor SN: XACB0QQ