From 4f46f827d641ca60b9a34dd0df6593aa13496a4e Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Sat, 16 Nov 2024 11:50:03 -0800 Subject: [PATCH] Populate voq configs for non interface ports when applicable Summary: For 2-stage setups we can't rely on default VOQ configs (which map to NIF port configs) for other port types Reviewed By: zechengh09 Differential Revision: D66043600 fbshipit-source-id: 3ca96d6298d9ef4e9dcc217b2b004de5382d3b90 --- fboss/agent/test/utils/ConfigUtils.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fboss/agent/test/utils/ConfigUtils.cpp b/fboss/agent/test/utils/ConfigUtils.cpp index 991ceec89398f..909976a25e4c5 100644 --- a/fboss/agent/test/utils/ConfigUtils.cpp +++ b/fboss/agent/test/utils/ConfigUtils.cpp @@ -819,6 +819,15 @@ cfg::SwitchConfig genPortVlanCfg( portCfg->state() = cfg::PortState::ENABLED; portCfg->ingressVlan() = port2vlan.find(portID)->second; portCfg->maxFrameSize() = kPortMTU; + if (switchType == cfg::SwitchType::VOQ && + *portCfg->portType() != cfg::PortType::INTERFACE_PORT) { + auto nameAndVoqConfig = getNameAndDefaultVoqCfg(*portCfg->portType()); + if (nameAndVoqConfig.has_value()) { + config.portQueueConfigs()[nameAndVoqConfig->name] = + nameAndVoqConfig->queueConfig; + portCfg->portVoqConfigName() = nameAndVoqConfig->name; + } + } } portCfg->routable() = true; portCfg->parserType() = cfg::ParserType::L3;