[Generic-P4Orch] Add infra of supporting unique label to be used for SAI label attribute.#4176
[Generic-P4Orch] Add infra of supporting unique label to be used for SAI label attribute.#4176ksravani-hcl wants to merge 1 commit into
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
c7a454a to
98c3ab1
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@prsunny can you take a look at this PR to see how this can impact upstream SONiC? |
|
/azp run |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@prsunny, can you please review this PR. |
|
@ksravani-hcl , the namelabel mapper can be a PR by itself and can be used by community. |
|
@mint570 for viz |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: SRAVANI KANASANI <kanasanis@google.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
@ksravani-hcl , thanks for splitting the PR to have namelabel mapper. Please create the doc for usage examples and schematics |
@prsunny, As you suggested, the NameLabelMapper usage document is prepared and raised as a document PR sonic-net/SONiC#2383, and we have updated the description of this PR with more details, can you please review and approve these PRs. |
Description
The main purpose of this helper class(NameLabelMapper) is to create and manage unique labels for SAI objects.
A unique label is a unique string identifier for a SAI object. It is used in warm boot for syncd reconciliation.
A SAI object will need a unique label if the existing SAI attrs cannot distinguish the object from each other.
The high level flow is the following:
What I did
Adding infra of supporting unique label to be used for SAI label attribute.
Implemented the Namelabelmapper utility to map SAI object keys to unique, timestamp-based labels. Integrated this into the Orchdaemon lifecycle, enabling the serialization of these mappings to STATE_DB using the schema SAI_OBJECT_TYPE|KEY to ensure persistent identification.
Why I did it
To provide a reliable mechanism to uniquely identify hardware objects during warm boot reconciliation. This prevents resource duplication and enables orchagent to correctly correlate existing hardware state with control plane requests for hitless upgrades.
How I verified it
Validated the logic with new C++ unit tests covering label allocation and collision prevention. Confirmed the end-to-end persistence flow via successful execution of the SWSS test suite.
Details if related