diff --git a/fboss/agent/test/utils/BUCK b/fboss/agent/test/utils/BUCK index 34127a6533655..496d49a389cff 100644 --- a/fboss/agent/test/utils/BUCK +++ b/fboss/agent/test/utils/BUCK @@ -502,6 +502,7 @@ cpp_library( "VoqTestUtils.h", ], exported_deps = [ + "//fboss/agent:agent_features", "//fboss/agent:core", "//fboss/agent:fboss-types", "//fboss/agent:switch_config-cpp2-types", diff --git a/fboss/agent/test/utils/VoqTestUtils.cpp b/fboss/agent/test/utils/VoqTestUtils.cpp index 769198c06fbf5..0ea4ae68ce570 100644 --- a/fboss/agent/test/utils/VoqTestUtils.cpp +++ b/fboss/agent/test/utils/VoqTestUtils.cpp @@ -9,6 +9,7 @@ */ #include "fboss/agent/test/utils/VoqTestUtils.h" +#include "fboss/agent/AgentFeatures.h" #include "fboss/agent/DsfStateUpdaterUtil.h" #include "fboss/agent/SwSwitch.h" #include "fboss/agent/test/TestEnsembleIf.h" @@ -328,34 +329,56 @@ void setupRemoteIntfAndSysPorts(SwSwitch* swSwitch, bool useEncapIndex) { std::vector getDefaultNifVoqCfg() { std::vector voqs; + if (isDualStage3Q2QMode()) { + cfg::PortQueue rdmaQueue; + rdmaQueue.id() = 0; + rdmaQueue.name() = "rdma"; + rdmaQueue.streamType() = cfg::StreamType::UNICAST; + rdmaQueue.scheduling() = cfg::QueueScheduling::INTERNAL; + voqs.push_back(rdmaQueue); - cfg::PortQueue defaultQueue; - defaultQueue.id() = 0; - defaultQueue.name() = "default"; - defaultQueue.streamType() = cfg::StreamType::UNICAST; - defaultQueue.scheduling() = cfg::QueueScheduling::INTERNAL; - voqs.push_back(defaultQueue); - - cfg::PortQueue rdmaQueue; - rdmaQueue.id() = 2; - rdmaQueue.name() = "rdma"; - rdmaQueue.streamType() = cfg::StreamType::UNICAST; - rdmaQueue.scheduling() = cfg::QueueScheduling::INTERNAL; - voqs.push_back(rdmaQueue); - - cfg::PortQueue monitoringQueue; - monitoringQueue.id() = 6; - monitoringQueue.name() = "monitoring"; - monitoringQueue.streamType() = cfg::StreamType::UNICAST; - monitoringQueue.scheduling() = cfg::QueueScheduling::INTERNAL; - voqs.push_back(monitoringQueue); - - cfg::PortQueue ncQueue; - ncQueue.id() = 7; - ncQueue.name() = "nc"; - ncQueue.streamType() = cfg::StreamType::UNICAST; - ncQueue.scheduling() = cfg::QueueScheduling::INTERNAL; - voqs.push_back(ncQueue); + cfg::PortQueue monitoringQueue; + monitoringQueue.id() = 1; + monitoringQueue.name() = "monitoring"; + monitoringQueue.streamType() = cfg::StreamType::UNICAST; + monitoringQueue.scheduling() = cfg::QueueScheduling::INTERNAL; + voqs.push_back(monitoringQueue); + + cfg::PortQueue ncQueue; + ncQueue.id() = 2; + ncQueue.name() = "nc"; + ncQueue.streamType() = cfg::StreamType::UNICAST; + ncQueue.scheduling() = cfg::QueueScheduling::INTERNAL; + voqs.push_back(ncQueue); + } else { + cfg::PortQueue defaultQueue; + defaultQueue.id() = 0; + defaultQueue.name() = "default"; + defaultQueue.streamType() = cfg::StreamType::UNICAST; + defaultQueue.scheduling() = cfg::QueueScheduling::INTERNAL; + voqs.push_back(defaultQueue); + + cfg::PortQueue rdmaQueue; + rdmaQueue.id() = 2; + rdmaQueue.name() = "rdma"; + rdmaQueue.streamType() = cfg::StreamType::UNICAST; + rdmaQueue.scheduling() = cfg::QueueScheduling::INTERNAL; + voqs.push_back(rdmaQueue); + + cfg::PortQueue monitoringQueue; + monitoringQueue.id() = 6; + monitoringQueue.name() = "monitoring"; + monitoringQueue.streamType() = cfg::StreamType::UNICAST; + monitoringQueue.scheduling() = cfg::QueueScheduling::INTERNAL; + voqs.push_back(monitoringQueue); + + cfg::PortQueue ncQueue; + ncQueue.id() = 7; + ncQueue.name() = "nc"; + ncQueue.streamType() = cfg::StreamType::UNICAST; + ncQueue.scheduling() = cfg::QueueScheduling::INTERNAL; + voqs.push_back(ncQueue); + } return voqs; }