[code sync] Merge code from sonic-net/sonic-swss:202605 to 202606 - #292
Merged
Conversation
mssonicbld
commented
Sep 2, 2026
Collaborator
…#4675) ## What I did For VNET routes using `custom_bfd` monitoring, resolve the RIF interface alias for **directly-connected local endpoints** before calling `NeighOrch::hasNextHop` / `getNextHopId` / ref-count APIs. Applied symmetrically in both the single-NH path (`createNextHopGroup`) and the multi-NH path (`addNextHopGroup`). ## Why I did it VNET routes with `monitoring=custom_bfd` whose **primary** endpoint is a directly-connected local DPU IP fail to install. The route stays in `inactive` state in `STATE_DB` even when: - The BFD session is `Up` and a notification reaches vnetorch - The kernel ARP table has the neighbor as `REACHABLE` - `APP_DB:NEIGH_TABLE:<intf>:<DPU-IP>` exists (NeighOrch has the neighbor as `IP@<intf>`) ### Root cause The `NextHopGroupKey` for VNET routes is constructed from `VNET_ROUTE_TUNNEL_TABLE.endpoint`, which only carries IPs (no interface). For directly-connected local endpoints the `NextHopKey` carries an **empty alias** (`<IP>@`). The lookup `NeighOrch::hasNextHop(<IP>@<empty>)` misses the stored entry `<IP>@<intf>`, and `createNextHopGroup` returns `false`: ``` NOTICE swss#orchagent: createNextHopGroup: Next hop 100.117.156.35@ not found in neighorch, skipping. WARNING swss#orchagent: updateVnetTunnelCustomMonitor: Failed to create primary based custom next hop group. Cannot proceed. ``` Note the empty alias after the `@`. The corresponding APP_DB entry is properly keyed: ``` $ redis-cli -n 0 keys '*NEIGH*' | grep 100.117.156.35 NEIGH_RESOLVE_TABLE:Vlan32:100.117.156.35 NEIGH_TABLE:Vlan32:100.117.156.35 ``` So NeighOrch stores `100.117.156.35@Vlan32` while vnetorch looks up `100.117.156.35@<empty>`. The Down path (`NeighOrch::updateNextHop`, triggered by `BfdUpdate`) correctly resolves the alias and logs `setNextHopFlag on <IP> seen on port Vlan32`. This PR brings the create/Up path to parity. ### Related Companion fix on the HA-manager / producer side: [sonic-net/sonic-dash-ha#152](sonic-net/sonic-dash-ha#152) (adds interface name to `NEIGH_RESOLVE_TABLE` keys for VLAN interfaces). That PR ensures the neighbor gets resolved with the correct interface. **This PR closes the consumer-side gap** so vnetorch can find the resolved neighbor. ## How I verified it * Tested in lab: Primary: ~$ redis-cli -n 6 hgetall "VNET_ROUTE_TUNNEL_TABLE|Vnet_55|3.2.1.0/32" 1) "active_endpoints" 2) "20.0.200.1" 3) "state" 4) "active" Secondary :~$ redis-cli -n 6 hgetall "VNET_ROUTE_TUNNEL_TABLE|Vnet_55|3.2.1.0/32" 1) "active_endpoints" 2) "10.1.0.32" 3) "state" 4) "active" * UT: python3 -m py_compile tests/test_vnet.py sudo -n pytest -q --imgname=docker-sonic-vs:pr4592-5600c4c9-orchagent \ test_vnet.py::TestVnetOrch::test_vnet_orch_local_endpoint_alias_resolution 1 passed in 58.95s ## Details if related This bug only manifests in the `custom_bfd` monitoring code path that goes through `updateCustomBfdState` → `selectNextHopGroup` → `createNextHopGroup`. The non-monitoring path is unaffected because it builds `NextHopKey` with the interface already resolved upstream. The fix uses `NeighOrch::getNeighborEntry(IpAddress, NeighborEntry&, MacAddress&)`, which is the existing API for IP-to-alias resolution. The resolution is conditional on `isLocalEp && alias.empty()` so it has no effect on non-local endpoints or cases where the alias was already populated. Signed-off-by: zhangjing <zhangjing@microsoft.com> Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Collaborator
Author
|
/azp run |
|
Azure Pipelines: 1 pipeline(s) were filtered out due to trigger conditions. |
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.