Skip to content

Commit

Permalink
Start adding llfc flow control thresholds
Browse files Browse the repository at this point in the history
Summary: As titled

Reviewed By: shri-khare, srikrishnagopu

Differential Revision: D64010121

fbshipit-source-id: d89bbd39310e891d60a1ea8505b340aa4ab9b4e9
  • Loading branch information
Jasmeet Bagga authored and facebook-github-bot committed Oct 8, 2024
1 parent f841b94 commit d30c05e
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fboss/agent/hw/sai/api/SwitchApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,13 @@ struct SaiSwitchTraits {
std::vector<sai_uint32_t>,
AttributeReachabilityGroupList,
SaiU32ListDefault>;
struct AttributeFabricLinkLayerFlowControlThreshold {
std::optional<sai_attr_id_t> operator()();
};
using FabricLinkLayerFlowControlThreshold = SaiExtensionAttribute<
std::vector<sai_uint32_t>,
AttributeFabricLinkLayerFlowControlThreshold,
SaiU32ListDefault>;
};
using AdapterKey = SwitchSaiId;
using AdapterHostKey = std::monostate;
Expand Down
8 changes: 8 additions & 0 deletions fboss/agent/hw/sai/api/bcm/SwitchApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,12 @@ SaiSwitchTraits::Attributes::AttributeReachabilityGroupList::operator()() {
#endif
return std::nullopt;
}

std::optional<sai_attr_id_t> SaiSwitchTraits::Attributes::
AttributeFabricLinkLayerFlowControlThreshold::operator()() {
#if defined(BRCM_SAI_SDK_DNX) && defined(BRCM_SAI_SDK_GTE_12_0)
return SAI_SWITCH_ATTR_FABRIC_LLFC_THRESHOLD;
#endif
return std::nullopt;
}
} // namespace facebook::fboss
6 changes: 6 additions & 0 deletions fboss/agent/hw/sai/api/fake/FakeSaiExtensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,10 @@ std::optional<sai_attr_id_t>
SaiSwitchTraits::Attributes::AttributeReachabilityGroupList::operator()() {
return SAI_SWITCH_ATTR_REACHABILITY_GROUP_LIST;
}

std::optional<sai_attr_id_t> SaiSwitchTraits::Attributes::
AttributeFabricLinkLayerFlowControlThreshold::operator()() {
return SAI_SWITCH_ATTR_FABRIC_LLFC_THRESHOLD;
}

} // namespace facebook::fboss
1 change: 1 addition & 0 deletions fboss/agent/hw/sai/api/fake/saifakeextensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ typedef enum _sai_switch_extensions_attr_t {
SAI_SWITCH_ATTR_VOQ_LATENCY_MIN_LEVEL_2,
SAI_SWITCH_ATTR_VOQ_LATENCY_MAX_LEVEL_2,
SAI_SWITCH_ATTR_REACHABILITY_GROUP_LIST,
SAI_SWITCH_ATTR_FABRIC_LLFC_THRESHOLD,
} sai_switch_extensions_attr_t;

typedef enum _sai_tam_event_extensions_attr_t {
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 @@ -157,4 +157,9 @@ std::optional<sai_attr_id_t>
SaiSwitchTraits::Attributes::AttributeReachabilityGroupList::operator()() {
return std::nullopt;
}

std::optional<sai_attr_id_t> SaiSwitchTraits::Attributes::
AttributeFabricLinkLayerFlowControlThreshold::operator()() {
return std::nullopt;
}
} // namespace facebook::fboss
4 changes: 4 additions & 0 deletions fboss/agent/hw/sai/api/tajo/SwitchApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,8 @@ std::optional<sai_attr_id_t>
SaiSwitchTraits::Attributes::AttributeReachabilityGroupList::operator()() {
return std::nullopt;
}
std::optional<sai_attr_id_t> SaiSwitchTraits::Attributes::
AttributeFabricLinkLayerFlowControlThreshold::operator()() {
return std::nullopt;
}
} // namespace facebook::fboss

0 comments on commit d30c05e

Please sign in to comment.