Skip to main content

New Platform Support

Overview

This document describes all of the locations in the code where you need to add code to onboard a new platform in qsfp_service / agent code. Please follow this GitHub Commit as an example if the code pointers are not sufficient.

Common Code Changes

  1. Add a new entry to the PlatformType enum in fboss/lib/if/fboss_common.thrift.
  2. Add a new entry to the toString(PlatformType mode) function in fboss/lib/platforms/PlatformMode.h.
  3. Add a new entry to initMode() in fboss/lib/platforms/PlatformProductInfo.cpp.
  4. Add a new switch case for your platform to initPlatformMapping() in fboss/agent/platforms/common/PlatformMappingUtils.cpp.
  5. Based on your files created in Platform Mapping Config Generation, create a new folder and add all platform mapping CSV files to fboss/lib/platform_mapping_v2/platforms/{PLATFORM}/.
  6. Similarly, create a new folder and add a source file and header for your platform mapping. This requires copying the generated platform mapping JSON into kJsonPlatformMappingStr within the .cpp file.
    • fboss/agent/platforms/common/{PLATFORM}/{PLATFORM}PlatformMapping.h Header example
    • fboss/agent/platforms/common/{PLATFORM}/{PLATFORM}PlatformMapping.cpp Source example

Agent Code Changes

  1. Add a SaiBcm{PLATFORM}PlatformPort header and source file for your platform:

    • fboss/agent/platforms/sai/SaiBcm{PLATFORM}PlatformPort.h Header example
    • fboss/agent/platforms/sai/SaiBcm{PLATFORM}PlatformPort.cpp Source example
  2. Add a SaiBcm{PLATFORM}Platform header and source file for your platform:

  3. Add a new entry to initPorts() in fboss/agent/platforms/sai/SaiPlatform.cpp.

  4. Add a new entry to chooseSaiPlatform() in fboss/agent/platforms/sai/SaiPlatformInit.cpp.

  5. Make changes to CMake files to support building in open source:

Qsfp Service Code Changes

  1. Create BspPlatformMapping header and source files under fboss/lib/bsp/{PLATFORM}/

    • fboss/lib/bsp/{PLATFORM}/{PLATFORM}BspPlatformMapping.h Header example
    • fboss/lib/bsp/{PLATFORM}/{PLATFORM}BspPlatformMapping.cpp Source example
  2. Add an LED Manager class for your platform:

  3. In fboss/qsfp_service/platforms/wedge/WedgeManagerInit.cpp, add a function called create{PLATFORM}WedgeManager that instantiates a WedgeManager object with the platform mapping JSON file.