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

[Mellanox] optimize new platform api #3289

Merged
merged 14 commits into from
Aug 28, 2019

Conversation

stephenxs
Copy link
Collaborator

- What I did
Optimize new platform API

- How I did it

  1. optimize SFP module operations and fix issues.
  2. split initialization of variant categories of devices and initialize each category of devices only when needed, so that unnecessary dependencies can be avoided.
  3. update watchdog logic, only initializing watchdog when referenced.
  4. support platform.py and enable to initialize variant devices on a host/docker basis
  5. update init so that sonic_platform can be imported as a whole.

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Stephen Sun added 6 commits August 4, 2019 15:09
1. don't get all output of ethtool -m sfpx when testing whether sfp is present. only fetch the first 4 bytes is enough since the purpose here is to test whether the reading operation success rather than to get the data. this is a time-saving optimize.
2. test whether sfp module present ahead of getting its capabilities, which avoid the error msg "Cannot get module EEPROM information: Input/output error" from logging.
3. fix the get_transceiver_bulk_status's issue which returns None when failed to fetch dom data. this issue will fail snmp test.
4. pass caibration to sff8472Dom.
At any time only one daemon have priviledge of accessing watchdog device.
To try accessing it from multiple daemons causes the latter ones fail and exit.
1. removing iniaializations of varient components out from constructor and providing one initializer for each.
2. only import other modules when initializing it.
by doing so, initializing time is reduced and unnecessary dependencies of chassis is removed for daemons who don't need them.
1. add platform.py
2. update __init__.py so that sonic_platform can be loaded as a whole
@stephenxs stephenxs marked this pull request as ready for review August 11, 2019 15:07
@keboliu
Copy link
Collaborator

keboliu commented Aug 13, 2019

retest this please

Stephen Sun and others added 6 commits August 23, 2019 04:28
don't initialize sfp_event until it is called
deinitialize sfp_event when chassis destructed so that sdk resources can be correctly released.
@lguohan lguohan merged commit 5c2d711 into sonic-net:master Aug 28, 2019
@stephenxs stephenxs deleted the pr-npapi-based-daemon branch August 31, 2019 00:29
@@ -0,0 +1,2 @@
__all__ = ["platform", "chassis"]
from sonic_platform import *
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • [](start = 27, length = 1)

Don't import wildcard in production code.

wangshengjun pushed a commit to wangshengjun/sonic-buildimage that referenced this pull request Nov 16, 2020
optimize SFP module operations and fix issues.

- split initialization of variant categories of devices and initialize each category of devices only when needed, so that unnecessary dependencies can be avoided.
- update watchdog logic, only initializing watchdog when referenced.
- support platform.py and enable to initialize variant devices on a host/docker basis
- update init so that sonic_platform can be imported as a whole.
mssonicbld added a commit that referenced this pull request Sep 6, 2024
…atically (#20161)

#### Why I did it
src/sonic-utilities
```
* b82115c9 - (HEAD -> master, origin/master, origin/HEAD) Add show CLI for bmp related dataset. (#3289) (48 minutes ago) [Feng-msft]
* 785d7bd5 - Fix multi-asic support to PFC config/show (#3521) (6 hours ago) [HP]
* 8f5e4b6f - Fix multi-asic behaviour for mmuconfig (#3061) (10 hours ago) [bktsim]
```
#### How I did it
#### How to verify it
#### Description for the changelog
vvolam pushed a commit to vvolam/sonic-buildimage that referenced this pull request Sep 12, 2024
…atically (sonic-net#20161)

#### Why I did it
src/sonic-utilities
```
* b82115c9 - (HEAD -> master, origin/master, origin/HEAD) Add show CLI for bmp related dataset. (sonic-net#3289) (48 minutes ago) [Feng-msft]
* 785d7bd5 - Fix multi-asic support to PFC config/show (sonic-net#3521) (6 hours ago) [HP]
* 8f5e4b6f - Fix multi-asic behaviour for mmuconfig (sonic-net#3061) (10 hours ago) [bktsim]
```
#### How I did it
#### How to verify it
#### Description for the changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants