From 08b05db2a1609b1d2e30b033416f4b64f755a9f3 Mon Sep 17 00:00:00 2001 From: Volodymyr Samotiy Date: Thu, 16 Sep 2021 12:09:33 +0300 Subject: [PATCH] [pfcwd] Convert polling interval from ms to us in LUA scripts (#1908) **What I did** Converted polling interval from milliseconds to microseconds in PFCWD LUA scripts. **Why I did it** PFCWD storm detection and restoration LUA scripts require values in microseconds. Due to recent changes polling interval is now passed in milliseconds by "FlexCounter". * Azure/sonic-sairedis#878 So need to convert values to microseconds (as it was before) in order to make PFCWD working, **How I verified it** Ran PFCWD tests from sonic-mgmt. --- orchagent/pfc_detect_mellanox.lua | 4 ++-- orchagent/pfc_restore.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/orchagent/pfc_detect_mellanox.lua b/orchagent/pfc_detect_mellanox.lua index 0f4d6d4f5d..6df16241e9 100644 --- a/orchagent/pfc_detect_mellanox.lua +++ b/orchagent/pfc_detect_mellanox.lua @@ -1,12 +1,12 @@ -- KEYS - queue IDs -- ARGV[1] - counters db index -- ARGV[2] - counters table name --- ARGV[3] - poll time interval +-- ARGV[3] - poll time interval (milliseconds) -- return queue Ids that satisfy criteria local counters_db = ARGV[1] local counters_table_name = ARGV[2] -local poll_time = tonumber(ARGV[3]) +local poll_time = tonumber(ARGV[3]) * 1000 local rets = {} diff --git a/orchagent/pfc_restore.lua b/orchagent/pfc_restore.lua index 4cf0ab49e5..7b137a40d3 100644 --- a/orchagent/pfc_restore.lua +++ b/orchagent/pfc_restore.lua @@ -1,12 +1,12 @@ -- KEYS - queue IDs -- ARGV[1] - counters db index -- ARGV[2] - counters table name --- ARGV[3] - poll time interval +-- ARGV[3] - poll time interval (milliseconds) -- return queue Ids that satisfy criteria local counters_db = ARGV[1] local counters_table_name = ARGV[2] -local poll_time = tonumber(ARGV[3]) +local poll_time = tonumber(ARGV[3]) * 1000 local rets = {}