From 86923d4a55ea69dbc47a80f7ef4bccd7b2fd7034 Mon Sep 17 00:00:00 2001 From: Wenda Ni Date: Wed, 1 May 2019 03:50:58 +0000 Subject: [PATCH 1/2] Suppress storm detect counter increment for ongoing pfc storm case during a warm reboot Signed-off-by: Wenda Ni --- orchagent/pfcactionhandler.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/orchagent/pfcactionhandler.cpp b/orchagent/pfcactionhandler.cpp index 0b94b77475..41c442f26f 100644 --- a/orchagent/pfcactionhandler.cpp +++ b/orchagent/pfcactionhandler.cpp @@ -55,14 +55,23 @@ void PfcWdActionHandler::initCounters(void) } auto wdQueueStats = getQueueStats(m_countersTable, sai_serialize_object_id(m_queue)); - wdQueueStats.detectCount++; + // initCounters() is called when the event channel receives + // a storm signal. This can happen when there is a true new storm or + // when there is an existing storm ongoing before warm-reboot. In the latter case, + // we treat the storm as an old storm. In particular, + // we do not increment the detectCount so as to clutch the + // gap between detectCount and restoreCount by 1 at maximum + if (!(wdQueueStats.detectCount > wdQueueStats.restoreCount)) + { + wdQueueStats.detectCount++; + + wdQueueStats.txPktLast = 0; + wdQueueStats.txDropPktLast = 0; + wdQueueStats.rxPktLast = 0; + wdQueueStats.rxDropPktLast = 0; + } wdQueueStats.operational = false; - wdQueueStats.txPktLast = 0; - wdQueueStats.txDropPktLast = 0; - wdQueueStats.rxPktLast = 0; - wdQueueStats.rxDropPktLast = 0; - updateWdCounters(sai_serialize_object_id(m_queue), wdQueueStats); } From 43f876092693ed8c2113f97a8ab15018a36c4e41 Mon Sep 17 00:00:00 2001 From: Wenda Ni Date: Wed, 1 May 2019 06:46:11 +0000 Subject: [PATCH 2/2] Comment touch-up Signed-off-by: Wenda Ni --- orchagent/pfcactionhandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orchagent/pfcactionhandler.cpp b/orchagent/pfcactionhandler.cpp index 41c442f26f..3778ef1c5f 100644 --- a/orchagent/pfcactionhandler.cpp +++ b/orchagent/pfcactionhandler.cpp @@ -59,7 +59,7 @@ void PfcWdActionHandler::initCounters(void) // a storm signal. This can happen when there is a true new storm or // when there is an existing storm ongoing before warm-reboot. In the latter case, // we treat the storm as an old storm. In particular, - // we do not increment the detectCount so as to clutch the + // we do not increment the detectCount so as to clamp the // gap between detectCount and restoreCount by 1 at maximum if (!(wdQueueStats.detectCount > wdQueueStats.restoreCount)) {