sonic-net / sonic-platform-daemons

Platform module daemons for SONiC
Other
25 stars 159 forks source link

[202305] Move firmware version fields to TRANSCEIVER_FIRMWARE_INFO table (#435) #436

Closed mihirpat1 closed 9 months ago

mihirpat1 commented 9 months ago

Cherry-pick for https://github.com/sonic-net/sonic-platform-daemons/pull/435/files

Description

We are currently planning move the "active_firmware" and "inactive_firmware" fields from TRANSCEIVER_INFO table to TRANSCEIVER_FIRMWARE_INFO table. MSFT ADO - 26788447

The changes in this PR should be merged along with https://github.com/sonic-net/sonic-platform-common/pull/440 and https://github.com/sonic-net/sonic-mgmt/pull/11708

Motivation and Context

Both active and inactive firmware version fields can dynamically change during firmware upgrade unlike other fields in TRANSCEIVER_INFO table which are static. Hence, we are planning to create a separate table to store the firmware version so that these fields can be updated periodically by DomInfoTaskUpdate thread. A separate PR will be raised to enable polling of firmware version fields by DomInfoTaskUpdate thread.

How Has This Been Tested?

A separate PR is planned to be created for modifying show int transceiver eeprom CLI to support displaying firmware version fields from TRANSCEIVER_FIRMWARE_INFO table.

Following types of transceivers have been tested

  1. CMIS transceiver - Ensured TRANSCEIVER_FIRMWARE_INFO table is created
  2. CMIS transceiver with a flat memory - Ensured TRANSCEIVER_FIRMWARE_INFO table is created
  3. Non-CMIS transceiver (SFF8636) - Ensured TRANSCEIVER_FIRMWARE_INFO table is not created

Also, for CMIS transceiver, transceiver OIR has been tested to ensure that TRANSCEIVER_FIRMWARE_INFO table gets deleted after transceiver removal and the table gets created after transceiver insertion.

The "active_firmware" and "inactive_firmware" fields are not seen in TRANSCEIVER_INFO table now.

admin@sonic:/home/admin# redis-cli -n 6 hgetall "TRANSCEIVER_FIRMWARE_INFO|$lport"
1) "active_firmware"
2) "0.5.0"
3) "inactive_firmware"
4) "0.3.6"

Additional Information (Optional)