Skip to content

Commit

Permalink
add portVoqConfigName to switch_config.thrift
Browse files Browse the repository at this point in the history
Summary:
Currently on J3 platforms, all ports including cpu/rcy ports are using "defaultVoqConfig" which has 4 queues and only meant for NIF ports. Cpu/rcy ports and future queuing model in 2-stage ramon could have different voq settings for different ports. So, similar to "portQueueConfigName", we need to define the corresponding voq config in "portQueueConfigs" and apply it to ports if different from "defaultVoqConfig".

Note: I tried adding another dedicated map collection "portVoqConfigs" for voqs in D61608453, but got build error from generated fsdb_model.h, see P1539329134. peygar helped looking into it, but looks like a limitation not easy to fix... Here is his comments:

  The type of map<PortVoqConfigName, list<PortQueue>> portVoqConfigs

  Is exactly the same as map<PortQueueConfigName, list<PortQueue>> portQueueConfigs

  because PortQueueConfigName == PortVoqConfigName == std::string. But our codegen is not smart enough to realize than and generates two different thriftpath classes which end up colliding.

Reviewed By: peygar, nivinl

Differential Revision:
D61664711

Privacy Context Container: L1125642

fbshipit-source-id: 7db360a60d718b58611df56bb2454d3b8a9536e7
  • Loading branch information
daiwei1983 authored and facebook-github-bot committed Aug 23, 2024
1 parent e39e29b commit 8268dd5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions fboss/agent/switch_config.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,7 @@ struct Port {
30: optional PortFlowletConfigName flowletConfigName;

31: Scope scope = Scope.LOCAL;
32: optional PortQueueConfigName portVoqConfigName;
}

enum LacpPortRate {
Expand Down
11 changes: 8 additions & 3 deletions fboss/fsdb/if/oss/fsdb_model_thriftpath.h
Original file line number Diff line number Diff line change
Expand Up @@ -14740,7 +14740,8 @@ std::pair<strings::portType, Child<::facebook::fboss::cfg::PortType, ::apache::t
std::pair<strings::expectedNeighborReachability, ChildThriftPath<::std::vector<::facebook::fboss::cfg::PortNeighbor>, ::facebook::fboss::fsdb::FsdbOperStateRoot, Self>>,
std::pair<strings::drainState, Child<::facebook::fboss::cfg::PortDrainState, ::apache::thrift::type_class::enumeration, ::apache::thrift::type::enum_t<::facebook::fboss::cfg::PortDrainState>>>,
std::pair<strings::flowletConfigName, Child<::std::string, ::apache::thrift::type_class::string, ::apache::thrift::type::string_t>>,
std::pair<strings::scope, Child<::facebook::fboss::cfg::Scope, ::apache::thrift::type_class::enumeration, ::apache::thrift::type::enum_t<::facebook::fboss::cfg::Scope>>>>;
std::pair<strings::scope, Child<::facebook::fboss::cfg::Scope, ::apache::thrift::type_class::enumeration, ::apache::thrift::type::enum_t<::facebook::fboss::cfg::Scope>>>,
std::pair<strings::portVoqConfigName, Child<::std::string, ::apache::thrift::type_class::string, ::apache::thrift::type::string_t>>>;
using ChildrenById = fatal::tuple< std::pair<std::integral_constant<apache::thrift::field_id_t, 1>, Child<::std::int32_t, ::apache::thrift::type_class::integral, ::apache::thrift::type::i32_t>>,
std::pair<std::integral_constant<apache::thrift::field_id_t, 2>, Child<::facebook::fboss::cfg::PortState, ::apache::thrift::type_class::enumeration, ::apache::thrift::type::enum_t<::facebook::fboss::cfg::PortState>>>,
std::pair<std::integral_constant<apache::thrift::field_id_t, 3>, Child<::std::int32_t, ::apache::thrift::type_class::integral, ::apache::thrift::type::i32_t>>,
Expand Down Expand Up @@ -14769,7 +14770,8 @@ std::pair<strings::scope, Child<::facebook::fboss::cfg::Scope, ::apache::thrift:
std::pair<std::integral_constant<apache::thrift::field_id_t, 28>, ChildThriftPath<::std::vector<::facebook::fboss::cfg::PortNeighbor>, ::facebook::fboss::fsdb::FsdbOperStateRoot, Self>>,
std::pair<std::integral_constant<apache::thrift::field_id_t, 29>, Child<::facebook::fboss::cfg::PortDrainState, ::apache::thrift::type_class::enumeration, ::apache::thrift::type::enum_t<::facebook::fboss::cfg::PortDrainState>>>,
std::pair<std::integral_constant<apache::thrift::field_id_t, 30>, Child<::std::string, ::apache::thrift::type_class::string, ::apache::thrift::type::string_t>>,
std::pair<std::integral_constant<apache::thrift::field_id_t, 31>, Child<::facebook::fboss::cfg::Scope, ::apache::thrift::type_class::enumeration, ::apache::thrift::type::enum_t<::facebook::fboss::cfg::Scope>>>>;
std::pair<std::integral_constant<apache::thrift::field_id_t, 31>, Child<::facebook::fboss::cfg::Scope, ::apache::thrift::type_class::enumeration, ::apache::thrift::type::enum_t<::facebook::fboss::cfg::Scope>>>,
std::pair<std::integral_constant<apache::thrift::field_id_t, 32>, Child<::std::string, ::apache::thrift::type_class::string, ::apache::thrift::type::string_t>>>;
template <typename Name>
using NameToId = fatal::tuple<std::pair<strings::logicalID, std::integral_constant<apache::thrift::field_id_t, 1>>,
std::pair<strings::state, std::integral_constant<apache::thrift::field_id_t, 2>>,
Expand Down Expand Up @@ -14799,7 +14801,8 @@ std::pair<strings::portType, std::integral_constant<apache::thrift::field_id_t,
std::pair<strings::expectedNeighborReachability, std::integral_constant<apache::thrift::field_id_t, 28>>,
std::pair<strings::drainState, std::integral_constant<apache::thrift::field_id_t, 29>>,
std::pair<strings::flowletConfigName, std::integral_constant<apache::thrift::field_id_t, 30>>,
std::pair<strings::scope, std::integral_constant<apache::thrift::field_id_t, 31>>>::template type_of<Name>;
std::pair<strings::scope, std::integral_constant<apache::thrift::field_id_t, 31>>,
std::pair<strings::portVoqConfigName, std::integral_constant<apache::thrift::field_id_t, 32>>>::template type_of<Name>;

template <typename Name>
using TypeFor = typename Children::template type_of<Name>;
Expand Down Expand Up @@ -14834,6 +14837,7 @@ std::pair<strings::scope, std::integral_constant<apache::thrift::field_id_t, 31>
STRUCT_CHILD_GETTERS(drainState, 29);
STRUCT_CHILD_GETTERS(flowletConfigName, 30);
STRUCT_CHILD_GETTERS(scope, 31);
STRUCT_CHILD_GETTERS(portVoqConfigName, 32);

template <apache::thrift::field_id_t __id>
auto operator()(const std::integral_constant<apache::thrift::field_id_t, __id>&) {
Expand Down Expand Up @@ -14866,6 +14870,7 @@ std::pair<strings::scope, std::integral_constant<apache::thrift::field_id_t, 31>
else if constexpr (__id == 29) { return drainState(); }
else if constexpr (__id == 30) { return flowletConfigName(); }
else if constexpr (__id == 31) { return scope(); }
else if constexpr (__id == 32) { return portVoqConfigName(); }
}

template <typename T, T... Values>
Expand Down

0 comments on commit 8268dd5

Please sign in to comment.