Skip to content

Commit

Permalink
Suppress storm detect counter increment for ongoing pfc storm case du…
Browse files Browse the repository at this point in the history
…ring 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 <wenni@microsoft.com>

* Comment touch-up

Signed-off-by: Wenda Ni <wenni@microsoft.com>
  • Loading branch information
wendani authored Jun 4, 2019
1 parent f3d0279 commit e8b8a90
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions orchagent/pfcactionhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 clamp 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);
}

Expand Down

0 comments on commit e8b8a90

Please sign in to comment.