Skip to content

Commit

Permalink
snabbmark esp: minor changes
Browse files Browse the repository at this point in the history
 * add a note that explains performance differences between esp transport and
   tunnel modes

 * explicitly return a single value from `decap' in tunnel mode (because of
   that thing where LuaJIT can trip over this)

...these changes are mostly notes to prevent future selfs from wondering about
this again.
  • Loading branch information
eugeneia committed Apr 12, 2018
1 parent 9d14b98 commit 7f75dc1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/program/snabbmark/README
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ Usage:
Optionally, a LuaJIT profiler option string can be supplied as <profile>,
which will cause the benchmark run to be profiled accordingly.

Note: transport mode may generally score better because it has to
encapsulate 40 bytes less per packet because of the enclosed IPv6 header
in tunnel mode, and this micro-benchmark measures end-to-end throughput.

snabbmark hash [<key-size>]
Benchmark hash functions used for internal data structures.

Expand Down
2 changes: 1 addition & 1 deletion src/program/snabbmark/snabbmark.lua
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ function esp (npackets, packet_size, mode, direction, profile)
local encap, decap
if mode == "tunnel" then
encap = function (p) return enc:encapsulate_tunnel(p, 41) end
decap = function (p) return dec:decapsulate_tunnel(p) end
decap = function (p) return (dec:decapsulate_tunnel(p)) end
else
encap = function (p) return enc:encapsulate_transport6(p) end
decap = function (p) return dec:decapsulate_transport6(p) end
Expand Down

0 comments on commit 7f75dc1

Please sign in to comment.