sonic-buildimage/platform
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
..
barefoot [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00
broadcom DellEMC: Z9332f SFP enhancements (#7457) 2021-05-05 10:03:11 -07:00
cavium [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00
centec [Centec][arm64] support new board E530-48s4x and E530-24x2q (#7189) 2021-05-01 10:37:07 -07:00
centec-arm64 [Centec][arm64] support new board E530-48s4x and E530-24x2q (#7189) 2021-05-01 10:37:07 -07:00
generic [dockers] Rename 'docker-snmp-sv2' to 'docker-snmp' (#4699) 2020-06-11 16:04:23 -07:00
innovium [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00
marvell [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00
marvell-arm64 [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00
marvell-armhf [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00
mellanox [Mellanox] Optimize SFP modules initialization (#7537) 2021-05-06 10:14:48 -07:00
nephos [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00
p4 Add support to start fdbsyncd when orchagent docker starts (#5979) 2020-12-24 18:36:01 -08:00
pddf Invoking python3 installation for PDDF 2.0 PAI package (#7100) 2021-04-08 08:21:17 -07:00
template Add gearbox phy device files and a new physyncd docker to support VS gearbox phy feature (#4851) 2020-09-25 08:32:44 -07:00
vs [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00