Skip to content

[202607] Code sync from sonic-swss 202605 to sonic-swss.msft 202607 - #293

Open
yijingyan2 wants to merge 3 commits into
Azure:202607from
yijingyan2:202607-code-sync
Open

[202607] Code sync from sonic-swss 202605 to sonic-swss.msft 202607#293
yijingyan2 wants to merge 3 commits into
Azure:202607from
yijingyan2:202607-code-sync

Conversation

@yijingyan2

Copy link
Copy Markdown

What is the motivation for this PR?

Sync the latest changes from the 202605 branch and resolve merge conflicts while preserving existing functionality.

What does this PR do?

  • Synchronizes the current branch with 202605.
  • Resolves the mock-test build conflict in Makefile.am.
  • Retains both the mirror sample-port SAI wrapper and MACsec orchestrator unit test sources.
  • Removes all merge-conflict markers.

senthil-nexthop and others added 3 commits August 26, 2026 10:50
Signed-off-by: senthil-nexthop <senthil@nexthop.ai>
Signed-off-by: Senthil Krishnamurthy <senthil@nexthop.ai>
…#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>
Signed-off-by: Yijing Yan <yijingyan@microsoft.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
1 pipeline(s) were filtered out due to trigger conditions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants