Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sfp-refactor] Add initial support for SFF-8472 in sonic_xcvr #223

Merged
merged 7 commits into from
Nov 17, 2021

Conversation

andywongarista
Copy link
Contributor

Description

This PR adds basic support for the SFF-8472 transceiver spec within the new sonic_xcvr package.

Motivation and Context

See the HLD: Azure/SONiC#786

How Has This Been Tested?

Added new unit test under tests/sonic_xcvr
Verified API calls on an Arista platform

Additional Information (Optional)

prgeor
prgeor previously approved these changes Nov 1, 2021
t_offset = decoded_deps.get(consts.T_OFFSET_FIELD)
result = t_slope * measured_val + t_offset
return result / self.scale
return float('NaN')
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is this decoded value returned? float('NaN')?

@prgeor
Copy link
Collaborator

prgeor commented Nov 2, 2021

@andywongarista please fix the build errors due to your changes:

self = <tests.sonic_xcvr.test_xcvr_field.TestDateField object at 0x7f92f90350d0>

    def test_decode(self):
        field = mem_map.get_field("Date")
        data = bytearray(b'\x32\x31\x31\x30\x32\x30\x00')
>       decoded = field.decode(data)

tests/sonic_xcvr/test_xcvr_field.py:234: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
sonic_platform_base/sonic_xcvr/fields/xcvr_field.py:247: in decode
    date = super(DateField, self).decode(raw_data, **decoded_deps)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <sonic_platform_base.sonic_xcvr.fields.xcvr_field.DateField object at 0x7f92f9182890>
raw_data = bytearray(b'211020\x00'), decoded_deps = {}

    def decode(self, raw_data, **decoded_deps):
>       return struct.unpack(self.format, raw_data)[0].decode(self.encoding)
E       error: unpack requires a string argument of length 8

sonic_platform_base/sonic_xcvr/fields/xcvr_field.py:175: error

@prgeor
Copy link
Collaborator

prgeor commented Nov 10, 2021

@andywongarista i think sonic-mgmt tests for the API set_power_override() will fail since its not applicable for SFF-8472 https://github.com/Azure/sonic-mgmt/blob/master/tests/platform_tests/api/test_sfp.py#L516

@andywongarista
Copy link
Contributor Author

@andywongarista i think sonic-mgmt tests for the API set_power_override() will fail since its not applicable for SFF-8472 https://github.com/Azure/sonic-mgmt/blob/master/tests/platform_tests/api/test_sfp.py#L516

sonic-net/sonic-mgmt#4668

@prgeor
Copy link
Collaborator

prgeor commented Nov 12, 2021

@andywongarista following tests will fail for SFP, QSFP+, QSFP28 for platforms using SfpOptoeBase

  1. test_reset()
  2. test_tx_disable()
  3. test_tx_disable_channel()
  4. test_lpmode()
  5. test_power_override()

Will you be able to fix this in the sfp-refactor code

@prgeor
Copy link
Collaborator

prgeor commented Nov 14, 2021

@andywongarista could you resolve merge conflict?

1 similar comment
@prgeor
Copy link
Collaborator

prgeor commented Nov 16, 2021

@andywongarista could you resolve merge conflict?

@prgeor prgeor merged commit 07e75bc into sonic-net:master Nov 17, 2021
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.

3 participants