bpf/tests: add performance and correctness tests for LD_ABS_DW

net.core.bpf_jit_enable = 0
[   29.246177] test_bpf: #305 perf: LD_ABS byte jited:0 52 PASS
[   29.248082] test_bpf: #306 perf: LD_ABS_DW byte jited:0 44 PASS
[   29.249256] test_bpf: #307 perf: LD_ABS word jited:0 62 PASS
[   29.250848] test_bpf: #308 perf: LD_ABS_DW word jited:0 35 PASS
[   29.251958] test_bpf: #309 perf: LD_IND byte jited:0 53 PASS
[   29.253224] test_bpf: #310 perf: LD_IND_DW byte jited:0 44 PASS
[   29.254398] test_bpf: Summary: 6 PASSED, 0 FAILED, [0/6 JIT'ed]
net.core.bpf_jit_enable = 1
[   29.259261] test_bpf: #305 perf: LD_ABS byte jited:1 18 PASS
[   29.260416] test_bpf: #306 perf: LD_ABS_DW byte jited:1 5 PASS
[   29.261216] test_bpf: #307 perf: LD_ABS word jited:1 24 PASS
[   29.262268] test_bpf: #308 perf: LD_ABS_DW word jited:1 5 PASS
[   29.263121] test_bpf: #309 perf: LD_IND byte jited:1 20 PASS
[   29.264064] test_bpf: #310 perf: LD_IND_DW byte jited:1 5 PASS

ld_abs_dw style of packet access is slightly faster in interpreter
and dramatically faster after JIT.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2 files changed