Skip to content

[Celestica] Leh800bcls: Fix SRv6 decapsulation QoS mapping and Multi-NPU packet routing - #1609

Open
gang-tao wants to merge 1 commit into
facebook:mainfrom
gang-tao:leh800bcls_agent_fix25
Open

[Celestica] Leh800bcls: Fix SRv6 decapsulation QoS mapping and Multi-NPU packet routing#1609
gang-tao wants to merge 1 commit into
facebook:mainfrom
gang-tao:leh800bcls_agent_fix25

Conversation

@gang-tao

@gang-tao gang-tao commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Pre-submission checklist

  • [ ✓ ] I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running pip install -r requirements-dev.txt && pre-commit install
  • [ ✓ ] pre-commit run
[INFO] Stashing unstaged files to /work/home/gangtao/.cache/pre-commit/patch1788758710-2761128.
clang-format.............................................................Passed
shellcheck...........................................(no files to check)Skipped
shfmt................................................(no files to check)Skipped
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check json...........................................(no files to check)Skipped
check for merge conflicts................................................Passed
ruff check...........................................(no files to check)Skipped
ruff format..........................................(no files to check)Skipped
Prevent sai_impl in fboss manifest.......................................Passed
[INFO] Restored changes from /work/home/gangtao/.cache/pre-commit/patch1788758710-2761128.

Summary

During Multi-NPU Split-Agent hardware testing on the leh800bcls platform, the SRv6 decapsulation QoS queue mapping test case (AgentSrv6DecapTest/0.VerifyDscpQueueMapping and AgentSrv6DecapTest/1.VerifyDscpQueueMapping) was failing on both NPU0 and NPU1. 

Specifically, all CPU-switched and front-panel injected IPv6-in-IPv6 decapsulated traffic was routed to the correct egress port but erroneously fell back to the minimum priority queue (Queue 0, Silver Queue) instead of matching the configured Olympic QoS map. This resulted in assertion timeouts during queue packet verification.

/var/FBOSS/fboss/fboss/agent/test/utils/QosTestUtils.cpp:242: Failure
Expected: (queuePacketsAfter) >= (queuePacketsBefore + delta), actual: 0 vs 9

Root Cause

  1. Ingress Pipeline Trap ACL Override Conflict
    All decapsulated traffic (64 packets representing all Olympic DSCPs) ended up in Queue 0.
    In AgentSrv6DecapTests.cpp, a global Trap ACL is registered during initialConfig to match the inner destination IP kV6RouteDstIp (2800:2::1/128) with the action COPY to CPU, enabling packet snooping for other payload validation test cases. 
    In the TH6 hardware pipeline, when decapsulated traffic matches this active Trap ACL, the Ingress Field Processor (IFP)'s COPY to CPU action is assigned absolute priority. This action forcefully overrides and clears the internal priority (Traffic Class, TC) of the matching packets (resetting TC = 0) at the egress stage, completely bypassing the decapsulation RIF's ingress QoS DSCP trust mapping.
  2. Low-Level SwSwitch Multi-NPU Packet Routing Bug
    VerifyDscpQueueMapping timed out with 0 packets received when executed on NPU1 (Switch 1).
    Both test cases directly called the low-level this->getSw()->sendPacketSwitchedAsync(...) API. Because no target SwitchID was provided, the multi-ASIC fallback handler silently routed all CPU-injected packets to Switch 0 (NPU0). Therefore, the egress queue counters on NPU1's ports never incremented when testing NPU1.

Solution

The QoS mapping test (VerifyDscpQueueMapping) only validates the egress port stats and does not require packet snooping. In VerifyDscpQueueMapping::setup(), we leverage the official FBOSS utility helpers utility::delAcl and utility::delMatcher to dynamically remove the specific Trap ACL ("trap-2800:2::1") before applying the configuration. Since other snoop-based tests (such as VerifySrv6DecapV6) run their own setup cycle, the global Trap ACL remains intact for them.

Replaced all low-level getSw()->sendPacketSwitchedAsync calls with this->sendPacketSwitchedAsync inside VerifyDscpQueueMapping. This helper automatically attaches the correct SwitchID under test, ensuring packets are physical-routed to the correct NPU.

Test Plan

Rebuild the split-agent hardware tests binary and execute the suite on both NPU0 and NPU1 to verify that the queue counters increment perfectly and all assertions pass under both cold-boot and warm-boot states.

  • NPU0
Running all tests took 0:01:46.618866 between 2026-09-07 09:54:54.476611 and 2026-09-07 09:56:41.095477
[ PASSED ] cold_boot.AgentSrv6DecapTest/0.VerifyDscpQueueMapping (17106 ms)
[ PASSED ] warm_boot.AgentSrv6DecapTest/0.VerifyDscpQueueMapping (10786 ms)
[ PASSED ] cold_boot.AgentSrv6DecapTest/1.VerifyDscpQueueMapping (17559 ms)
[ PASSED ] warm_boot.AgentSrv6DecapTest/1.VerifyDscpQueueMapping (10782 ms)
Summary:
   PASSED : 4
   FAILED : 0
   SKIPPED : 0
   TIMEOUT : 0

Test output stored at: hwtest_results_2026_Sep_07-09_56_41_AM.csv

  • NPU1
Running all tests took 0:01:47.990290 between 2026-09-07 09:57:16.896441 and 2026-09-07 09:59:04.886731
[ PASSED ] cold_boot.AgentSrv6DecapTest/0.VerifyDscpQueueMapping (17587 ms)
[ PASSED ] warm_boot.AgentSrv6DecapTest/0.VerifyDscpQueueMapping (10850 ms)
[ PASSED ] cold_boot.AgentSrv6DecapTest/1.VerifyDscpQueueMapping (18289 ms)
[ PASSED ] warm_boot.AgentSrv6DecapTest/1.VerifyDscpQueueMapping (10856 ms)
Summary:
   PASSED : 4
   FAILED : 0
   SKIPPED : 0
   TIMEOUT : 0

Test output stored at: hwtest_results_2026_Sep_07-09_59_04_AM.csv

@gang-tao
gang-tao requested a review from a team as a code owner September 7, 2026 07:40
@meta-cla meta-cla Bot added the CLA Signed label Sep 7, 2026
@meta-codesync

meta-codesync Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

@jchallag has imported this pull request. If you are a Meta employee, you can view this in D119364585.

auto config = this->getAgentEnsemble()->getCurrentConfig();
auto aclName = folly::to<std::string>("trap-", this->kV6RouteDstIp.str());
utility::delAcl(&config, aclName);
utility::delMatcher(&config, aclName);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should use delCPUMatcher() to rightly remove the Action. delmatcher() seems to be a NO-op here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jchallag
Thank you for your incredibly sharp and precise review! You are 100% correct, utility::delMatcher only cleans up config->dataPlaneTrafficPolicy().
Now I added a new utility::delCPUMatcher() helper in AclTestUtils to target the CPU traffic policy and updated the VerifyDscpQueueMapping setup block to use utility::delCPUMatcher(&config, aclName).
Retested the case and all passed.

  • NPU0
Running all tests took 0:01:47.259575 between 2026-09-10 05:05:22.888876 and 2026-09-10 05:07:10.148451
[ PASSED ] cold_boot.AgentSrv6DecapTest/0.VerifyDscpQueueMapping (16878 ms)
[ PASSED ] warm_boot.AgentSrv6DecapTest/0.VerifyDscpQueueMapping (10908 ms)
[ PASSED ] cold_boot.AgentSrv6DecapTest/1.VerifyDscpQueueMapping (17789 ms)
[ PASSED ] warm_boot.AgentSrv6DecapTest/1.VerifyDscpQueueMapping (10816 ms)
Summary:
   PASSED : 4
   FAILED : 0
   SKIPPED : 0
   TIMEOUT : 0

Test output stored at: hwtest_results_2026_Sep_10-05_07_10_AM.csv

  • NPU1
Running all tests took 0:01:47.729228 between 2026-09-10 05:07:38.133611 and 2026-09-10 05:09:25.862839
[ PASSED ] cold_boot.AgentSrv6DecapTest/0.VerifyDscpQueueMapping (16976 ms)
[ PASSED ] warm_boot.AgentSrv6DecapTest/0.VerifyDscpQueueMapping (10943 ms)
[ PASSED ] cold_boot.AgentSrv6DecapTest/1.VerifyDscpQueueMapping (17485 ms)
[ PASSED ] warm_boot.AgentSrv6DecapTest/1.VerifyDscpQueueMapping (10812 ms)
Summary:
   PASSED : 4
   FAILED : 0
   SKIPPED : 0
   TIMEOUT : 0

Test output stored at: hwtest_results_2026_Sep_10-05_09_25_AM.csv

@gang-tao
gang-tao force-pushed the leh800bcls_agent_fix25 branch from 6299016 to 99ee053 Compare September 10, 2026 02:13
@facebook-github-tools

Copy link
Copy Markdown

@gang-tao has updated the pull request. You must reimport the pull request before landing.

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.

2 participants