sonic-buildimage/platform/mellanox/mlnx-platform-api/tests
Stephen Sun 9f0dce0313
[Mellanox] Optimize SFP modules initialization (#7537)
Originally, SFP modules were always accessed from platform daemons, and arbitrary SFP modules can be accessed in the daemon. So all SFP modules were initialized in one shot once one of the following chassis APIs called
- get_all_sfps
- get_sfp_numbers
- get_sfp

Recently, we noticed that SFP modules can also be accessed from CLI, eg. the latest refactor of `sfputil`.

In this case, only one SFP module is accessed in the chassis object's life cycle.
To initialize all SFP modules in one shot is waste of time and causes the CLI to take much more time to finish.
So we would like to optimize the initialization flow by introducing a two-phase initialization approach:
- Partial initialization, which means the `chassis._sfp_list` has been initialized with proper length and all elements being `None`
- Full initialization, which means all elements in `chassis._sfp_list` are created

If the relevant function is called,
- `get_sfp`, only partial initialization will be done, and then the specific SFP module is initialized.
- `get_all_sfps` or `get_num_sfps`, full initialization will be done, which means all SFP modules are initialized.

Signed-off-by: Stephen Sun <stephens@nvidia.com>
2021-05-06 10:14:48 -07:00
..
__init__.py Add thermal control support for SONiC (#3949) 2020-03-09 10:41:10 -07:00
duplicate_action.json [Mellanox] Fix thermal control bugs (#4298) 2020-03-25 10:54:07 -07:00
duplicate_condition.json [Mellanox] Fix thermal control bugs (#4298) 2020-03-25 10:54:07 -07:00
empty_action.json [Mellanox] Fix thermal control bugs (#4298) 2020-03-25 10:54:07 -07:00
empty_condition.json [Mellanox] Fix thermal control bugs (#4298) 2020-03-25 10:54:07 -07:00
mock_platform.py [Mellanox] Enhancement for fan led management (#4437) 2020-05-13 10:01:32 -07:00
policy_with_same_conditions.json [Mellanox] Fix thermal control bugs (#4298) 2020-03-25 10:54:07 -07:00
test_fan_api.py [Mellanox] Implement new platform API for SONiC physical entity mib extension (#5645) 2020-11-16 18:56:03 -08:00
test_sfp.py [Mellanox] Optimize SFP modules initialization (#7537) 2021-05-06 10:14:48 -07:00
test_thermal_policy.py Fix dynamic minimum fan table issue caused by python3 (#6690) 2021-02-07 11:21:44 +02:00
thermal_policy.json [Mellanox] thermal control enhancement for dynamic minimum fan speed and PSU fan speed policy (#4403) 2020-04-21 08:09:53 -07:00