Skip to content

Commit

Permalink
[pfcwd] Convert polling interval from ms to us in LUA scripts (#1908)
Browse files Browse the repository at this point in the history
**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".
* sonic-net/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.
  • Loading branch information
volodymyrsamotiy committed Sep 16, 2021
1 parent d01524d commit 57d21e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions orchagent/pfc_detect_mellanox.lua
Original file line number Diff line number Diff line change
@@ -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 = {}

Expand Down
4 changes: 2 additions & 2 deletions orchagent/pfc_restore.lua
Original file line number Diff line number Diff line change
@@ -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 = {}

Expand Down

0 comments on commit 57d21e7

Please sign in to comment.