[Nexthop] Fix MoD ingress-port check on XGS (hw logical port)#1376
Open
sazeed-nexthop wants to merge 1 commit into
Open
[Nexthop] Fix MoD ingress-port check on XGS (hw logical port)#1376sazeed-nexthop wants to merge 1 commit into
sazeed-nexthop wants to merge 1 commit into
Conversation
Signed-off-by: sazeed-nexthop <sazeed@nexthop.ai>
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.
Summary
AgentMirrorOnDropStatelessTest.DefaultRouteDropand.AclDropfail on 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. When the first interface port mapsPortID 1 -> hw logical port 3, 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 a Tomahawk5 / XGS platform,
AgentMirrorOnDropStatelessTest.DefaultRouteDropand.AclDropnow pass on both cold and warm boot (previously failed warm boot withingressPort 3 vs 1).