[Nexthop] Fix MoD ingress-port check on NH-4010-F (hw logical port)#1342
[Nexthop] Fix MoD ingress-port check on NH-4010-F (hw logical port)#1342sazeed-nexthop wants to merge 1 commit into
Conversation
Signed-off-by: sazeed-nexthop <sazeed@nexthop.ai>
|
Hi @sazeed-nexthop! Thank you for your pull request and welcome to our community. Action RequiredIn 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. ProcessIn 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 If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Summary
AgentMirrorOnDropStatelessTest.DefaultRouteDropand.AclDropfail on NH-4010-F (Tomahawk5 / XGS), on cold and warm boot.validateMirrorOnDropPacketasserts that the MoD packet's ingress-port equals the FBOSS logicalPortID. On XGS the PSAMPingressPortfield actually carries the Broadcom hardware logical port id (the low bits of the SAI port object id), which is a different numbering from the FBOSSPortID.The failure shows up where the injection port's
PortIDdiffers from its hardware logical port. On NH-4010-F the first interface port mapsPortID 1 → hw logical port 3, so the assertion sees3 vs 1. Platforms where the two happen to coincide for the injection port pass the old assertion only by coincidence, soingressPort == PortIDwas silently fragile.Fix
Add a per-ASIC
ingressPortIsHwLogicalPort()to theMirrorOnDropImplstrategy:true→validateMirrorOnDropPackettranslates the injectionPortIDviaSwSwitch::getHwLogicalPortId()before comparing. The lookup is wrapped inWITH_RETRIESbecause the stats-backed mapping can lag a warm boot.false→ unchanged; its punt-header ingress-port encoding hasn't been characterized against hardware yet.On platforms where
PortID == hwLogicalPortthis 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.DefaultRouteDropand.AclDropnow pass on both cold and warm boot (previously failed warm boot withingressPort 3 vs 1).