sonic-buildimage/platform
Junchao-Mellanox 7543993af3
[202012] [Mellanox] Fix issue: SFP eeprom corrupted after replacing cable with different sfp type (#13543)
- Why I did it
There are 3 tasks in xcvrd:

main task, run a loop to recover missing SFP static information to DB every 1 minute
SFP state task, a process which listens cable plug in/out event, insert SFP static information to DB while a cable is inserted
SFP DOM update task, a thread which handles cable DOM information update every 1 minute
Let assume user replaces QSFP with QSFP-DD. There are two issues:

Only SFP state task listens cable plug in/out event, main task and SFP DOM update task does not know SFP type has changed, they still “think” the SFP type is QSFP. So, main task and SFP DOM update task uses QSFP standard to parse QSFP-DD EEPROM which causes corrupted data.
There is a race condition between main task and SFP state task. They both insert SFP static information to DB. Depends on timing, it is possible that main task using wrong SFP type to override SFP static information.
The PR is to fix these two issues.

There is no such issue on 202205 and above because there is a refactor for xcvrd:

SFP state task was changed from process to thread, so that all 3 tasks share the same memory space, they always have correct SFP type.
Recover missing SFP information logical was moved from main task to SFP state task. There is no race condition anymore.

- How I did it
It is difficult to back port latest xcvrd because there are many refactor/new features in xcvrd after 202012 release. It will be huge effort to do so. Based on that, we decided to fix the issue on Nvidia platform API side. The fix is that: refreshing SFP type before any SFP API which accessing SFP EEPROM. Refreshing SFP type before any SFP API would cause a small performance down: Due to my test on 202012 branch, accessing transceiver INFO and DOM INFO for 32 ports takes 1.7 seconds before the change. The number changes to 2.4 seconds after the change. I suppose the performance down is acceptable.

- How to verify it
Manual test
Regression
2023-02-19 09:47:32 +02:00
..
barefoot [ BFN ] update SDE package for BFN platform (#10049) 2022-03-04 20:43:08 -08:00
broadcom [202012] Update SAI version to 4.3.7.1-7 (#13431) 2023-01-19 11:30:40 -08:00
cavium [202012][Monit] Deprecate the feature of monitoring the critical processes by Monit (#7823) 2021-06-09 09:04:22 -07:00
centec [202012][Monit] Deprecate the feature of monitoring the critical processes by Monit (#7823) 2021-06-09 09:04:22 -07:00
centec-arm64 [arm] support compile sonic arm image on arm server (#7285) 2021-05-02 08:11:56 -07:00
checkout Update cisco-8000.ini (#13793) 2023-02-14 11:05:09 -08:00
generic [dockers] Rename 'docker-snmp-sv2' to 'docker-snmp' (#4699) 2020-06-11 16:04:23 -07:00
innovium Innovium: update 202012 build files (#8524) 2021-09-14 19:17:01 -07:00
marvell [202012][Monit] Deprecate the feature of monitoring the critical processes by Monit (#7823) 2021-06-09 09:04:22 -07:00
marvell-arm64 [202012][Monit] Deprecate the feature of monitoring the critical processes by Monit (#7823) 2021-06-09 09:04:22 -07:00
marvell-armhf [armhf][sonic-installer] Fix issue of the sonic-installer install a image after sonic-installer clean (#12609) 2023-01-12 23:30:07 +00:00
mellanox [202012] [Mellanox] Fix issue: SFP eeprom corrupted after replacing cable with different sfp type (#13543) 2023-02-19 09:47:32 +02:00
nephos [202012][Monit] Deprecate the feature of monitoring the critical processes by Monit (#7823) 2021-06-09 09:04:22 -07:00
p4 Add support to start fdbsyncd when orchagent docker starts (#5979) 2020-12-24 18:36:01 -08:00
pddf [PDDF] Build and install Python 3 package (#6286) 2021-02-23 23:56:01 +00: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 [SAI-PTF][202012]Fix sai ptf 202012 (#12724) 2022-11-16 20:32:24 -08:00