From 2fb09774588b3212ba2cb58f3586ea77da1c09a6 Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Mon, 9 Dec 2024 17:53:29 -0800 Subject: [PATCH] not set EcnGreenMinThreshold and EcnGreenMaxThreshold when GreenEnable is false Summary: as titled, these thresholds are unsupported as per SAI sec these attributes are valid only when GreenEnable is true and mode is one of (SAI_ECN_MARK_MODE_GREEN, SAI_ECN_MARK_MODE_YELLOW, SAI_ECN_MARK_MODE_RED, SAI_ECN_MARK_MODE_ALL) https://github.com/opencomputeproject/SAI/blob/master/inc/saiwred.h#L96 Reviewed By: nivinl, maxwindiff Differential Revision: D66845491 Privacy Context Container: L1125642 fbshipit-source-id: e6c9316cd32158597c52037c8e73a0d2a6d41136 --- fboss/agent/hw/sai/switch/SaiWredManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fboss/agent/hw/sai/switch/SaiWredManager.cpp b/fboss/agent/hw/sai/switch/SaiWredManager.cpp index 5afe24d1e4a74..37aa69475e78c 100644 --- a/fboss/agent/hw/sai/switch/SaiWredManager.cpp +++ b/fboss/agent/hw/sai/switch/SaiWredManager.cpp @@ -52,7 +52,8 @@ SaiWredTraits::CreateAttributes SaiWredManager::profileCreateAttrs( std::get>(attrs); #if !defined(BRCM_SAI_SDK_XGS_AND_DNX) std::tie(greenMin, greenMax, greenDropProbability, ecnGreenMin, ecnGreenMax) = - std::make_tuple(0, 0, kDefaultDropProbability, 0, 0); + std::make_tuple( + 0, 0, kDefaultDropProbability, std::nullopt, std::nullopt); #endif for (const auto& aqm : std::as_const(*queue.getAqms())) { // THRIFT_COPY