From 7c6ebb183f23adbb491fee6b60ca7b1b95002c39 Mon Sep 17 00:00:00 2001 From: Wenda Ni Date: Thu, 31 Oct 2019 15:53:28 -0700 Subject: [PATCH] [fix] Use the same storm detection condition for queue occupancy non-zero case as the zero case (#1111) * Check if pfc is at on state over the polling period for queue occupany non-zero case Signed-off-by: Wenda Ni * Use the same condition for queue occupany zero and non-zero cases Signed-off-by: Wenda Ni * Remove single line comments that no longer valid --- orchagent/pfc_detect_broadcom.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/orchagent/pfc_detect_broadcom.lua b/orchagent/pfc_detect_broadcom.lua index 9fe0b6a66de7..e7106cbd24f8 100644 --- a/orchagent/pfc_detect_broadcom.lua +++ b/orchagent/pfc_detect_broadcom.lua @@ -67,11 +67,8 @@ for i = n, 1, -1 do pfc_on2off_last = tonumber(pfc_on2off_last) -- Check actual condition of queue being in PFC storm - if (occupancy_bytes > 0 and packets - packets_last == 0 and pfc_rx_packets - pfc_rx_packets_last > 0) or - -- DEBUG CODE START. Uncomment to enable - (debug_storm == "enabled") or - -- DEBUG CODE END. - (occupancy_bytes == 0 and pfc_rx_packets - pfc_rx_packets_last > 0 and pfc_on2off - pfc_on2off_last == 0 and queue_pause_status_last == 'true' and queue_pause_status == 'true') then + if (pfc_rx_packets - pfc_rx_packets_last > 0 and pfc_on2off - pfc_on2off_last == 0 and queue_pause_status_last == 'true' and queue_pause_status == 'true') or + (debug_storm == "enabled") then if time_left <= poll_time then redis.call('PUBLISH', 'PFC_WD_ACTION', '["' .. KEYS[i] .. '","storm"]') is_deadlock = true