[neighorch]: Track remote next hops on inband RIF#4769
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b6b568a1-5d2a-4309-b1ac-ef21ca155079 Signed-off-by: Xichen96 <lukelin0907@gmail.com>
|
/azp run |
|
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). |
There was a problem hiding this comment.
Pull request overview
This PR fixes NeighOrch bookkeeping for remote-system-port next hops by making the inband-normalized next-hop identity (alias/key, SAI RIF selection, sync map entry, and interface refcount) consistent across normal add, bulk completion, and removal paths.
Changes:
- Use the normalized
nexthop.alias(inband) to select the RIF and to increment/decrement router-interface refcounts in next-hop add/remove paths. - Normalize the key in the bulk completion path so bulk-created next hops are tracked/removable via the same inband key.
- Add focused mock test coverage validating inband RIF usage, inband-key storage, and correct refcount balancing for both non-bulk and bulk completion.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| orchagent/neighorch.cpp | Normalizes remote-system-port next-hop identity to inband across RIF selection, sync-map keys, and interface refcount updates (including bulk completion). |
| tests/mock_tests/neighorch_ut.cpp | Adds unit test coverage for remote-system-port next-hop normalization (inband RIF, key, and refcount behavior). |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b6b568a1-5d2a-4309-b1ac-ef21ca155079 Signed-off-by: Xichen96 <lukelin0907@gmail.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
/azpw run |
|
Retrying failed(or canceled) jobs... |
|
Retrying failed(or canceled) stages in build 1170069: ✅Stage TestAsan:
✅Stage Test:
|
|
/azp run |
|
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). |
Remote system-port next hops remain on the global inband RIF when their neighbor moves between remote ports. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b6b568a1-5d2a-4309-b1ac-ef21ca155079 Signed-off-by: Xichen96 <lukelin0907@gmail.com>
|
/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
|
What I did
Remote-system-port next hops are represented through the local inband interface, but NeighOrch previously used two different interface identities for the same object.
Root cause
addNextHop()already rewrote the next-hop key from the remote system port to the inband interface:The rest of the bookkeeping did not consistently follow that normalized key:
This produced three mismatches:
Fix
This PR makes the normalized inband next-hop key authoritative:
The changes are limited to remote-system-port next-hop identity and bookkeeping:
addNextHop()obtains the RIF fromnexthop.aliasafter remote-to-inband normalization.nexthop.alias.Why I did it
The next-hop key, SAI RIF, sync map entry, and interface refcount describe one logical dependency. Using different aliases across those surfaces can leak references, prevent deletion, or leave bulk-created next hops unreachable by the removal path.
This defect predates the interface deletion and VRF-rehome work. It is therefore isolated from PRs #4746 and #4764 rather than being included as incidental hardening.
Scope
This PR does not change boot-order handling when the inband port is not yet available. The existing assertion behavior is handled in a separate follow-up so identity/bookkeeping and retry semantics remain independently reviewable.
How I verified it
Focused mock coverage configures a remote system port and local inband interface, then verifies:
The available single-ASIC hardware testbed cannot exercise remote system ports, so this path is covered with focused unit tests and exact-head CI.
Current exact-head master PR build
df387c75cabd5ec325682a1304d1b6ac74882a1aTest vstest, andTestAsan vstestlanes passed.202605 PR-build validation
202605stack after [intfsorch]: Fence new RIF dependencies during interface removal #4746 and [intfsorch]: Retry loopback action update failures #4766, and before [neighorch]: Avoid inserting missing bulk neighbors #4772 and dependent PR [neighorch]: Retry until inband port is available #4770.d4b0502ecdac76d56fdf063a633045c0fb0de977Tested for 202605 branchlabel must remain absent until that exact result is complete.Details if related