Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion orchagent/port_rates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,17 @@ local function compute_rate(port)
local fec_corr_bits_last = redis.call('HGET', rates_table_name .. ':' .. port, 'SAI_PORT_STAT_IF_FEC_CORRECTED_BITS_last')
local fec_uncorr_frames_last = redis.call('HGET', rates_table_name .. ':' .. port, 'SAI_PORT_STAT_IF_FEC_NOT_CORRECTABLE_FARMES_last')

-- Initialize to 0 if last counter values does not exist (during first boot for eg)
fec_corr_bits_last = tonumber(fec_corr_bits_last) or 0
fec_uncorr_frames_last = tonumber(fec_uncorr_frames_last) or 0

local serdes_rate_total = lanes_count * serdes_speed * delta / 1000

fec_corr_bits_ber_new = (fec_corr_bits - fec_corr_bits_last) / serdes_rate_total
fec_uncorr_bits_ber_new = (fec_uncorr_frames - fec_uncorr_frames_last) * rs_average_frame_ber / serdes_rate_total
else
logit("FEC counters or lane info not found on " .. port)
end

else
redis.call('HSET', state_table, 'INIT_DONE', 'COUNTERS_LAST')
end
Expand Down
Loading