[fpmsyncd]: add nhgmgr to support RIB/FIB design - #4395
Open
LARLSN wants to merge 39 commits into
Open
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
LARLSN
force-pushed
the
dev-ribfib-nhgmgr
branch
from
March 26, 2026 05:44
47e7733 to
83a9d94
Compare
Collaborator
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
LARLSN
force-pushed
the
dev-ribfib-nhgmgr
branch
from
March 26, 2026 05:46
83a9d94 to
851dc93
Compare
Collaborator
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
Collaborator
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
LARLSN
force-pushed
the
dev-ribfib-nhgmgr
branch
from
March 26, 2026 05:54
851dc93 to
44f18f3
Compare
Collaborator
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
LARLSN
force-pushed
the
dev-ribfib-nhgmgr
branch
2 times, most recently
from
March 26, 2026 05:59
a3ced51 to
4d06431
Compare
Contributor
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
This was referenced Mar 30, 2026
Collaborator
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
1. Not validate the dependency ID in nhg mgr.
2. Update dependents handle. when A -> B, add dependents of A when add the entry for A, not updated when added the B.
3. Add deubg info of dependency.
Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
Fix critical bugs in nhgmgr: - Fix operator< strict weak ordering violation in SonicNHGObjectKey - Fix use-after-free in SonicGateWayNHGTable::updateEntry - Fix dangling pointers in cleanUp methods - Fix SonicIDMgr memory leak, add destructor - Fix refCount underflow protection - Fix addNewNHGFull returning success on nullptr - Remove unused m_db member - Simplify compareDependsAndDependents - Move using namespace std into namespace swss scope Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
1. add flag m_is_srv6_nhg to indicate the NHG with srv6 NHG info. 2. for the multi NHG, check the m_is_srv6_nhg flag of members to determine whether it is SRv6 NHG. Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
Allocate seg6_seg_stack with enough space for the flexible array member and pre-populate seg[0] with VPN SID data. The library's singleton constructor copies total_size bytes from nh_seg6_segs_in, so the input must include space for segments, not just the header. Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
…sonic PIC content Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
Add 9 new test cases covering: - SharedSonicNHGReuse: shared NHG deduplication via refCount - UpdateSRv6VPNNHGContent: PIC Content update on vpn_sid change - UpdateWithKeyChange: key change triggers sonic NHG rebuild - DeleteNonExistentNHG: deleting non-existent entry returns 0 - SegSrcInPICContextTable: seg_src field verification - EnableDisableNHG: enable/disable status toggle - CheckNeedUpdateFieldChanges: field-level change detection - AddWithInvalidGroupMember: invalid group member fails addEntry - SingleMemberMultiNHG: single resolved member skips sonic NHG creation Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
…aths Cover error branches in RIBNHGTable, SonicPICContentTable, SonicIDMgr, and the previously untested updateSonicPICObject function. Tests include duplicate/non-existent entry operations, unsupported type handling, reference count underflow, empty fvVector, key comparison edge cases, enable/disable NHG, SRv6 field getters, and cleanUp operations. Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
…ey creation Add 12 new test cases covering previously untested branches: - compareDependsAndDependents (depends/dependents vector changes) - compareNHGFullList (size, id, weight, num_direct mismatches) - compareNHGSRv6Fields (null vs non-null, different SID content) - checkNeedUpdate field checks (weight, vrf_id, ifindex, ifname, type, bh_type) - createSonicNormalNHGObjectKey (single/multi nexthop branches) - createSonicPICContentObjectKey (entry-based overload) - recoverSonicIDMapFromDB and getRIBNHGEntryByKey stub verification - dumpNHGGroupFull no-crash test Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
…op test Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
…ture Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
Re-add libnexthopgroup deb package from sonic-buildimage common_libs. Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
LARLSN
force-pushed
the
dev-ribfib-nhgmgr
branch
from
August 5, 2026 01:59
fa68c0e to
19767fe
Compare
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
Author
|
@selva-nexthop hi selva, Thanks a lot for the detailed review — really appreciate you taking the time to go through this carefully. I've addressed all of your comments in the latest revision:
When you have a moment, could you take another look? |
- Fail loudly on shared NHG refcount underflow instead of deleting the object, so accounting bugs are not masked - Pass sonicObjectID consistently to freeID()/removeFromDB() - Document the zebra new-NHG-id assumption for ownership transitions and the shared-key update path Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
subSonicNHGObjectRef now keeps the entry and fails loudly on refcount underflow instead of deleting the shared NHG object, so the UT should assert the entry is preserved rather than removed. Signed-off-by: linsongnan <linsongnan.lsn@alibaba-inc.com>
LARLSN
force-pushed
the
dev-ribfib-nhgmgr
branch
from
August 5, 2026 10:52
d20b597 to
ef75e39
Compare
Collaborator
|
/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.
What I did
Adding nhg mgr to realize fib block in RIB/FIB design.
Why I did it
In the RIB/FIB design, we need to add a fib block to fpmsyncd to process the NHG information received from zebra, and create corresponding Sonic NHG objects according to zebra information. Through fib block, NHG ID processing and PIC (prefix-independent convergence) can be introduced.In this way, the goal of improving routing convergence performance in RIB/FIB design can be achieved.
More details about RIB/FIB please refer RIB/FIB HLD pr: sonic-net/SONiC#2060
More details about nhg mgr please refer nhg mgr LLD pr: sonic-net/SONiC#2270
How I verified it
Details if related