Skip to content

Add tx bias support check before getting tx bias of sff8436 and sff8636#586

Merged
prgeor merged 10 commits intosonic-net:masterfrom
az-pz:ariz/fix-sff8436-sff8636-get-tx-bias
Aug 5, 2025
Merged

Add tx bias support check before getting tx bias of sff8436 and sff8636#586
prgeor merged 10 commits intosonic-net:masterfrom
az-pz:ariz/fix-sff8436-sff8636-get-tx-bias

Conversation

@az-pz
Copy link
Copy Markdown
Contributor

@az-pz az-pz commented Jul 10, 2025

Description

Fix the tx bias response for sff8436 and sff8636 copper interfaces.

Motivation and Context

Tx bias of sff8436 and sff8636 interfaces would return as 0 even for copper interfaces. As copper interfaces don't support txbias, we change the return to 'N/A' for them. It keeps the behavior consistent with other DOM values.

How Has This Been Tested?

I looked at the output of the following commands on a sonic device:

  1. sudo sfputil show eeprom : The output remained unchanged.
  2. show interface transce eeprom : The output remained unchanged.
# In the python shell of pmon container
from sonic_platform.platform import Platform
p = Platform()
platform_chassis = p.get_chassis()
a = platform_chassis.get_all_sfps()
apis = [i.get_xcvr_api() for i in a if i]
{i.get_transceiver_info()['serial'].strip():i.get_tx_bias() for i in apis if i}
{i.get_transceiver_info()['serial'].strip():(i.is_copper(), i.get_tx_bias_support()) for i in apis if i}
{(i.get_transceiver_info()['type'].strip(),i.is_copper(), i.get_tx_bias_support(), i.is_flat_memory()) for i in apis if i}

After the change, the tx_bias of sff8436 and sff8636 copper interfaces returned as 'N/A'. The output for other interfaces remained unchanged. It was tested on a testbed with following types of txvrs:

>>>{(i.get_transceiver_info()['type'].strip(),i.is_copper(), i.get_tx_bias_support(), i.is_flat_memory()) for i in apis if i}
{('QSFP28 or later', False, True, False), ('QSFP28 or later', True, False, True), ('QSFP+ or later with SFF-8636 or SFF-8436', True, False, False), ('QSFP-DD Double Density 8X Pluggable Transceiver', True, False, True), ('QSFP+ or later with SFF-8636 or SFF-8436', False, True, False), ('QSFP-DD Double Density 8X Pluggable Transceiver', False, True, False), ('SFP/SFP+/SFP28', False, True, True)}

Before the rx_los_support change:

 [print(i.get_transceiver_info()['type'].strip(),i.is_copper(), i.get_rx_los_support(), i.get_rx_los()) for i in apis if i]
QSFP-DD Double Density 8X Pluggable Transceiver False True [True, False, False, False, False, False, False, False]
QSFP-DD Double Density 8X Pluggable Transceiver False True [False, False, False, False, False, False, False, False]
QSFP-DD Double Density 8X Pluggable Transceiver False True [False, False, False, False, False, False, False, False]
QSFP-DD Double Density 8X Pluggable Transceiver False True [False, False, False, False, False, False, False, False]
QSFP-DD Double Density 8X Pluggable Transceiver False True [False, False, False, False, False, False, False, False]
QSFP-DD Double Density 8X Pluggable Transceiver False True [False, False, False, False, False, False, False, False]
QSFP-DD Double Density 8X Pluggable Transceiver False True [False, False, False, False, False, False, False, False]
QSFP-DD Double Density 8X Pluggable Transceiver True False ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A']
QSFP-DD Double Density 8X Pluggable Transceiver True False ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A']
QSFP-DD Double Density 8X Pluggable Transceiver False True [False, False, False, False, False, False, False, False]
QSFP-DD Double Density 8X Pluggable Transceiver False True [False, False, False, False, False, False, False, False]
QSFP28 or later False True [True, True, True, True]
QSFP28 or later False True [True, True, True, True]
QSFP28 or later True True [False, False, False, False]
QSFP28 or later True True [False, False, False, False]
QSFP+ or later with SFF-8636 or SFF-8436 False True [False, False, False, False]
QSFP+ or later with SFF-8636 or SFF-8436 False True [False, False, False, False]
QSFP+ or later with SFF-8636 or SFF-8436 True True [False, False, False, False]
QSFP+ or later with SFF-8636 or SFF-8436 True True [False, False, False, False]
SFP/SFP+/SFP28 False True [False]
SFP/SFP+/SFP28 False True [False]

After making the rx_los_support change:

>>> [print(i.get_transceiver_info()['type'].strip(),i.is_copper(), i.get_rx_los_support(), i.get_rx_los()) for i in apis if i]
QSFP-DD Double Density 8X Pluggable Transceiver False True [True, False, False, False, False, False, False, False]
QSFP-DD Double Density 8X Pluggable Transceiver False True [False, False, False, False, False, False, False, False]
QSFP-DD Double Density 8X Pluggable Transceiver False True [False, False, False, False, False, False, False, False]
QSFP-DD Double Density 8X Pluggable Transceiver False True [False, False, False, False, False, False, False, False]
QSFP-DD Double Density 8X Pluggable Transceiver False True [False, False, False, False, False, False, False, False]
QSFP-DD Double Density 8X Pluggable Transceiver False True [False, False, False, False, False, False, False, False]
QSFP-DD Double Density 8X Pluggable Transceiver False True [False, False, False, False, False, False, False, False]
QSFP-DD Double Density 8X Pluggable Transceiver True False ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A']
QSFP-DD Double Density 8X Pluggable Transceiver True False ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A']
QSFP-DD Double Density 8X Pluggable Transceiver False True [False, False, False, False, False, False, False, False]
QSFP-DD Double Density 8X Pluggable Transceiver False True [False, False, False, False, False, False, False, False]
QSFP28 or later False True [True, True, True, True]
QSFP28 or later False True [True, True, True, True]
QSFP28 or later True False ['N/A', 'N/A', 'N/A', 'N/A']
QSFP28 or later True False ['N/A', 'N/A', 'N/A', 'N/A']
QSFP+ or later with SFF-8636 or SFF-8436 False True [False, False, False, False]
QSFP+ or later with SFF-8636 or SFF-8436 False True [False, False, False, False]
QSFP+ or later with SFF-8636 or SFF-8436 True False ['N/A', 'N/A', 'N/A', 'N/A']
QSFP+ or later with SFF-8636 or SFF-8436 True False ['N/A', 'N/A', 'N/A', 'N/A']
SFP/SFP+/SFP28 False True [False]
SFP/SFP+/SFP28 False True [False]

Additional Information (Optional)

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@az-pz az-pz marked this pull request as ready for review July 21, 2025 20:02
@mihirpat1 mihirpat1 requested a review from Copilot July 22, 2025 17:15

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@mihirpat1 mihirpat1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the testing part of the description, can you also mention if you tested flat and/or non-flat memory transceiver for each type of SFP tested?

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@az-pz az-pz requested a review from mihirpat1 July 23, 2025 17:03
@@ -398,7 +400,7 @@ def get_rx_los_support(self):
return True
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@az-pz @mihirpat1 fix get_rx_los_support() ?

Copy link
Copy Markdown
Contributor Author

@az-pz az-pz Jul 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prgeor , get_rx_los_support function is only being used in cmis.py and sff8472.py . In sff8436.py and sff8636.py, they are just defined but not used anywhere in the module. I guess we don't have to fix get_rx_los_support for sff8436.py and sff8472.py.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prgeor @mihirpat1 , I have added the fix for get_rx_los_support and get_rx_los. I have also tested it and added the result to the PR description.

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@az-pz az-pz requested review from Copilot, mihirpat1 and prgeor July 31, 2025 21:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the tx bias response for SFF-8436 and SFF-8636 copper interfaces by making them return 'N/A' instead of 0, ensuring consistency with other DOM values for copper interfaces that don't support tx bias monitoring.

Key changes:

  • Updated support check methods to return False for copper interfaces
  • Added early return logic to DOM methods when support is not available
  • Enhanced test coverage for copper interface simulation

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
sonic_platform_base/sonic_xcvr/api/public/sff8636.py Updated tx_bias_support and rx_los_support methods to return False for copper, added support checks in get_tx_bias and get_rx_los
sonic_platform_base/sonic_xcvr/api/public/sff8436.py Updated tx_bias_support and rx_los_support methods to return False for copper, added support checks in get_tx_bias and get_rx_los
tests/sonic_xcvr/test_sff8636.py Added test assertions for tx_bias and rx_los returning 'N/A' for copper, fixed duplicate rx_power_support assertion
tests/sonic_xcvr/test_sff8436.py Added test assertions for tx_bias and rx_los returning 'N/A' for copper, fixed duplicate rx_power_support assertion

@prgeor prgeor merged commit af47c73 into sonic-net:master Aug 5, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants