Skip to content

[Nexthop] Fix MoD ingress-port check on NH-4010-F (hw logical port)#1342

Open
sazeed-nexthop wants to merge 1 commit into
facebook:mainfrom
nexthop-ai:fix-mod-ingress-port-check-on-nh-4010-f
Open

[Nexthop] Fix MoD ingress-port check on NH-4010-F (hw logical port)#1342
sazeed-nexthop wants to merge 1 commit into
facebook:mainfrom
nexthop-ai:fix-mod-ingress-port-check-on-nh-4010-f

Conversation

@sazeed-nexthop

Copy link
Copy Markdown

Summary

AgentMirrorOnDropStatelessTest.DefaultRouteDrop and .AclDrop fail on NH-4010-F (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. On NH-4010-F the first interface port maps PortID 1 → hw logical port 3, so 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 truevalidateMirrorOnDropPacket 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 NH-4010-F (Tomahawk5), 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 June 27, 2026 03:14
@meta-cla

meta-cla Bot commented Jun 27, 2026

Copy link
Copy Markdown

Hi @sazeed-nexthop!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

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

Labels

1 participant