Skip to content

Commit

Permalink
Enable VOQ DRAM bounds config and FDR FIFO watermark in SAI 12.0
Browse files Browse the repository at this point in the history
Summary: As titled

Reviewed By: jasmeetbagga

Differential Revision: D66861910

fbshipit-source-id: 95f32c87871185904bb5388a0352a502edbfce71
  • Loading branch information
Nivin Lawrence authored and facebook-github-bot committed Dec 6, 2024
1 parent 6a33c35 commit a825910
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
6 changes: 2 additions & 4 deletions fboss/agent/hw/sai/api/bcm/SwitchApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ std::optional<sai_attr_id_t> SaiSwitchTraits::Attributes::

std::optional<sai_attr_id_t>
SaiSwitchTraits::Attributes::AttributeVoqDramBoundThWrapper::operator()() {
// TODO: Support is not yet available in 12.0
#if defined(BRCM_SAI_SDK_DNX_GTE_11_0) && !defined(BRCM_SAI_SDK_DNX_GTE_12_0)
#if defined(BRCM_SAI_SDK_DNX_GTE_11_0)
return SAI_SWITCH_ATTR_VOQ_DRAM_BOUND_TH;
#else
return std::nullopt;
Expand Down Expand Up @@ -184,8 +183,7 @@ SaiSwitchTraits::sramMinBufferWatermarkBytes() {
}

const std::vector<sai_stat_id_t>& SaiSwitchTraits::fdrFifoWatermarkBytes() {
// TODO: Support is not yet available in 12.0
#if defined(BRCM_SAI_SDK_DNX_GTE_11_0) && !defined(BRCM_SAI_SDK_DNX_GTE_12_0)
#if defined(BRCM_SAI_SDK_DNX_GTE_11_0)
static const std::vector<sai_stat_id_t> stats{
SAI_SWITCH_STAT_FDR_RX_QUEUE_WM_LEVEL};
#else
Expand Down
2 changes: 1 addition & 1 deletion fboss/agent/hw/sai/switch/SaiSwitchManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ void SaiSwitchManager::setLinkFlowControlCreditTh(
}

void SaiSwitchManager::setVoqDramBoundTh(uint32_t dramBoundThreshold) {
#if defined(BRCM_SAI_SDK_DNX_GTE_11_0) && !defined(BRCM_SAI_SDK_DNX_GTE_12_0)
#if defined(BRCM_SAI_SDK_DNX_GTE_11_0)
// There are 3 different types of rate classes available and
// dramBound, upper and lower limits are applied to each of
// those. However, in our case, we just need to set the same
Expand Down
3 changes: 0 additions & 3 deletions fboss/agent/hw/sai/switch/npu/bcm/SaiSwitchManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,9 @@ void fillHwSwitchWatermarkStats(
case SAI_SWITCH_STAT_ING_MIN_SRAM_BUFFER_BYTES:
hwSwitchWatermarkStats.sramMinBufferWatermarkBytes() = value;
break;
#if !defined(BRCM_SAI_SDK_DNX_GTE_12_0)
// TODO: Support is not yet available in 12.0
case SAI_SWITCH_STAT_FDR_RX_QUEUE_WM_LEVEL:
hwSwitchWatermarkStats.fdrFifoWatermarkBytes() = value;
break;
#endif
#endif
default:
throw FbossError("Got unexpected switch counter id: ", counterId);
Expand Down

0 comments on commit a825910

Please sign in to comment.