[warmboot]: Add SRv6 MySID warmboot support - #2012
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
This PR has backport request label(s) for branch(es): 202605, but is missing required test information. Please make sure you tick the tested branch(es) in the Tested branch section and provide test evidence (e.g., 202605: <test result>) in the Test result section as well in your PR description. ---Powered by SONiC BuildBot
|
|
Hi — this PR is flagged for cherry-pick to the 202605 branch, but it appears to be a new feature/enhancement rather than a bug fix. The 202605 branch is in stabilization, so we're limiting cherry-picks to bug fixes and critical platform support. Could you please retarget this to the next release branch? If there's a specific customer requirement driving this for 202605, please comment with the justification and we can reconsider. Comment by @vaibhavhd via automated tooling |
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
77c5070 to
924e666
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This PR extends syncd warmboot reconciliation to properly support SAI_OBJECT_TYPE_MY_SID_ENTRY (SRv6 MySID) by tracking MySID entries in AsicView, enabling VID-aware best-candidate matching, and re-serializing the entry key after VID exchange. This prevents warmboot from mis-matching existing MySID entries and taking erroneous create/remove paths.
Changes:
- Add
m_soMySidEntriestracking inAsicViewand maintain it across dump/create/remove flows. - Add
BestCandidateFindermatching for MySID entries via VID-exchange + serialized-key dictionary lookup. - Update
ComparisonLogicto re-serialize MySID entry object IDs after struct VID exchange; add dedicated unit tests.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
syncd/AsicView.h |
Adds a dedicated map to track MySID entries in the ASIC view. |
syncd/AsicView.cpp |
Deserializes, stores, creates, and removes MySID entries in the view’s indexes. |
syncd/BestCandidateFinder.h |
Declares MySID-specific best-candidate matcher. |
syncd/BestCandidateFinder.cpp |
Implements VID-aware MySID dictionary lookup and wires it into best-match dispatch. |
syncd/ComparisonLogic.cpp |
Re-serializes MySID entry IDs after VID exchange when cloning from temporary objects. |
unittest/syncd/TestMySidWarmboot.cpp |
Adds unit coverage for MySID dump lifecycle and best-candidate match/miss paths. |
unittest/syncd/Makefile.am |
Registers the new unit test source in the syncd test binary. |
tests/aspell.en.pws |
Adds “sid” to the aspell personal word list. |
| * can indicate a bug or somehow duplicated entries. | ||
| */ | ||
|
|
||
| SWSS_LOG_THROW("found my sid entry %s in current view, but it status is %d, FATAL", |
Signed-off-by: Nazarii Hnydyn nazariig@nvidia.com
Description of PR
The bug
During warmboot, syncd builds two ASIC views and reconciles them:
For non-object-id entry types (route, NAT, inseg, …), matching is not a simple OID compare.
The entry key itself embeds other VIDs (e.g. virtual router).
Those VIDs differ between the temporary and current views,
so syncd must translate them via the RID map before it can look the entry up.
SAI_OBJECT_TYPE_MY_SID_ENTRY(SRv6 MySID) was never wired into that path. As a result:AsicView::fromDump/asicCreateObject/asicRemoveObjecthad nom_soMySidEntriesmap — MySID fell into the unsupported/default branchesBestCandidateFinderhad no MySID matcher, so warmboot could not reconcileexisting MySID entries after VID translation
ComparisonLogicdid not re-serialize the MySID object id after exchangingstruct VIDs
Warmboot with SRv6 MySID entries programmed therefore fails to match and preserve
those objects (create/remove/throw paths instead of a clean best-candidate match).
Why MySID needs the same treatment as inseg/route
A MySID entry key contains
switch_idandvr_idVIDs plus the SID and locator lengths:After warmboot, the temporary view may have
vr_id = 0x3000000000002while thecurrent view has the same VR as
vr_id = 0x3000000000001, both mapping to the same RID.Dictionary lookup on the temporary serialized key will miss unless
vr_idis rewrittento the current VID first — exactly the pattern already used for inseg / route / NAT.
The fix
Teach the warmboot comparison path about
SAI_OBJECT_TYPE_MY_SID_ENTRY,mirroring the existing inseg-entry handling:
AsicView— addm_soMySidEntries; deserialize into it infromDump;maintain it in
asicCreateObject/asicRemoveObjectBestCandidateFinder::findCurrentBestMatchForMySidEntry— copy the temporarymeta key,
exchangeTemporaryVidToCurrentVid, serialize, then dictionary-lookupin
m_soMySidEntriesComparisonLogic— re-serializem_str_object_idwithsai_serialize_my_sid_entryafter VID exchange when creating from a temporary objectmissing mapping, missing entry, and already-processed throw
With that, warmboot can keep existing MySID entries instead of tearing them down
and recreating them (or failing).
Type of change
Approach
What is the motivation for this PR?
SRv6 MySID entries must survive warmboot.
Without ASIC-view tracking and VID-aware best-candidate matching,
syncd cannot reconcile
SAI_OBJECT_TYPE_MY_SID_ENTRYbetween the temporaryand current views.
Work item tracking
How did you do it?
m_soMySidEntriesand MySID handling inAsicView(
fromDump,asicCreateObject,asicRemoveObject)findCurrentBestMatchForMySidEntry(VID exchange → serialize → dictionary lookup), same approach as inseg
SAI_OBJECT_TYPE_MY_SID_ENTRYintoBestCandidateFinder::findCurrentBestMatchandComparisonLogic::createNewObjectFromTemporaryObjectunittest/syncd/TestMySidWarmboot.cppcovering dump lifecycleand best-candidate match / miss / already-processed paths
How did you verify/test it?
TestMySidWarmbootcases pass:asicView_fromDump_deserializes_my_sid_entryasicView_create_and_remove_my_sid_entrymy_sid_entry_serializes_with_exchanged_vr_vidbestCandidateFinder_matches_my_sid_entry_after_vid_exchangebestCandidateFinder_returns_null_when_vid_mapping_missingbestCandidateFinder_returns_null_when_entry_missing_in_current_viewbestCandidateFinder_throws_when_entry_already_processedremain in ASIC/APPL_DB without recreate storms in syncd logs
Any platform specific information?
Documentation
A picture of a cute animal (not mandatory but encouraged)