GithubHelp home page GithubHelp logo

Comments (10)

wjaco avatar wjaco commented on May 25, 2024

One more question - shouldn't the reset/set_xxx() functions be performed via xcvrd since that is the driver which does port initializations, transceiver status change event handlings ? There could be potential contention issues if they are done by 2 separate contexts (depending on the underlying device access).

from sonic-platform-common.

jleveque avatar jleveque commented on May 25, 2024

Hi @wjaco. Thanks for opening this issue.

To complete the below get/set function, it is found those information are not parsed from EEPROM though there are parser handlers found.

When you refer to "parser handlers," are you referring to these methods in the SfpBase API class?

get_rx_los
get_tx_fault
get_tx_disable
get_tx_disable_channel
get_lpmode
get_power_override
tx_disable
tx_disable_channel
set_lpmode
set_power_override

If so, I do agree that all of the above should be implemented in what is currently sfputilbase.py (however, low-power mode ('get_lpmode(), set_lpmode()`) uses a dedicated pin, and is not part of the EEPROM).

Not found in the DB too - which I think is brought into by the sfputil base class only via xcvrd right ? Are these going to be available ?

True. This data should ultimately get polled by xcvrd and stored in the State DB.

One more question - shouldn't the reset/set_xxx() functions be performed via xcvrd since that is the driver which does port initializations, transceiver status change event handlings ? There could be potential contention issues if they are done by 2 separate contexts (depending on the underlying device access).

Optimally, yes, xcvrd should be the arbiter of the transceivers, which will prevent any contention.

We are currently designing a refactor of the sonic_sfp package in sonic-platform-common, which will ultimately replace sfputilbase.py and create a more complete and well-structured API for handling common SFP transceiver interactions, thus eliminating the need for platform vendors to basically re-invent the wheel by writing similar EEPROM parsing code.

Separate from the sonic_sfp refactor, we also intend to update xcvrd such that it instantiates objects to interact with the transceivers, and all interaction goes through xcvrd, thus eliminating an potential contention. Therefore, the CLI for resetting a transceiver will need to be changed to send a message to xcvrd asking it to reset a transceiver.

I am moving this issue to the sonic-platfrom-common repo for the time being until the sonic_sfp refactor is complete.

from sonic-platform-common.

wjaco avatar wjaco commented on May 25, 2024

Thanks @jleveque .
Yes, this sounds perfect. We will watch for the enhancement. And yes, I was referring to the SfpBase and DeviceBase classes only - sorry for not being specific.

Thanks and regards,
Wilson Jacob
[email protected]

from sonic-platform-common.

shyam77git avatar shyam77git commented on May 25, 2024

Thanks @jleveque for the detail update.
Making xcrvd as the owner (central entity) for all sfp/optics related operations would provide a common base for all underlying platforms.

Just trying to see, tentatively how long these enhancements/refactoring would take?
That would help us determine as to what alternative we can have think/plan at platform's infra layer until this change from xcrvd is in place.

from sonic-platform-common.

jleveque avatar jleveque commented on May 25, 2024

Just trying to see, tentatively how long these enhancements/refactoring would take?
That would help us determine as to what alternative we can have think/plan at platform's infra layer until this change from xcrvd is in place.

We are still in the early stages of the design for the refactor of sonic_sfp. I don't expect it to be done for a few months. After that we will work on refactoring xcvrd. I don't have any ETAs at the moment.

from sonic-platform-common.

sachinv-msft avatar sachinv-msft commented on May 25, 2024

@jleveque following up on this, any updates or ETA that you could share with us?

from sonic-platform-common.

prgeor avatar prgeor commented on May 25, 2024

@sachinv-msft can you please check the latest SFP-refactor code. HLD for the same.

from sonic-platform-common.

sachinv-msft avatar sachinv-msft commented on May 25, 2024

@prgeor has there been a refactored code to address this issue? how is it that i can verify we are not failing on test cases because of this?

from sonic-platform-common.

prgeor avatar prgeor commented on May 25, 2024

@sachinv-msft yes this has been addressed in SFP-refactor in latest master. Ref. SFP-refactor HLD. Dell platform (use as an example) changes to use SFP-refactor: sonic-net/sonic-buildimage#9016

from sonic-platform-common.

prgeor avatar prgeor commented on May 25, 2024

@wjaco @sachinv-msft can this be closed?

from sonic-platform-common.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.