diff --git a/fboss/agent/hw/sai/api/bcm/PortApi.cpp b/fboss/agent/hw/sai/api/bcm/PortApi.cpp index 75392f407087d..7da0184f923c2 100644 --- a/fboss/agent/hw/sai/api/bcm/PortApi.cpp +++ b/fboss/agent/hw/sai/api/bcm/PortApi.cpp @@ -271,8 +271,7 @@ SaiPortTraits::Attributes::AttributeCondEntropyRehashSeed::operator()() { std::optional SaiPortTraits::Attributes::AttributeShelEnable::operator()() { -// TODO(zecheng): Update flag when new 12.0 release has the attribute -#if defined(SAI_VERSION_11_7_0_0_DNX_ODP) +#if defined(BRCM_SAI_SDK_DNX_GTE_11_0) return SAI_PORT_ATTR_SHEL_ENABLE; #else return std::nullopt; diff --git a/fboss/agent/hw/sai/api/bcm/SwitchApi.cpp b/fboss/agent/hw/sai/api/bcm/SwitchApi.cpp index 3a9951bae98c1..1b4a0c01cf892 100644 --- a/fboss/agent/hw/sai/api/bcm/SwitchApi.cpp +++ b/fboss/agent/hw/sai/api/bcm/SwitchApi.cpp @@ -249,7 +249,6 @@ void SwitchApi::registerSwitchEventCallback( rv, ApiType, "Unable to register parity error switch event callback"); // Register switch events - // TODO(zecheng): Update flag when new 12.0 release has the attribute #if defined(SAI_VERSION_11_7_0_0_DNX_ODP) std::array events = { SAI_SWITCH_EVENT_TYPE_PARITY_ERROR, @@ -262,7 +261,7 @@ void SwitchApi::registerSwitchEventCallback( SAI_SWITCH_EVENT_TYPE_FIRMWARE_CRASHED, SAI_SWITCH_EVENT_TYPE_REMOTE_LINK_CHANGE}; #elif defined(SAI_VERSION_12_0_EA_DNX_ODP) - std::array events = { + std::array events = { SAI_SWITCH_EVENT_TYPE_PARITY_ERROR, SAI_SWITCH_EVENT_TYPE_STABLE_FULL, SAI_SWITCH_EVENT_TYPE_STABLE_ERROR, @@ -270,7 +269,8 @@ void SwitchApi::registerSwitchEventCallback( SAI_SWITCH_EVENT_TYPE_WARM_BOOT_DOWNGRADE, SAI_SWITCH_EVENT_TYPE_INTERRUPT, SAI_SWITCH_EVENT_TYPE_FABRIC_AUTO_ISOLATE, - SAI_SWITCH_EVENT_TYPE_FIRMWARE_CRASHED}; + SAI_SWITCH_EVENT_TYPE_FIRMWARE_CRASHED, + SAI_SWITCH_EVENT_TYPE_REMOTE_LINK_CHANGE}; #elif defined BRCM_SAI_SDK_GTE_11_0 std::array events = { SAI_SWITCH_EVENT_TYPE_PARITY_ERROR, @@ -475,8 +475,7 @@ SaiSwitchTraits::Attributes::AttributeCondEntropyRehashPeriodUS::operator()() { std::optional SaiSwitchTraits::Attributes::AttributeShelSrcIp::operator()() { -// TODO(zecheng): Update flag when new 12.0 release has the attribute -#if defined(SAI_VERSION_11_7_0_0_DNX_ODP) +#if defined(BRCM_SAI_SDK_DNX_GTE_11_0) return SAI_SWITCH_ATTR_SHEL_SRC_IP; #endif return std::nullopt; @@ -484,8 +483,7 @@ SaiSwitchTraits::Attributes::AttributeShelSrcIp::operator()() { std::optional SaiSwitchTraits::Attributes::AttributeShelDstIp::operator()() { -// TODO(zecheng): Update flag when new 12.0 release has the attribute -#if defined(SAI_VERSION_11_7_0_0_DNX_ODP) +#if defined(BRCM_SAI_SDK_DNX_GTE_11_0) return SAI_SWITCH_ATTR_SHEL_DST_IP; #endif return std::nullopt; @@ -493,8 +491,7 @@ SaiSwitchTraits::Attributes::AttributeShelDstIp::operator()() { std::optional SaiSwitchTraits::Attributes::AttributeShelSrcMac::operator()() { -// TODO(zecheng): Update flag when new 12.0 release has the attribute -#if defined(SAI_VERSION_11_7_0_0_DNX_ODP) +#if defined(BRCM_SAI_SDK_DNX_GTE_11_0) return SAI_SWITCH_ATTR_SHEL_SRC_MAC; #endif return std::nullopt; @@ -502,8 +499,7 @@ SaiSwitchTraits::Attributes::AttributeShelSrcMac::operator()() { std::optional SaiSwitchTraits::Attributes::AttributeShelPeriodicInterval::operator()() { -// TODO(zecheng): Update flag when new 12.0 release has the attribute -#if defined(SAI_VERSION_11_7_0_0_DNX_ODP) +#if defined(BRCM_SAI_SDK_DNX_GTE_11_0) return SAI_SWITCH_ATTR_SHEL_PERIODIC_INTERVAL; #endif return std::nullopt; diff --git a/fboss/agent/hw/sai/api/bcm/SystemPortApi.cpp b/fboss/agent/hw/sai/api/bcm/SystemPortApi.cpp index ba0d734f85f87..544bb716cd554 100644 --- a/fboss/agent/hw/sai/api/bcm/SystemPortApi.cpp +++ b/fboss/agent/hw/sai/api/bcm/SystemPortApi.cpp @@ -16,8 +16,7 @@ namespace facebook::fboss { std::optional SaiSystemPortTraits::Attributes::AttributeShelPktDstEnable::operator()() { -// TODO(zecheng): Update flag when new 12.0 release has the attribute -#if defined(SAI_VERSION_11_7_0_0_DNX_ODP) +#if defined(BRCM_SAI_SDK_DNX_GTE_11_0) return SAI_SYSTEM_PORT_ATTR_SHEL_PKT_DEST_ENABLE; #else return std::nullopt; diff --git a/fboss/agent/hw/sai/switch/SaiPortManager.cpp b/fboss/agent/hw/sai/switch/SaiPortManager.cpp index e53d90a175c22..09bec1b026923 100644 --- a/fboss/agent/hw/sai/switch/SaiPortManager.cpp +++ b/fboss/agent/hw/sai/switch/SaiPortManager.cpp @@ -1553,7 +1553,7 @@ std::shared_ptr SaiPortManager::swPortFromAttributes( #endif port->setScope(platform_->getPlatformMapping()->getPortScope(port->getID())); -#if defined(SAI_VERSION_11_7_0_0_DNX_ODP) +#if defined(BRCM_SAI_SDK_DNX_GTE_11_0) auto shelEnable = GET_OPT_ATTR(Port, ShelEnable, attributes); port->setSelfHealingECMPLagEnable(shelEnable); #endif diff --git a/fboss/agent/hw/sai/switch/SaiSystemPortManager.cpp b/fboss/agent/hw/sai/switch/SaiSystemPortManager.cpp index e28c39cde0fc9..2eb699dd9a738 100644 --- a/fboss/agent/hw/sai/switch/SaiSystemPortManager.cpp +++ b/fboss/agent/hw/sai/switch/SaiSystemPortManager.cpp @@ -100,7 +100,7 @@ SaiSystemPortManager::attributesFromSwSystemPort( } std::optional shelPktDstEnable = std::nullopt; -#if defined(SAI_VERSION_11_7_0_0_DNX_ODP) +#if defined(BRCM_SAI_SDK_DNX_GTE_11_0) if (swSystemPort->getShelDestinationEnabled()) { shelPktDstEnable = true; } diff --git a/fboss/agent/hw/sai/switch/npu/SaiPortManager.cpp b/fboss/agent/hw/sai/switch/npu/SaiPortManager.cpp index c32dfac156469..cd3a5a9f6b68d 100644 --- a/fboss/agent/hw/sai/switch/npu/SaiPortManager.cpp +++ b/fboss/agent/hw/sai/switch/npu/SaiPortManager.cpp @@ -671,7 +671,7 @@ SaiPortTraits::CreateAttributes SaiPortManager::attributesFromSwPort( condEntropyRehashEnable = swPort->getConditionalEntropyRehash(); #endif std::optional shelEnable{}; -#if defined(SAI_VERSION_11_7_0_0_DNX_ODP) +#if defined(BRCM_SAI_SDK_DNX_GTE_11_0) shelEnable = SaiPortTraits::Attributes::ShelEnable{ swPort->getSelfHealingECMPLagEnable()}; #endif diff --git a/fboss/agent/hw/sai/switch/npu/bcm/SaiSwitch.cpp b/fboss/agent/hw/sai/switch/npu/bcm/SaiSwitch.cpp index e380003fc283f..ff32eeb143356 100644 --- a/fboss/agent/hw/sai/switch/npu/bcm/SaiSwitch.cpp +++ b/fboss/agent/hw/sai/switch/npu/bcm/SaiSwitch.cpp @@ -705,10 +705,7 @@ void SaiSwitch::switchEventCallback( << " reload status: " << static_cast(eventInfo->index2); break; } -#endif -#if defined(SAI_VERSION_11_7_0_0_DNX_ODP) - // TODO(zecheng): Update flag when new 12.0 release has the attribute - case SAI_SWITCH_EVENT_TYPE_REMOTE_LINK_CHANGE: + case SAI_SWITCH_EVENT_TYPE_REMOTE_LINK_CHANGE: { auto isUp = eventInfo->index; auto sysPortId = eventInfo->index2; XLOG(DBG2) << "[SHEL] Received remote link change event: " << "isUp: " @@ -716,6 +713,7 @@ void SaiSwitch::switchEventCallback( << " sysPortId: " << static_cast(sysPortId); // TODO(zecheng): Handle and log remote link change break; + } #endif } }