From 3bd941a28a27fed13fe544bd81153003d4a7eb3e Mon Sep 17 00:00:00 2001 From: Srikrishna Gopu Date: Tue, 14 Nov 2023 16:59:06 -0800 Subject: [PATCH] logging for sendPacketCpuAndFrontPanel voq test Summary: As titled, logging for sendPacketCpuAndFrontPanel voq test. This helps catching regression when bcm runs the sanity tests. Reviewed By: shri-khare Differential Revision: D51293862 fbshipit-source-id: 684d356152207f61de840c512ce2b6d8f029455e --- fboss/agent/hw/test/HwVoqSwitchTests.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fboss/agent/hw/test/HwVoqSwitchTests.cpp b/fboss/agent/hw/test/HwVoqSwitchTests.cpp index d5231db08b77e..3784af8fbcf3b 100644 --- a/fboss/agent/hw/test/HwVoqSwitchTests.cpp +++ b/fboss/agent/hw/test/HwVoqSwitchTests.cpp @@ -526,6 +526,15 @@ TEST_F(HwVoqSwitchTest, sendPacketCpuAndFrontPanel) { kDscpAclCounterName()); }; + auto printQueueStats = [](std::string queueStatDesc, + std::string packetsOrBytes, + std::map queueStatsMap) { + for (const auto& [queueId, pktsOrBytes] : queueStatsMap) { + XLOG(DBG2) << queueStatDesc << ": Queue ID: " << queueId << ", " + << packetsOrBytes << ": " << pktsOrBytes; + } + }; + int64_t beforeQueueOutPkts = 0, beforeQueueOutBytes = 0; int64_t afterQueueOutPkts = 0, afterQueueOutBytes = 0; int64_t beforeVoQOutBytes = 0, afterVoQOutBytes = 0; @@ -534,10 +543,13 @@ TEST_F(HwVoqSwitchTest, sendPacketCpuAndFrontPanel) { auto beforeAllQueueOut = getAllQueueOutPktsBytes(); beforeQueueOutPkts = beforeAllQueueOut.first.at(kDefaultQueue); beforeQueueOutBytes = beforeAllQueueOut.second.at(kDefaultQueue); + printQueueStats("Before Queue Out", "Packets", beforeAllQueueOut.first); + printQueueStats("Before Queue Out", "Bytes", beforeAllQueueOut.second); } auto beforeAllVoQOutBytes = getAllVoQOutBytes(); beforeVoQOutBytes = beforeAllVoQOutBytes.at(kDefaultQueue); + printQueueStats("Before VoQ Out", "Bytes", beforeAllVoQOutBytes); auto [beforeOutPkts, beforeOutBytes] = getPortOutPktsBytes(); auto beforeAclPkts = @@ -554,6 +566,8 @@ TEST_F(HwVoqSwitchTest, sendPacketCpuAndFrontPanel) { maxRetryCount, std::chrono::milliseconds(sleepTimeMsecs), { auto afterAllVoQOutBytes = getAllVoQOutBytes(); afterVoQOutBytes = afterAllVoQOutBytes.at(kDefaultQueue); + printQueueStats("After VoQ Out", "Bytes", afterAllVoQOutBytes); + if (getAsic()->isSupported(HwAsic::Feature::L3_QOS)) { auto afterAllQueueOut = getAllQueueOutPktsBytes(); afterQueueOutPkts = afterAllQueueOut.first.at(kDefaultQueue);