Skip to content

Commit

Permalink
fix broken AgentVoqSwitchTest after enabling noAclForTrap
Browse files Browse the repository at this point in the history
Summary: ACL based rx reason traps are now disabled on DNX starting from 12.0 brcm-sai, see D65280288. These traps are replaced by explicit FBOSS ACL config instead.

Reviewed By: shri-khare

Differential Revision: D66846592

fbshipit-source-id: 7edafa7ff97d325606d09c156d4db3cc947c05b8
  • Loading branch information
daiwei1983 authored and facebook-github-bot committed Dec 6, 2024
1 parent dac87e9 commit 053145f
Showing 1 changed file with 3 additions and 45 deletions.
48 changes: 3 additions & 45 deletions fboss/agent/test/agent_hw_tests/AgentVoqSwitchTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,14 @@ class AgentVoqSwitchTest : public AgentHwTest {
const AgentEnsemble& ensemble) const override {
// Increase the query timeout to be 5sec
FLAGS_hwswitch_query_timeout = 5000;
// Before m-mpu agent test, use first Asic for initialization.
auto switchIds = ensemble.getSw()->getHwAsicTable()->getSwitchIDs();
CHECK_GE(switchIds.size(), 1);
auto asic =
ensemble.getSw()->getHwAsicTable()->getHwAsic(*switchIds.cbegin());
auto config = utility::onePortPerInterfaceConfig(
ensemble.getSw(),
ensemble.masterLogicalPortIds(),
true /*interfaceHasSubnet*/);
const auto& cpuStreamTypes =
asic->getQueueStreamTypes(cfg::PortType::CPU_PORT);
for (const auto& cpuStreamType : cpuStreamTypes) {
if (asic->getDefaultNumPortQueues(
cpuStreamType, cfg::PortType::CPU_PORT)) {
// cpu queues supported
auto l3Asics = ensemble.getSw()->getHwAsicTable()->getL3Asics();
addCpuTrafficPolicy(config, l3Asics);
utility::addCpuQueueConfig(config, l3Asics, ensemble.isSai());
break;
}
}
utility::addNetworkAIQosMaps(config, ensemble.getL3Asics());
utility::setDefaultCpuTrafficPolicyConfig(
config, ensemble.getL3Asics(), ensemble.isSai());
utility::addCpuQueueConfig(config, ensemble.getL3Asics(), ensemble.isSai());
return config;
}

Expand Down Expand Up @@ -343,34 +329,6 @@ class AgentVoqSwitchTest : public AgentHwTest {
});
return portDescs;
}

private:
void addCpuTrafficPolicy(
cfg::SwitchConfig& cfg,
std::vector<const HwAsic*>& l3Asics) const {
cfg::CPUTrafficPolicyConfig cpuConfig;
std::vector<cfg::PacketRxReasonToQueue> rxReasonToQueues;
std::vector<std::pair<cfg::PacketRxReason, uint16_t>>
rxReasonToQueueMappings = {
std::pair(
cfg::PacketRxReason::BGP,
utility::getCoppHighPriQueueId(l3Asics)),
std::pair(
cfg::PacketRxReason::BGPV6,
utility::getCoppHighPriQueueId(l3Asics)),
std::pair(
cfg::PacketRxReason::CPU_IS_NHOP,
utility::getCoppMidPriQueueId(l3Asics)),
};
for (auto rxEntry : rxReasonToQueueMappings) {
auto rxReasonToQueue = cfg::PacketRxReasonToQueue();
rxReasonToQueue.rxReason() = rxEntry.first;
rxReasonToQueue.queueId() = rxEntry.second;
rxReasonToQueues.push_back(rxReasonToQueue);
}
cpuConfig.rxReasonToQueueOrderedList() = rxReasonToQueues;
cfg.cpuTrafficPolicy() = cpuConfig;
}
};

class AgentVoqSwitchLineRateTest : public AgentVoqSwitchTest {
Expand Down

0 comments on commit 053145f

Please sign in to comment.