diff --git a/fboss/agent/hw/sai/api/PortApi.h b/fboss/agent/hw/sai/api/PortApi.h index aea44ff5f6a5e..4e66e7de6a896 100644 --- a/fboss/agent/hw/sai/api/PortApi.h +++ b/fboss/agent/hw/sai/api/PortApi.h @@ -416,7 +416,7 @@ struct SaiPortTraits { std::optional operator()(); }; using ReachabilityGroup = - SaiExtensionAttribute; + SaiExtensionAttribute; }; using AdapterKey = PortSaiId; @@ -510,20 +510,18 @@ struct SaiPortTraits { #endif std::optional, std::optional, - std::optional + std::optional, #if SAI_API_VERSION >= SAI_VERSION(1, 10, 2) - , std::optional, - std::optional + std::optional, #endif #if SAI_API_VERSION >= SAI_VERSION(1, 14, 0) - , std::optional, std::optional, std::optional, - std::optional + std::optional, #endif - >; + std::optional>; static constexpr std::array CounterIdsToRead = { SAI_PORT_STAT_IF_IN_OCTETS, SAI_PORT_STAT_IF_IN_UCAST_PKTS, diff --git a/fboss/agent/hw/sai/api/tests/PortApiTest.cpp b/fboss/agent/hw/sai/api/tests/PortApiTest.cpp index dbcac4b5c89e2..79435c38ce5f5 100644 --- a/fboss/agent/hw/sai/api/tests/PortApiTest.cpp +++ b/fboss/agent/hw/sai/api/tests/PortApiTest.cpp @@ -77,6 +77,7 @@ class PortApiTest : public ::testing::Test { std::nullopt, // ARS port load past weight std::nullopt, // ARS port load future weight #endif + std::nullopt, // Reachability Group }; return portApi->create(a, 0); } diff --git a/fboss/agent/hw/sai/store/tests/PortStoreTest.cpp b/fboss/agent/hw/sai/store/tests/PortStoreTest.cpp index 83feab4578fc5..f80cdd9e062b6 100644 --- a/fboss/agent/hw/sai/store/tests/PortStoreTest.cpp +++ b/fboss/agent/hw/sai/store/tests/PortStoreTest.cpp @@ -71,6 +71,7 @@ class PortStoreTest : public SaiStoreTest { std::nullopt, // ARS port load past weight std::nullopt, // ARS port load future weight #endif + std::nullopt, // Reachability Group }; } diff --git a/fboss/agent/hw/sai/switch/npu/SaiPortManager.cpp b/fboss/agent/hw/sai/switch/npu/SaiPortManager.cpp index df3a4f30b74fc..873bdc7301ab6 100644 --- a/fboss/agent/hw/sai/switch/npu/SaiPortManager.cpp +++ b/fboss/agent/hw/sai/switch/npu/SaiPortManager.cpp @@ -628,6 +628,15 @@ SaiPortTraits::CreateAttributes SaiPortManager::attributesFromSwPort( } #endif + std::optional + reachabilityGroup{}; +#if defined(BRCM_SAI_SDK_DNX_GTE_12_0) + if (auto reachabilityGroupId = swPort->getReachabilityGroupId()) { + reachabilityGroup = SaiPortTraits::Attributes::ReachabilityGroup{ + reachabilityGroupId.value()}; + } +#endif + if (basicAttributeOnly) { return SaiPortTraits::CreateAttributes{ #if defined(BRCM_SAI_SDK_DNX) @@ -690,6 +699,7 @@ SaiPortTraits::CreateAttributes SaiPortManager::attributesFromSwPort( std::nullopt, // ARS port load past weight std::nullopt, // ARS port load future weight #endif + std::nullopt, // Reachability Group }; } return SaiPortTraits::CreateAttributes{ @@ -757,6 +767,7 @@ SaiPortTraits::CreateAttributes SaiPortManager::attributesFromSwPort( arsPortLoadPastWeight, // ARS port load past weight arsPortLoadFutureWeight, // ARS port load future weight #endif + reachabilityGroup, }; } diff --git a/fboss/agent/hw/sai/switch/phy/SaiPortManager.cpp b/fboss/agent/hw/sai/switch/phy/SaiPortManager.cpp index 20d9a2f096808..c4b8e7751b327 100644 --- a/fboss/agent/hw/sai/switch/phy/SaiPortManager.cpp +++ b/fboss/agent/hw/sai/switch/phy/SaiPortManager.cpp @@ -285,6 +285,7 @@ SaiPortTraits::CreateAttributes SaiPortManager::attributesFromSwPort( std::nullopt, // ARS port load past weight std::nullopt, // ARS port load future weight #endif + std::nullopt, // Reachability Group }; } diff --git a/fboss/agent/hw/sai/switch/tests/PortManagerTest.cpp b/fboss/agent/hw/sai/switch/tests/PortManagerTest.cpp index 00a588a278f60..80945a666a5d6 100644 --- a/fboss/agent/hw/sai/switch/tests/PortManagerTest.cpp +++ b/fboss/agent/hw/sai/switch/tests/PortManagerTest.cpp @@ -167,6 +167,7 @@ class PortManagerTest : public ManagerTestBase { std::nullopt, // ARS port load past weight std::nullopt, // ARS port load future weight #endif + std::nullopt, // Reachability Group }; return portApi.create(a, 0); }