Skip to content

Commit

Permalink
Fix issue: accumulative headroom can exceed limit in rare scenario (#…
Browse files Browse the repository at this point in the history
…2020)

- What I did
The egress mirror size is not taken into account when checking the accumulative headroom size, which causes the estimated accumulate headroom size to be greater than the real one and unable to be applied.

- Why I did it
Bug fix

- How I verified it
Run regression test.

- Details if related
An example to explain the logic .
The current accumulative headroom is 90k, egress mirror headroom is 10k, the ASIC limitation of the port is 100k.
Now a user wants to change the port configuration which will make the accumulative headroom to be increased by 10k.
Now the accumulative headroom estimated by buffer manager is 100k, which doesn’t exceed the limitation. However in the ASIC the real accumulative headroom is 110k which does.
  • Loading branch information
stephenxs authored and arlakshm committed Nov 18, 2021
1 parent 0a94ae4 commit faa5ca5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cfgmgr/buffer_check_headroom_mellanox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ end
-- Initialize the accumulative size with 4096
-- This is to absorb the possible deviation
local accumulative_size = 4096
-- Egress mirror size: 2 * maximum MTU (10k)
local egress_mirror_size = 20*1024

local appl_db = "0"
local state_db = "6"
Expand Down Expand Up @@ -56,8 +58,9 @@ local pipeline_latency = tonumber(redis.call('HGET', asic_keys[1], 'pipeline_lat
if is_port_with_8lanes(lanes) then
-- The pipeline latency should be adjusted accordingly for ports with 2 buffer units
pipeline_latency = pipeline_latency * 2 - 1
egress_mirror_size = egress_mirror_size * 2
end
accumulative_size = accumulative_size + 2 * pipeline_latency * 1024
accumulative_size = accumulative_size + 2 * pipeline_latency * 1024 + egress_mirror_size

-- Fetch all keys in BUFFER_PG according to the port
redis.call('SELECT', appl_db)
Expand Down

0 comments on commit faa5ca5

Please sign in to comment.