Skip to content

Commit 57d21e7

Browse files
[pfcwd] Convert polling interval from ms to us in LUA scripts (sonic-net#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". * 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.
1 parent d01524d commit 57d21e7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

orchagent/pfc_detect_mellanox.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
-- KEYS - queue IDs
22
-- ARGV[1] - counters db index
33
-- ARGV[2] - counters table name
4-
-- ARGV[3] - poll time interval
4+
-- ARGV[3] - poll time interval (milliseconds)
55
-- return queue Ids that satisfy criteria
66

77
local counters_db = ARGV[1]
88
local counters_table_name = ARGV[2]
9-
local poll_time = tonumber(ARGV[3])
9+
local poll_time = tonumber(ARGV[3]) * 1000
1010

1111
local rets = {}
1212

orchagent/pfc_restore.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
-- KEYS - queue IDs
22
-- ARGV[1] - counters db index
33
-- ARGV[2] - counters table name
4-
-- ARGV[3] - poll time interval
4+
-- ARGV[3] - poll time interval (milliseconds)
55
-- return queue Ids that satisfy criteria
66

77
local counters_db = ARGV[1]
88
local counters_table_name = ARGV[2]
9-
local poll_time = tonumber(ARGV[3])
9+
local poll_time = tonumber(ARGV[3]) * 1000
1010

1111
local rets = {}
1212

0 commit comments

Comments
 (0)