Skip to content

Commit

Permalink
Merge PR #1460 (core.packet: fix account_free physical capacity formu…
Browse files Browse the repository at this point in the history
…la) into max-next
  • Loading branch information
eugeneia committed Nov 18, 2021
2 parents ac7636c + c1c4854 commit 6b9e2f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/packet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ function account_free (p)
counter.add(engine.freebytes, p.length)
-- Calculate bits of physical capacity required for packet on 10GbE
-- Account for minimum data size and overhead of CRC and inter-packet gap
counter.add(engine.freebits, (math.max(p.length, 46) + 4 + 5) * 8)
-- https://en.wikipedia.org/wiki/Ethernet_frame
counter.add(engine.freebits, (12 + 8 + math.max(p.length, 60) + 4) * 8)
end

function free (p)
Expand Down

0 comments on commit 6b9e2f9

Please sign in to comment.