Skip to content

Commit

Permalink
support for enabling delay based dropping threshold
Browse files Browse the repository at this point in the history
Summary:
As titled, add support for enabling delay based dropping congestion threshold in FBOSS.

NOTE that this diff is a no-op since the attribute is not used yet. I will follow up with another diff for setting the attribute.

Differential Revision: D61602331

fbshipit-source-id: b3e8aebcd083891451d143fdf791dabe48f9e106
  • Loading branch information
srikrishnagopu authored and facebook-github-bot committed Aug 23, 2024
1 parent 1b0a6fe commit 21dacf3
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 1 deletion.
9 changes: 8 additions & 1 deletion fboss/agent/hw/sai/api/SwitchApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,11 @@ struct SaiSwitchTraits {
};
using RestartIssu =
SaiExtensionAttribute<bool, AttributeRestartIssuWrapper>;
struct AttributeDelayDropCongThreshold {
std::optional<sai_attr_id_t> operator()();
};
using DelayDropCongThreshold =
SaiExtensionAttribute<sai_uint8_t, AttributeDelayDropCongThreshold>;
struct AttributeForceTrafficOverFabricWrapper {
std::optional<sai_attr_id_t> operator()();
};
Expand Down Expand Up @@ -614,7 +619,8 @@ struct SaiSwitchTraits {
,
std::optional<Attributes::ArsProfile>
#endif
>;
,
std::optional<Attributes::DelayDropCongThreshold>>;

#if SAI_API_VERSION >= SAI_VERSION(1, 12, 0)
static constexpr std::array<sai_stat_id_t, 3> CounterIdsToRead = {
Expand Down Expand Up @@ -721,6 +727,7 @@ SAI_ATTRIBUTE_NAME(Switch, EcmpMemberCount)
#endif
SAI_ATTRIBUTE_NAME(Switch, DllPath)
SAI_ATTRIBUTE_NAME(Switch, RestartIssu)
SAI_ATTRIBUTE_NAME(Switch, DelayDropCongThreshold)
SAI_ATTRIBUTE_NAME(Switch, ForceTrafficOverFabric)
SAI_ATTRIBUTE_NAME(Switch, WarmBootTargetVersion)
SAI_ATTRIBUTE_NAME(Switch, SwitchIsolate)
Expand Down
5 changes: 5 additions & 0 deletions fboss/agent/hw/sai/api/bcm/SwitchApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ void SwitchApi::registerSwitchEventCallback(
#endif
}

std::optional<sai_attr_id_t>
SaiSwitchTraits::Attributes::AttributeDelayDropCongThreshold::operator()() {
return std::nullopt;
}

std::optional<sai_attr_id_t> SaiSwitchTraits::Attributes::
AttributeForceTrafficOverFabricWrapper::operator()() {
#if defined(BRCM_SAI_SDK_DNX)
Expand Down
5 changes: 5 additions & 0 deletions fboss/agent/hw/sai/api/fake/FakeSaiExtensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ SaiSwitchTraits::Attributes::AttributeRestartIssuWrapper::operator()() {
return SAI_SWITCH_ATTR_EXT_RESTART_ISSU;
}

std::optional<sai_attr_id_t>
SaiSwitchTraits::Attributes::AttributeDelayDropCongThreshold::operator()() {
return std::nullopt;
}

std::optional<sai_attr_id_t> SaiSwitchTraits::Attributes::
AttributeForceTrafficOverFabricWrapper::operator()() {
return SAI_SWITCH_ATTR_FORCE_TRAFFIC_OVER_FABRIC;
Expand Down
5 changes: 5 additions & 0 deletions fboss/agent/hw/sai/api/oss/SwitchApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ SaiSwitchTraits::Attributes::AttributeRestartIssuWrapper::operator()() {
return std::nullopt;
}

std::optional<sai_attr_id_t>
SaiSwitchTraits::Attributes::AttributeDelayDropCongThreshold::operator()() {
return std::nullopt;
}

std::optional<sai_attr_id_t> SaiSwitchTraits::Attributes::
AttributeForceTrafficOverFabricWrapper::operator()() {
return std::nullopt;
Expand Down
9 changes: 9 additions & 0 deletions fboss/agent/hw/sai/api/tajo/SwitchApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ SaiSwitchTraits::Attributes::AttributeRestartIssuWrapper::operator()() {
#endif
}

std::optional<sai_attr_id_t>
SaiSwitchTraits::Attributes::AttributeDelayDropCongThreshold::operator()() {
#if defined(TAJO_SDK_VERSION_1_42_8)
return SAI_SWITCH_ATTR_EXT_DELAY_DROP_CONG_THRESHOLD;
#else
return std::nullopt;
#endif
}

std::optional<sai_attr_id_t> SaiSwitchTraits::Attributes::
AttributeForceTrafficOverFabricWrapper::operator()() {
return std::nullopt;
Expand Down
5 changes: 5 additions & 0 deletions fboss/agent/hw/sai/switch/SaiSwitchManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ DEFINE_bool(
false,
"Flag to indicate whether to skip setting source mac in Sai switch during wb");

DEFINE_uint32(
delay_drop_congestion_threshold,
0,
"Delay drop congestion threshold");

namespace {
using namespace facebook::fboss;
sai_hash_algorithm_t toSaiHashAlgo(cfg::HashingAlgorithm algo) {
Expand Down
1 change: 1 addition & 0 deletions fboss/agent/hw/sai/tracer/SwitchApiTracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ void handleExtensionAttributes() {
SAI_EXT_ATTR_MAP(Switch, VoqLatencyMinLevel2Ns);
SAI_EXT_ATTR_MAP(Switch, VoqLatencyMaxLevel2Ns);
SAI_EXT_ATTR_MAP(Switch, ReachabilityGroupList);
SAI_EXT_ATTR_MAP(Switch, DelayDropCongThreshold);
}

} // namespace
Expand Down
1 change: 1 addition & 0 deletions fboss/agent/platforms/sai/SaiPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ SaiSwitchTraits::CreateAttributes SaiPlatform::getSwitchAttributes(
#if SAI_API_VERSION >= SAI_VERSION(1, 14, 0)
std::nullopt, // ARS profile
#endif
std::nullopt, // Delay Drop Cong Threshold
};
}

Expand Down

0 comments on commit 21dacf3

Please sign in to comment.