Skip to content

Commit e8b8a90

Browse files
authored
Suppress storm detect counter increment for ongoing pfc storm case during a warm reboot (sonic-net#869)
* Suppress storm detect counter increment for ongoing pfc storm case during a warm reboot Signed-off-by: Wenda Ni <[email protected]> * Comment touch-up Signed-off-by: Wenda Ni <[email protected]>
1 parent f3d0279 commit e8b8a90

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

orchagent/pfcactionhandler.cpp

+15-6
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,23 @@ void PfcWdActionHandler::initCounters(void)
5555
}
5656

5757
auto wdQueueStats = getQueueStats(m_countersTable, sai_serialize_object_id(m_queue));
58-
wdQueueStats.detectCount++;
58+
// initCounters() is called when the event channel receives
59+
// a storm signal. This can happen when there is a true new storm or
60+
// when there is an existing storm ongoing before warm-reboot. In the latter case,
61+
// we treat the storm as an old storm. In particular,
62+
// we do not increment the detectCount so as to clamp the
63+
// gap between detectCount and restoreCount by 1 at maximum
64+
if (!(wdQueueStats.detectCount > wdQueueStats.restoreCount))
65+
{
66+
wdQueueStats.detectCount++;
67+
68+
wdQueueStats.txPktLast = 0;
69+
wdQueueStats.txDropPktLast = 0;
70+
wdQueueStats.rxPktLast = 0;
71+
wdQueueStats.rxDropPktLast = 0;
72+
}
5973
wdQueueStats.operational = false;
6074

61-
wdQueueStats.txPktLast = 0;
62-
wdQueueStats.txDropPktLast = 0;
63-
wdQueueStats.rxPktLast = 0;
64-
wdQueueStats.rxDropPktLast = 0;
65-
6675
updateWdCounters(sai_serialize_object_id(m_queue), wdQueueStats);
6776
}
6877

0 commit comments

Comments
 (0)