Port System EEPROM handling from pfm_app.go to xfmr_platform.go - #236
Open
bibhuprasad-hcl wants to merge 2 commits into
Open
bibhuprasad-hcl wants to merge 2 commits into
bibhuprasad-hcl wants to merge 2 commits into
Conversation
|
/azp run |
bibhuprasad-hcl
marked this pull request as draft
August 6, 2026 16:26
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
bibhuprasad-hcl
force-pushed
the
pr_compmodel_eeprom
branch
from
August 6, 2026 17:07
100cb32 to
333469d
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
bibhuprasad-hcl
force-pushed
the
pr_compmodel_eeprom
branch
from
August 6, 2026 17:25
333469d to
eed31bd
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
bibhuprasad-hcl
force-pushed
the
pr_compmodel_eeprom
branch
from
August 11, 2026 07:45
eed31bd to
ae3889f
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
bibhuprasad-hcl
force-pushed
the
pr_compmodel_eeprom
branch
from
August 12, 2026 06:49
ae3889f to
ded5903
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
bibhuprasad-hcl
force-pushed
the
pr_compmodel_eeprom
branch
from
August 12, 2026 08:39
ded5903 to
1f7ae53
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
bibhuprasad-hcl
force-pushed
the
pr_compmodel_eeprom
branch
from
August 13, 2026 14:45
1f7ae53 to
fc7bd25
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
bibhuprasad-hcl
force-pushed
the
pr_compmodel_eeprom
branch
from
August 19, 2026 12:18
fc7bd25 to
326ca67
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
bibhuprasad-hcl
force-pushed
the
pr_compmodel_eeprom
branch
from
August 19, 2026 12:41
326ca67 to
a7a82ce
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
bibhuprasad-hcl
force-pushed
the
pr_compmodel_eeprom
branch
from
August 25, 2026 06:52
096d060 to
6c3b6ab
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
bibhuprasad-hcl
marked this pull request as ready for review
August 25, 2026 06:52
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
bibhuprasad-hcl
force-pushed
the
pr_compmodel_eeprom
branch
from
August 26, 2026 16:05
6c3b6ab to
6cefbd1
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
ndas7
suggested changes
Sep 2, 2026
bibhuprasad-hcl
force-pushed
the
pr_compmodel_eeprom
branch
from
September 2, 2026 07:28
6cefbd1 to
e31e326
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
bibhuprasad-hcl
force-pushed
the
pr_compmodel_eeprom
branch
from
September 2, 2026 07:32
e31e326 to
2ca2ea7
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
bibhuprasad-hcl
force-pushed
the
pr_compmodel_eeprom
branch
from
September 2, 2026 10:13
2ca2ea7 to
3febb50
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
|
@kwangsuk Please review and approve |
ndas7
approved these changes
Sep 18, 2026
Signed-off-by: Niranjani Vivek <niranjaniv@google.com>
Signed-off-by: Bibhuprasad Singh <bibhuprasad@google.com>
bibhuprasad-hcl
force-pushed
the
pr_compmodel_eeprom
branch
from
September 18, 2026 16:15
3febb50 to
5618ec6
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
To migrate System EEPROM handling to SONiC's standardized Subtree Transformer (xfmr) architecture, replacing its implementation in pfm_app.go.
How I did it
Ported System EEPROM from the legacy pfm_app.go application module into the subtree transformer translib/transformer/xfmr_platform.go. Added CompTypeSysEeprom to compTblMap along with EepromDb, getEepromDbObj(), and fillSysEepromInfo() to support full component queries as well as granular state leaf paths.
PR Merge Order:
sonic-mgmt-common/pull/224
sonic-mgmt-common/pull/236
PR link for Component test:
sonic-net/sonic-gnmi#751
Unit Test Result:
=== RUN TestEeprom_ValidSysEepromName
=== RUN TestEeprom_ValidSysEepromName/System_Eeprom_exact_match
=== RUN TestEeprom_ValidSysEepromName/eeprom_lowercase
=== RUN TestEeprom_ValidSysEepromName/chassis_prefix_match
=== RUN TestEeprom_ValidSysEepromName/invalid_component_name
=== RUN TestEeprom_ValidSysEepromName/empty_string
--- PASS: TestEeprom_ValidSysEepromName (0.00s)
--- PASS: TestEeprom_ValidSysEepromName/System_Eeprom_exact_match (0.00s)
--- PASS: TestEeprom_ValidSysEepromName/eeprom_lowercase (0.00s)
--- PASS: TestEeprom_ValidSysEepromName/chassis_prefix_match (0.00s)
--- PASS: TestEeprom_ValidSysEepromName/invalid_component_name (0.00s)
--- PASS: TestEeprom_ValidSysEepromName/empty_string (0.00s)
=== RUN TestEeprom_GetCompTypeByName
=== RUN TestEeprom_GetCompTypeByName/IC_Component_with_0_index
=== RUN TestEeprom_GetCompTypeByName/IC_Component_with_1_index
=== RUN TestEeprom_GetCompTypeByName/System_Eeprom_Component
=== RUN TestEeprom_GetCompTypeByName/Chassis_Component
=== RUN TestEeprom_GetCompTypeByName/Eeprom_Component
=== RUN TestEeprom_GetCompTypeByName/Invalid_Component
--- PASS: TestEeprom_GetCompTypeByName (0.00s)
--- PASS: TestEeprom_GetCompTypeByName/IC_Component_with_0_index (0.00s)
--- PASS: TestEeprom_GetCompTypeByName/IC_Component_with_1_index (0.00s)
--- PASS: TestEeprom_GetCompTypeByName/System_Eeprom_Component (0.00s)
--- PASS: TestEeprom_GetCompTypeByName/Chassis_Component (0.00s)
--- PASS: TestEeprom_GetCompTypeByName/Eeprom_Component (0.00s)
--- PASS: TestEeprom_GetCompTypeByName/Invalid_Component (0.00s)
=== RUN TestEeprom_KeyInDbTable_And_GetCompType
=== RUN TestEeprom_KeyInDbTable_And_GetCompType/keyInDbTable_Exists
=== RUN TestEeprom_KeyInDbTable_And_GetCompType/keyInDbTable_NonExistent
=== RUN TestEeprom_KeyInDbTable_And_GetCompType/keyInDbTable_NilDB
=== RUN TestEeprom_KeyInDbTable_And_GetCompType/getCompType_SysEeprom_FromDB
=== RUN TestEeprom_KeyInDbTable_And_GetCompType/getCompType_Wildcard
--- PASS: TestEeprom_KeyInDbTable_And_GetCompType (0.00s)
--- PASS: TestEeprom_KeyInDbTable_And_GetCompType/keyInDbTable_Exists (0.00s)
--- PASS: TestEeprom_KeyInDbTable_And_GetCompType/keyInDbTable_NonExistent (0.00s)
--- PASS: TestEeprom_KeyInDbTable_And_GetCompType/keyInDbTable_NilDB (0.00s)
--- PASS: TestEeprom_KeyInDbTable_And_GetCompType/getCompType_SysEeprom_FromDB (0.00s)
--- PASS: TestEeprom_KeyInDbTable_And_GetCompType/getCompType_Wildcard (0.00s)
=== RUN TestEeprom_GetEepromDbObj
=== RUN TestEeprom_GetEepromDbObj/Nil_DB
=== RUN TestEeprom_GetEepromDbObj/Populated_DB
--- PASS: TestEeprom_GetEepromDbObj (0.00s)
--- PASS: TestEeprom_GetEepromDbObj/Nil_DB (0.00s)
--- PASS: TestEeprom_GetEepromDbObj/Populated_DB (0.00s)
=== RUN TestEeprom_FillSysEepromInfo
=== RUN TestEeprom_FillSysEepromInfo/Fill_Full_Tree_(COMP_path)
=== RUN TestEeprom_FillSysEepromInfo/Fill_Specific_Leaf_Path_(Part-No)
=== RUN TestEeprom_FillSysEepromInfo/Fill_Specific_Leaf_Paths_(All_Cases)
--- PASS: TestEeprom_FillSysEepromInfo (0.01s)
--- PASS: TestEeprom_FillSysEepromInfo/Fill_Full_Tree_(COMP_path) (0.00s)
--- PASS: TestEeprom_FillSysEepromInfo/Fill_Specific_Leaf_Path_(Part-No) (0.00s)
--- PASS: TestEeprom_FillSysEepromInfo/Fill_Specific_Leaf_Paths_(All_Cases) (0.01s)
=== RUN TestEeprom_Subscribe_pfm_components_xfmr
=== RUN TestEeprom_Subscribe_pfm_components_xfmr/System_Eeprom_Subscription_Virtual_Table_check
--- PASS: TestEeprom_Subscribe_pfm_components_xfmr (0.00s)
--- PASS: TestEeprom_Subscribe_pfm_components_xfmr/System_Eeprom_Subscription_Virtual_Table_check (0.00s)
=== RUN TestEeprom_DbToYang_pfm_components_xfmr
--- PASS: TestEeprom_DbToYang_pfm_components_xfmr (0.00s)
=== RUN TestEeprom_Xfmr_KeyExtractionFallback
--- PASS: TestEeprom_Xfmr_KeyExtractionFallback (0.00s)
=== RUN TestEeprom_GetSysComponents_AutoCreation
--- PASS: TestEeprom_GetSysComponents_AutoCreation (0.00s)
=== RUN TestEeprom_DbToYang_ListAll
--- PASS: TestEeprom_DbToYang_ListAll (0.00s)
PASS
Gnmi_get logs:
root@sonic:/# gnmi_get -target_addr :8080 -xpath "/components/component[name=System Eeprom]" -notls
== getRequest:notlsget -target_addr :8080 -xpath "/components/component[name=Syst
prefix: <
path: <
elem: <
name: "components"
elem: <
name: "component"
key: <
key: "name"
value: "System Eeprom"
>
encoding: JSON_IETF
== getResponse:
notification: <
timestamp: 1786517489313608653
prefix: <
update: <
path: <
elem: <
name: "openconfig-platform:components"
>
elem: <
name: "component"
key: <
key: "name"
value: "System Eeprom"
>
>
>
val: <
json_ietf_val: "{"openconfig-platform:component":[{"config":{"name":"System Eeprom"},"name":"System Eeprom","state":{"empty":false,"location":"Slot 1","name":"System Eeprom","oper-status":"openconfig-platform-types:ACTIVE","removable":false}}]}"
>
Successfully retrieved all 5 component types (EEPROM, Software Module, IC, and Transceiver).
root@sonic:/# gnmi_get -target_addr :8080 -xpath "/components/component" -notls
== getRequest:
prefix: <
path: <
elem: <
name: "components"
elem: <
name: "component"
encoding: JSON_IETF
== getResponse:
notification: <
timestamp: 1786963982734606255
prefix: <
update: <
path: <
elem: <
name: "openconfig-platform:components"
>
elem: <
name: "component"
>
>
val: <
json_ietf_val: "{"openconfig-platform:component":[{"config":{"name":"Ethernet0"},"name":"Ethernet0","state":{"empty":false,"name":"Ethernet0","oper-status":"openconfig-platform-types:ACTIVE","removable":true,"temperature":{"instant":"42.5"},"type":"openconfig-platform-types:TRANSCEIVER"}},{"config":{"name":"System Eeprom"},"name":"System Eeprom","state":{"empty":false,"location":"Slot 1","name":"System Eeprom","oper-status":"openconfig-platform-types:ACTIVE","removable":false}},{"name":"boot_loader","state":{"name":"boot_loader","parent":"chassis","software-version":"1.17.0-debian-1.17.0-1","type":"openconfig-platform-types:BOOT_LOADER"}},{"integrated-circuit":{"config":{"openconfig-p4rt:node-id":"101"},"state":{"openconfig-p4rt:node-id":"101"}},"name":"integrated_circuit1","state":{"name":"integrated_circuit1","parent":"chassis","type":"openconfig-platform-types:INTEGRATED_CIRCUIT"}},{"name":"network_stack0","software-module":{"state":{"openconfig-platform-software:module-type":"openconfig-platform-software:USERSPACE_PACKAGE_BUNDLE"}},"state":{"name":"network_stack0","oper-status":"openconfig-platform-types:ACTIVE","parent":"chassis","software-version":"HEAD.0-dirty-20260817.091218","type":"openconfig-platform-types:SOFTWARE_MODULE"}},{"name":"os0","state":{"name":"os0","oper-status":"openconfig-platform-types:ACTIVE","parent":"chassis","software-version":"6.12.41+deb13-sonic-amd64","type":"openconfig-platform-types:OPERATING_SYSTEM"}}]}"
>
Gnmi_cli log for wildcard support
root@sonic:~# /usr/sbin/gnmi_cli --address 127.0.0.1:8080 -query_type o -streaming_type ON_CHANGE -q /openconfig-platform:components/component[name=] -v 0 -target YANG --logtostderr -insecure
[et YANG --logtostderr -insecure-platform:components/component[name=] -v 0 -targ
{
"openconfig-platform:components": {
"component": {
"Ethernet0": {
"config": {
"name": "Ethernet0"
},
"name": "Ethernet0",
"state": {
"empty": false,
"name": "Ethernet0",
"oper-status": "ACTIVE",
"removable": true,
"temperature": {
"instant": 42.5
},
"type": "TRANSCEIVER"
}
},
"boot_loader": {
"name": "boot_loader",
"state": {
"name": "boot_loader",
"parent": "chassis",
"software-version": "1.17.0-debian-1.17.0-1",
"type": "BOOT_LOADER"
}
},
"integrated_circuit1": {
"integrated-circuit": {
"config": {
"node-id": 101
},
"state": {
"node-id": 101
}
},
"name": "integrated_circuit1",
"state": {
"name": "integrated_circuit1",
"parent": "chassis",
"type": "INTEGRATED_CIRCUIT"
}
},
"network_stack0": {
"name": "network_stack0",
"software-module": {
"state": {
"module-type": "USERSPACE_PACKAGE_BUNDLE"
}
},
"state": {
"name": "network_stack0",
"oper-status": "ACTIVE",
"parent": "chassis",
"software-version": "HEAD.0-dirty-20260817.091218",
"type": "SOFTWARE_MODULE"
}
},
"os0": {
"name": "os0",
"state": {
"name": "os0",
"oper-status": "ACTIVE",
"parent": "chassis",
"software-version": "6.12.41+deb13-sonic-amd64",
"type": "OPERATING_SYSTEM"
}
}
}
}
}
]