Skip to content

[Nexthop] Fix MoD ingress-port check on XGS (hw logical port)#1376

Open
sazeed-nexthop wants to merge 1 commit into
facebook:mainfrom
nexthop-ai:fix-mod-ingress-port-check-xgs
Open

[Nexthop] Fix MoD ingress-port check on XGS (hw logical port)#1376
sazeed-nexthop wants to merge 1 commit into
facebook:mainfrom
nexthop-ai:fix-mod-ingress-port-check-xgs

Conversation

@sazeed-nexthop

Copy link
Copy Markdown

Summary

AgentMirrorOnDropStatelessTest.DefaultRouteDrop and .AclDrop fail on Tomahawk5 / XGS, on cold and warm boot. validateMirrorOnDropPacket asserts that the MoD packet's ingress-port equals the FBOSS logical PortID. On XGS the PSAMP ingressPort field actually carries the Broadcom hardware logical port id (the low bits of the SAI port object id), which is a different numbering from the FBOSS PortID.

The failure shows up where the injection port's PortID differs from its hardware logical port. When the first interface port maps PortID 1 -> hw logical port 3, the assertion sees 3 vs 1. Platforms where the two happen to coincide for the injection port pass the old assertion only by coincidence, so ingressPort == PortID was silently fragile.

Fix

Add a per-ASIC ingressPortIsHwLogicalPort() to the MirrorOnDropImpl strategy:

  • XGS returns true -> validateMirrorOnDropPacket translates the injection PortID via SwSwitch::getHwLogicalPortId() before comparing. The lookup is wrapped in WITH_RETRIES because the stats-backed mapping can lag a warm boot.
  • Tajo returns false -> unchanged; its punt-header ingress-port encoding hasn't been characterized against hardware yet.

On platforms where PortID == hwLogicalPort this returns the same value the old check used (no behavior change); where they differ it returns the real hardware port that the MoD packet carries. This mirrors the translation the DNX path already performs via its source-system-port aggregate.

Test Plan

On a Tomahawk5 / XGS platform, AgentMirrorOnDropStatelessTest.DefaultRouteDrop and .AclDrop now pass on both cold and warm boot (previously failed warm boot with ingressPort 3 vs 1).

Signed-off-by: sazeed-nexthop <sazeed@nexthop.ai>
@sazeed-nexthop
sazeed-nexthop requested a review from a team as a code owner July 13, 2026 03:39
@meta-cla meta-cla Bot added the CLA Signed label Jul 13, 2026
@sazeed-nexthop sazeed-nexthop changed the title Fix MoD ingress-port check on XGS (hw logical port) [Nexthop] Fix MoD ingress-port check on XGS (hw logical port) Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant