From af8f43337d3f13ce0be129754b6e4fdc8bad2872 Mon Sep 17 00:00:00 2001 From: Adam Calabrigo Date: Tue, 8 Oct 2024 01:59:03 +0000 Subject: [PATCH 1/2] agent: add DARWIN48V platform --- fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp | 3 ++- fboss/agent/hw/sai/diag/DiagShell.cpp | 3 +++ fboss/agent/hw/test/ProdConfigFactory.cpp | 1 + fboss/agent/platforms/common/PlatformMappingUtils.cpp | 1 + fboss/agent/platforms/sai/SaiPlatform.cpp | 4 +++- fboss/agent/platforms/sai/SaiPlatformInit.cpp | 4 +++- fboss/agent/platforms/tests/utils/CreateTestPlatform.cpp | 4 +++- fboss/agent/test/agent_hw_tests/AgentRouteOverflowTests.cpp | 1 + 8 files changed, 17 insertions(+), 4 deletions(-) diff --git a/fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp b/fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp index b107bbc5104e9..8c705ac9ba350 100644 --- a/fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp +++ b/fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp @@ -256,7 +256,8 @@ void BcmSwitchEnsemble::init( PlatformType::PLATFORM_MINIPACK, PlatformType::PLATFORM_YAMP, PlatformType::PLATFORM_WEDGE400, - PlatformType::PLATFORM_DARWIN}; + PlatformType::PLATFORM_DARWIN + PlatformType::PLATFORM_DARWIN48V}; std::unordered_set th4BcmPlatforms = { PlatformType::PLATFORM_FUJI, PlatformType::PLATFORM_ELBERT}; bool th3Platform = false; diff --git a/fboss/agent/hw/sai/diag/DiagShell.cpp b/fboss/agent/hw/sai/diag/DiagShell.cpp index d272c6ac9f72b..44289094bfb04 100644 --- a/fboss/agent/hw/sai/diag/DiagShell.cpp +++ b/fboss/agent/hw/sai/diag/DiagShell.cpp @@ -161,6 +161,7 @@ std::unique_ptr DiagShell::makeRepl() const { case PlatformType::PLATFORM_FUJI: case PlatformType::PLATFORM_ELBERT: case PlatformType::PLATFORM_DARWIN: + case PlatformType::PLATFORM_DARWIN48V: case PlatformType::PLATFORM_MERU400BIU: case PlatformType::PLATFORM_MERU800BIA: case PlatformType::PLATFORM_MERU800BFA: @@ -393,6 +394,7 @@ std::string DiagCmdServer::getDelimiterDiagCmd(const std::string& UUID) const { case PlatformType::PLATFORM_FUJI: case PlatformType::PLATFORM_ELBERT: case PlatformType::PLATFORM_DARWIN: + case PlatformType::PLATFORM_DARWIN48V: case PlatformType::PLATFORM_MERU400BIU: case PlatformType::PLATFORM_MERU800BIA: case PlatformType::PLATFORM_MERU800BFA: @@ -440,6 +442,7 @@ std::string& DiagCmdServer::cleanUpOutput( case PlatformType::PLATFORM_FUJI: case PlatformType::PLATFORM_ELBERT: case PlatformType::PLATFORM_DARWIN: + case PlatformType::PLATFORM_DARWIN48V: case PlatformType::PLATFORM_MERU400BIU: case PlatformType::PLATFORM_MERU800BIA: case PlatformType::PLATFORM_MERU800BFA: diff --git a/fboss/agent/hw/test/ProdConfigFactory.cpp b/fboss/agent/hw/test/ProdConfigFactory.cpp index 286309aa6fa73..924aaddaaf935 100644 --- a/fboss/agent/hw/test/ProdConfigFactory.cpp +++ b/fboss/agent/hw/test/ProdConfigFactory.cpp @@ -109,6 +109,7 @@ uint16_t uplinksCountFromSwitch(PlatformType mode) { case PM::PLATFORM_GALAXY_LC: case PM::PLATFORM_GALAXY_FC: case PM::PLATFORM_DARWIN: + case PM::PLATFORM_DARWIN48V: case PM::PLATFORM_MONTBLANC: return 4; default: diff --git a/fboss/agent/platforms/common/PlatformMappingUtils.cpp b/fboss/agent/platforms/common/PlatformMappingUtils.cpp index d8067c4068548..74d8cf8709386 100644 --- a/fboss/agent/platforms/common/PlatformMappingUtils.cpp +++ b/fboss/agent/platforms/common/PlatformMappingUtils.cpp @@ -119,6 +119,7 @@ std::unique_ptr initPlatformMapping(PlatformType type) { ? std::make_unique() : std::make_unique(platformMappingStr); case PlatformType::PLATFORM_DARWIN: + case PlatformType::PLATFORM_DARWIN48V: return platformMappingStr.empty() ? std::make_unique() : std::make_unique(platformMappingStr); diff --git a/fboss/agent/platforms/sai/SaiPlatform.cpp b/fboss/agent/platforms/sai/SaiPlatform.cpp index 6ecf3866e06af..7c76f59eab41e 100644 --- a/fboss/agent/platforms/sai/SaiPlatform.cpp +++ b/fboss/agent/platforms/sai/SaiPlatform.cpp @@ -332,7 +332,9 @@ void SaiPlatform::initPorts() { platformMode == PlatformType::PLATFORM_WEDGE400 || platformMode == PlatformType::PLATFORM_WEDGE400_GRANDTETON) { saiPort = std::make_unique(portId, this); - } else if (platformMode == PlatformType::PLATFORM_DARWIN) { + } else if ( + platformMode == PlatformType::PLATFORM_DARWIN || + platformMode == PlatformType::PLATFORM_DARWIN48V) { saiPort = std::make_unique(portId, this); } else if (platformMode == PlatformType::PLATFORM_MINIPACK) { saiPort = std::make_unique(portId, this); diff --git a/fboss/agent/platforms/sai/SaiPlatformInit.cpp b/fboss/agent/platforms/sai/SaiPlatformInit.cpp index 0f3d59d5d7905..cf9ca19326006 100644 --- a/fboss/agent/platforms/sai/SaiPlatformInit.cpp +++ b/fboss/agent/platforms/sai/SaiPlatformInit.cpp @@ -50,7 +50,9 @@ std::unique_ptr chooseSaiPlatform( auto type = productInfo->getType(); return std::make_unique( std::move(productInfo), type, localMac, platformMappingStr); - } else if (productInfo->getType() == PlatformType::PLATFORM_DARWIN) { + } else if ( + productInfo->getType() == PlatformType::PLATFORM_DARWIN || + productInfo->getType() == PlatformType::PLATFORM_DARWIN48V) { return std::make_unique( std::move(productInfo), localMac, platformMappingStr); } else if (productInfo->getType() == PlatformType::PLATFORM_MINIPACK) { diff --git a/fboss/agent/platforms/tests/utils/CreateTestPlatform.cpp b/fboss/agent/platforms/tests/utils/CreateTestPlatform.cpp index d228fdb453b5d..86d624c7849ef 100644 --- a/fboss/agent/platforms/tests/utils/CreateTestPlatform.cpp +++ b/fboss/agent/platforms/tests/utils/CreateTestPlatform.cpp @@ -47,7 +47,9 @@ std::unique_ptr createTestPlatform() { return std::make_unique(std::move(productInfo)); } else if (mode == PlatformType::PLATFORM_WEDGE400) { return std::make_unique(std::move(productInfo)); - } else if (mode == PlatformType::PLATFORM_DARWIN) { + } else if ( + mode == PlatformType::PLATFORM_DARWIN || + mode == PlatformType::PLATFORM_DARWIN48V) { return std::make_unique(std::move(productInfo)); } else if (mode == PlatformType::PLATFORM_FUJI) { return std::make_unique(std::move(productInfo)); diff --git a/fboss/agent/test/agent_hw_tests/AgentRouteOverflowTests.cpp b/fboss/agent/test/agent_hw_tests/AgentRouteOverflowTests.cpp index ce3317d6328aa..22d5c22f39429 100644 --- a/fboss/agent/test/agent_hw_tests/AgentRouteOverflowTests.cpp +++ b/fboss/agent/test/agent_hw_tests/AgentRouteOverflowTests.cpp @@ -50,6 +50,7 @@ TEST_F(AgentRouteOverflowTest, overflowRoutes) { case PlatformType::PLATFORM_MINIPACK: case PlatformType::PLATFORM_YAMP: case PlatformType::PLATFORM_DARWIN: + case PlatformType::PLATFORM_DARWIN48V: /* * A route distribution 200,000 /128 does overflow the ASIC tables * but it takes 15min to generate, program and clean up such a From 7754778fd6568895db51e10e0412b70c03a8810f Mon Sep 17 00:00:00 2001 From: Adam Calabrigo Date: Tue, 8 Oct 2024 02:09:05 +0000 Subject: [PATCH 2/2] agent: fix missing comma in DARWIN48V conditional --- fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp b/fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp index 8c705ac9ba350..faf4cfcab637f 100644 --- a/fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp +++ b/fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp @@ -256,7 +256,7 @@ void BcmSwitchEnsemble::init( PlatformType::PLATFORM_MINIPACK, PlatformType::PLATFORM_YAMP, PlatformType::PLATFORM_WEDGE400, - PlatformType::PLATFORM_DARWIN + PlatformType::PLATFORM_DARWIN, PlatformType::PLATFORM_DARWIN48V}; std::unordered_set th4BcmPlatforms = { PlatformType::PLATFORM_FUJI, PlatformType::PLATFORM_ELBERT};