Skip to content

Tahansb: platform: Add platform mapping csv and agent cpp files - #550

Closed
lihua-cls wants to merge 1 commit into
meta:mainfrom
lihua-cls:tahansb_platform_mapping
Closed

lihua-cls wants to merge 1 commit into
meta:mainfrom
lihua-cls:tahansb_platform_mapping

Conversation

@lihua-cls

@lihua-cls lihua-cls commented Sep 17, 2025 •

Copy link
Copy Markdown
Contributor

Description

This PR is to add platform mapping csv and agent cpp files for Santa Barbara (tahansb800bc).

Motivation

Based on Platform Mapping Config Generation and New Platform Support:

  • Add platform mapping CSV files into fboss/lib/platform_mapping_v2/platforms/tahansb800bc/.
  • Generate platform mapping json file.
  • Update kJsonPlatformMappingStr in fboss/agent/platforms/common/tahansb800bc/Tahansb800bcPlatformMapping.cpp.
  • Add SaiBcmTahansb800bcPlatformPort and SaiBcmTahansb800bcPlatform header and source files.
  • Other changes to cpp and cmake files.
  • Note1: the mgmt port configuration is not included in the PR. This is because the mgmt port cannot be initialized successfully due to a SAI-related issue. Once this issue is fixed, will send a new PR to add mgmt port support.
  • Note2: the profileId for backplane ports are using OPTICAL for now because the COPPER profileIds haven't defined yet. Will send a new PR to update this once COPPER profileId are defined.

Test Plan

  1. below binaries can be built successfully:
[root@d004e8970112 fboss]# ls -l *sai_impl
-rwxr-xr-x. 1 root root 949396864 Sep 16 08:59 sai_agent_hw_test-sai_impl
-rwxr-xr-x. 1 root root 926006832 Sep 16 09:02 sai_link_test-sai_impl
-rwxr-xr-x. 1 root root 942836744 Sep 16 08:55 sai_test-sai_impl
-rwxr-xr-x. 1 root root 921397128 Sep 16 09:03 wedge_agent-sai_impl
[root@d004e8970112 fboss]#
  1. sanity tested some cases of sai_test-sai_impl:
Running all tests took 0:15:43.574643 between 2025-04-15 19:15:45.282931 and 2025-04-15 19:31:28.857574
[       OK ] cold_boot.SaiNextHopGroupTest.addNextHopGroupWithUnresolvedNeighbors (87977 ms)
[       OK ] cold_boot.SaiNextHopGroupTest.addNextHopGroupWithResolvedNeighbors (105741 ms)
[       OK ] cold_boot.SaiNextHopGroupTest.addNextHopGroupThenResolveAll (97467 ms)
[       OK ] cold_boot.SaiNextHopGroupTest.addNextHopGroupThenUnresolveAll (101929 ms)
[       OK ] cold_boot.SaiNextHopGroupTest.addNextHopGroupThenUnresolveSome (111589 ms)
[       OK ] cold_boot.SaiNextHopGroupTest.addNextHopGroupInterfacePortDownInterfacePortUp (64222 ms)
[       OK ] cold_boot.SaiNextHopGroupTestWithWBWrites.addNextHopGroupPortDown (63004 ms)
[       OK ] cold_boot.SaiPortAdminStateTest.assertAdminState (37387 ms)
[       OK ] cold_boot.HwRouteNeighborTest/0.AddHostRouteAndNeighbor (55054 ms)
[       OK ] cold_boot.HwRouteNeighborTest/1.AddHostRouteAndNeighbor (62880 ms)
[       OK ] cold_boot.HwRouteNeighborTest/2.AddHostRouteAndNeighbor (58507 ms)
[       OK ] cold_boot.HwRouteNeighborTest/3.AddHostRouteAndNeighbor (61225 ms)
[       OK ] cold_boot.HwEmptyTest.CheckInit (35252 ms)
Summary:
   OK : 13
   FAILED : 0
   SKIPPED : 0
   TIMEOUT : 0
  1. sanity tested some cases of sai_agent_hw_test-sai_impl:
Running all tests took 0:05:28.851047 between 2025-04-15 19:09:34.434562 and 2025-04-15 19:15:03.285609
[       OK ] cold_boot.AgentMacSwLearningModeTest.VerifySwLearningForPort (39184 ms)
[       OK ] cold_boot.AgentMacSwLearningModeTest.VerifySwLearningForPortNoCycle (54690 ms)
[       OK ] cold_boot.AgentMacSwLearningModeTest.VerifySwLearningForTrunk (41729 ms)
[       OK ] cold_boot.AgentMacSwLearningModeTest.VerifySwAgingForPort (45736 ms)
[       OK ] cold_boot.AgentMacSwLearningModeTest.VerifySwAgingForTrunk (45794 ms)
[       OK ] cold_boot.AgentMacSwLearningModeTest.VerifyNbrMacInL2Table (41842 ms)
[       OK ] cold_boot.AgentMacSwLearningModeTest.VerifyCallbacksOnMacEntryChange (58801 ms)
Summary:
   OK : 7
   FAILED : 0
   SKIPPED : 0
   TIMEOUT : 0

full logs can be downloaded from Gdrive

@meta-cla meta-cla Bot added the CLA Signed label Sep 17, 2025
@facebook-github-bot

Copy link
Copy Markdown
Contributor

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

@lihua-cls

Copy link
Copy Markdown
Contributor Author

Hi @birdsoup , any comments for this PR?

@birdsoup

Copy link
Copy Markdown
Contributor

@lihua-cls Some feedback/questions from the internal code review:

  • tahansb800bc_port_profile_mapping.csv seems to be missing eth1/9
  • Based on the renders we have for this platform, front panel ports 1-10 are OSFP and 11 is the 100G MGMT port. This static_mapping doesn't match that. Did the front panel change or is the static mapping incorrect?

@lihua-cls

Copy link
Copy Markdown
Contributor Author

@lihua-cls Some feedback/questions from the internal code review:

  • tahansb800bc_port_profile_mapping.csv seems to be missing eth1/9
  • Based on the renders we have for this platform, front panel ports 1-10 are OSFP and 11 is the 100G MGMT port. This static_mapping doesn't match that. Did the front panel change or is the static mapping incorrect?

Hi @birdsoup

According to latest design, tahansb800bc supports 8 OSFP now. So eth1/1 ~ eth1/8 for OSFP front panel ports, and eth1/9 for MGMT port.
Since there are some SAI related issue which prevent the MGMT port bring up, I temporary removed the MGMT port eth1/9 from the profile_mapping.csv file, will create new PR once the SAI related issue resolved.

Thanks

@birdsoup

Copy link
Copy Markdown
Contributor

@lihua-cls Some feedback/questions from the internal code review:

  • tahansb800bc_port_profile_mapping.csv seems to be missing eth1/9
  • Based on the renders we have for this platform, front panel ports 1-10 are OSFP and 11 is the 100G MGMT port. This static_mapping doesn't match that. Did the front panel change or is the static mapping incorrect?

Hi @birdsoup

According to latest design, tahansb800bc supports 8 OSFP now. So eth1/1 ~ eth1/8 for OSFP front panel ports, and eth1/9 for MGMT port. Since there are some SAI related issue which prevent the MGMT port bring up, I temporary removed the MGMT port eth1/9 from the profile_mapping.csv file, will create new PR once the SAI related issue resolved.

Thanks

Thanks, this clears things up a lot. Do you have any more context on what SAI issue you were running into with the management port? (Is this an issue with the SAI SDK/are you already working with the asic vendor to fix this?)

@lihua-cls

lihua-cls commented Sep 26, 2025 •

Copy link
Copy Markdown
Contributor Author

@lihua-cls Some feedback/questions from the internal code review:

  • tahansb800bc_port_profile_mapping.csv seems to be missing eth1/9
  • Based on the renders we have for this platform, front panel ports 1-10 are OSFP and 11 is the 100G MGMT port. This static_mapping doesn't match that. Did the front panel change or is the static mapping incorrect?

Hi @birdsoup
According to latest design, tahansb800bc supports 8 OSFP now. So eth1/1 ~ eth1/8 for OSFP front panel ports, and eth1/9 for MGMT port. Since there are some SAI related issue which prevent the MGMT port bring up, I temporary removed the MGMT port eth1/9 from the profile_mapping.csv file, will create new PR once the SAI related issue resolved.
Thanks

Thanks, this clears things up a lot. Do you have any more context on what SAI issue you were running into with the management port? (Is this an issue with the SAI SDK/are you already working with the asic vendor to fix this?)

Hi @birdsoup

The SAI-related issue is: 100G management port cannot be initialized successfully.

Broadcom has fixed the issue where the management port incorrectly retrieves the HW lane. However, the fix requires setting the sai_disable_internal_port_serdes parameter to 0. Since this parameter is related to FlexPort functionality, the impact and compatibility are still under joint debugging with Broadcom.

Thanks

@lihua-cls

Copy link
Copy Markdown
Contributor Author

Hi @birdsoup

Do you have any more comments? If no, may you help to merge the changes?

Thanks

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@birdsoup merged this pull request in e981414.

meta-codesync Bot pushed a commit that referenced this pull request Feb 19, 2026
Summary:
**Pre-submission checklist**
- [x] 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`
- [x] `pre-commit run`

When building only a specific cmake target to save time, getdeps removes
the "built marker” under `$builddir/installed/fboss/.built-by-getdeps`,
which makes it impossible to subsequently run the unit tests as  without
this file getdeps bails out with `project fboss has not been built`.
What’s more, because of a missing `return` the exit code was 0, which
was confusing.
This fix ensures that the return code is propagated properly and also
improves the cmake test runner to automatically detect missing
executables and build them on the fly. This will not rebuild the test
binaries if they've already been built and are merely stale (because the
source code has changed) but that was already the prior behavior. At
least now it's possible to rebuild a single cmake test target and re-run
the tests in one shot.

Pull Request resolved: #722

Test Plan:
- Manually removed one unit test target, running `getdeps.py test` now can detect the missing test executables, and then rebuild such executables before running the tests
```
[root@5f196107a3a6 fboss]# ls -al /var/FBOSS/tmp_bld_dir/build/fboss/fboss2_cmd_test
-rwxr-xr-x 1 root root 116548584 Feb 17 20:48 /var/FBOSS/tmp_bld_dir/build/fboss/fboss2_cmd_test

[root@5f196107a3a6 fboss]# rm -rf /var/FBOSS/tmp_bld_dir/build/fboss/fboss2_cmd_test

[root@5f196107a3a6 fboss]# ./build/fbcode_builder/getdeps.py test --allow-system-packages --extra-cmake-defines='{"CMAKE_BUILD_TYPE": "MinSizeRel", "CMAKE_CXX_STANDARD": "20"}' --scratch-path /var/FBOSS/tmp_bld_dir --num-jobs 16 --src-dir . fboss
Testing ENV[BOOST_ROOT_1_69_0]: None
Building missing test executables: fboss2_cmd_test
...
+ cd /var/FBOSS/tmp_bld_dir/build/fboss && \
+ /usr/bin/cmake \
+      --build \
+      /var/FBOSS/tmp_bld_dir/build/fboss \
+      --target \
+      fboss2_cmd_test \
+      --config \
+      RelWithDebInfo \
+      -j \
+      16
[1/1] Linking CXX executable fboss2_cmd_test
 ---
...
103/689 Test #110: CmdShowAggregatePortTestFixture.queryClient ......................................................................................................   Passed    0.10 sec
        Start 141: CmdShowRouteDetailsTestFixture.queryClient
104/689 Test #113: CmdShowExampleTestFixture.queryClient ............................................................................................................   Passed    0.09 sec
        Start  94: CmdShowArpTestFixture.queryClient
105/689 Test #126: CmdShowInterfaceErrorsTestFixture.queryClient ....................................................................................................   Passed    0.10 sec
        Start  87: CmdSetPortStateTestFixture.enableOnePort
106/689 Test #129: CmdShowMirrorTestFixture.queryClientWithoutTunnel ................................................................................................   Passed    0.10 sec
        Start 123: CmdShowInterfaceCountersTestFixture.queryClient
...
100% tests passed, 0 tests failed out of 689

Total Test time (real) =  20.93 sec
```

- Confirmed the test executable was actually build, noticed timestamp of such binary is different than before
```
[root@5f196107a3a6 fboss]# ls -al /var/FBOSS/tmp_bld_dir/build/fboss/fboss2_cmd_test
-rwxr-xr-x 1 root root 116548584 Feb 17 22:26 /var/FBOSS/tmp_bld_dir/build/fboss/fboss2_cmd_test
```

- Now run the test command again when all the test binaries exist without any issue
```
[root@5f196107a3a6 fboss]# ./build/fbcode_builder/getdeps.py test --allow-system-packages --extra-cmake-defines='{"CMAKE_BUILD_TYPE": "MinSizeRel", "CMAKE_CXX_STANDARD": "20"}' --scratch-path /var/FBOSS/tmp_bld_dir --num-jobs 16 --src-dir . fboss
Testing ENV[BOOST_ROOT_1_69_0]: None
 ---
...
686/689 Test #578: ThriftStructNodeTestSuite.ThriftStructNodeRemovePathOnThriftMapTest<TestParams<true>> ............................................................   Passed    0.01 sec
687/689 Test #579: ThriftStructNodeTestSuite.ThriftStructNodeRemovePathOnThriftListTest<TestParams<true>> ...........................................................   Passed    0.01 sec
688/689 Test #580: ThriftStructNodeTestSuite.ThriftStructNodeRemovePathOnThriftSetTest<TestParams<true>> ............................................................   Passed    0.01 sec
689/689 Test #550: ThriftStructNodeTests.ThriftStructNodeSetAlreadyPublished ........................................................................................   Passed    0.18 sec

100% tests passed, 0 tests failed out of 689

Total Test time (real) =  21.00 sec
```

Reviewed By: bigfootjon

Differential Revision: D93524014

Pulled By: joseph5wu

fbshipit-source-id: d58055430e181f4efa6901985b7b2e7de4626a11
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.

3 participants