Skip to content

Commit

Permalink
Modify PFC test to check ingress congestion discards as well
Browse files Browse the repository at this point in the history
Summary:
As titled.

   OK : 7
   FAILED : 1
   SKIPPED : 0
   TIMEOUT : 0
```

Reviewed By: jasmeetbagga

Differential Revision: D60040839

fbshipit-source-id: eaabea2f5ebd4bbc95f159458abd01b110a1d837
  • Loading branch information
Nivin Lawrence authored and facebook-github-bot committed Aug 14, 2024
1 parent 30c6c4e commit 0195d9d
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions fboss/agent/hw/test/dataplane_tests/HwTrafficPfcTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,26 +446,36 @@ class HwTrafficPfcTest : public HwLinkStateDependentTest {
for (const auto& portId : portIds) {
auto portStats = getHwSwitchEnsemble()->getLatestPortStats(portId);
auto ingressDropRaw = *portStats.inDiscardsRaw_();
uint64_t ingressCongestionDiscards = 0;
std::string ingressCongestionDiscardLog{};
if (getHwSwitchEnsemble()->getAsic()->isSupported(
HwAsic::Feature::INGRESS_PRIORITY_GROUP_DROPPED_PACKETS)) {
ingressCongestionDiscards = *portStats.inCongestionDiscards_();
ingressCongestionDiscardLog = " IngressCongestionDiscards: " +
std::to_string(ingressCongestionDiscards);
}
XLOG(DBG0) << " validateIngressDropCounters: Port: " << portId
<< " IngressDropRaw: " << ingressDropRaw;
<< " IngressDropRaw: " << ingressDropRaw
<< ingressCongestionDiscardLog;
EXPECT_EVENTUALLY_GT(ingressDropRaw, 0);
if (getHwSwitchEnsemble()->getAsic()->isSupported(
HwAsic::Feature::INGRESS_PRIORITY_GROUP_DROPPED_PACKETS)) {
EXPECT_EVENTUALLY_GT(ingressCongestionDiscards, 0);
}
}
if (getAsic()->getAsicType() == cfg::AsicType::ASIC_TYPE_JERICHO3) {
// Jericho3 has additional VSQ drops counters which accounts for
// ingress buffer drops.
// TODO: Check if 'vsqResourceExhaustionDrops' is incrementing for
// now, eventually move to a new per port/PG based ingress congestion
// discard counter when supported via CS00012336173.
getHwSwitchEnsemble()->getHwSwitch()->updateStats();
fb303::ThreadCachedServiceData::get()->publishStats();
auto ingressCongestionDiscards = getHwSwitchEnsemble()
->getHwSwitch()
->getSwitchStats()
->getVsqResourcesExhautionDrops();
auto vsqResourcesExhautionDrops = getHwSwitchEnsemble()
->getHwSwitch()
->getSwitchStats()
->getVsqResourcesExhautionDrops();
XLOG(DBG0)
<< " validateIngressDropCounters: vsqResourceExhaustionDrops: "
<< ingressCongestionDiscards;
EXPECT_EVENTUALLY_GT(ingressCongestionDiscards, 0);
<< vsqResourcesExhautionDrops;
EXPECT_EVENTUALLY_GT(vsqResourcesExhautionDrops, 0);
}
});
}
Expand Down

0 comments on commit 0195d9d

Please sign in to comment.