Separate decoding/updating in update_eeprom_db#40
Separate decoding/updating in update_eeprom_db#40zzhiyuan wants to merge 1 commit intosonic-net:masterfrom
Conversation
|
@kevinwangsk / @keboliu: Can you please help review? |
keboliu
left a comment
There was a problem hiding this comment.
I don't oppose to refactor syseeprom daemon and the plugin, but some point needs to highlight:
-
please be noted that sonic-utility scripts "decode-syseeprom" also rely on this eeprom plugin, and on some platform it very critical, because during the first-time reboot need to use this script to decode the system eeprom and get the switch base mac, please refer to https://github.com/Azure/sonic-utilities/blob/master/scripts/decode-syseeprom and https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-config-engine/sonic_device_util.py#L68. Which we definitely don't want to break.
-
Thanks for creating the symbol link, I have planned to do it but not yet.
-
would like to see a whole solution including a PR to the daemon parts.
Does this change break platform initialization? It will break "decode-syseeprom --init" because that will call update_eeprom_db, but in sonic_device_util it does not call it with --init. Additionally, might want to consider removing that option with the existence of syseepromd. I've put in a default dict return for eeprom_base.get_eeprom_dict so "decode-syseeprom --init" will not fail, let me know if you'd like this behavior changed.
I think for the daemon, all that will need to change is call get_eeprom_dict from the plugin, and update the database with the result. I think this is a fundamentally better implementation than having the platform plugins interact with the database. Then after that is implemented, update_eeprom_db can be removed from platform plugin. I'm not sure if I want to take on all of that yet, but this change will allow platform vendors to implement "get_eeprom_dict" without worrying about the database. |
I am ok as long as "decode-syseeprom -m" not broken and "--init" option be safely removed.
IMO if only submit this PR, the daemon will be broken until someone offers a fix, this is what we don't want to see. |
I think it would be best for the syseeprom daemon to publish the information to the database. However, for now I want to separate the decoding and the publishing, so that platform plugins can simply implement get_eeprom_dict and not worry about publishing. Please let me know why or why not the publishing is not handled in the daemon instead. Also created symlink for sonic_eeprom that points to the exact same files in sonic_platform_base/sonic_eeprom.
With this change, "decode-syseeprom -m" is not broken, and neither is the daemon. The logic for eeprom_tlvinfo has not changed, and eeprom_base now returns a default dict to be put into the database. |
I can approve this change ONLY if all "decode-syseeprom" command are all OK, including "-s","-m", "--init", if any one of them be broken, we should either have fix here or in the "decode-syseeprom" scripts. I didn't test the "decode-syseeprom" scripts with your change, so would like to get your confirmation here. |
It should not break any of decode-syseeprom functions. However I have only tested on Arista platforms, I think it would be worthwhile for you to confirm that this is fine in ONIE platforms, but from looking at the changes there should not be any behavioral differences. |
affe6be to
c31636e
Compare
… 202412 (sonic-net#40) ```<br>* 12c5296 - (HEAD -> 202412) Merge branch '202411' of https://github.com/sonic-net/sonic-platform-common into 202412 (2025-02-27) [Sonic Automation] * c735073 - (origin/202411) [202411][cmis] Fix cmis.get_error_description speed for passive module (sonic-net#538) (2025-02-12) [Aryeh Feigin] * b7e75d8 - Add 800G innolight PNs (sonic-net#540) (2025-02-07) [mssonicbld]<br>```
|
This PR has been open since July 2019 (~7 years) and has merge conflicts with the current codebase. The eeprom infrastructure has been significantly reworked since then — the files this PR modifies have changed substantially. Given the age and conflicts, this is likely no longer mergeable without a complete rewrite against current master. Suggesting closure as stale. If the underlying improvement (separating decoding from DB publishing) is still desired, it would be better addressed in a fresh PR against the current codebase. |
I think it would be best for the syseeprom daemon to publish the
information to the database. However, for now I want to separate the
decoding and the publishing, so that platform plugins can simply
implement get_eeprom_dict and not worry about publishing. Please let me
know why or why not the publishing is not handled in the daemon instead.
Also created symlink for sonic_eeprom that points to the exact same
files in sonic_platform_base/sonic_eeprom.