diff options
author | 2018-09-03 09:55:07 +0200 | |
---|---|---|
committer | 2018-09-06 22:34:08 -0700 | |
commit | 47b123ed9e99b064dd2b250e1b62e1d91dd876ee (patch) | |
tree | 27b71b96b126afcd8985e03153554ccc10305c35 /drivers/pnp | |
parent | xdp: explicit inline __xdp_map_lookup_elem (diff) | |
download | linux-dev-47b123ed9e99b064dd2b250e1b62e1d91dd876ee.tar.xz linux-dev-47b123ed9e99b064dd2b250e1b62e1d91dd876ee.zip |
xdp: split code for map vs non-map redirect
The compiler does an efficient job of inlining static C functions.
Perf top clearly shows that almost everything gets inlined into the
function call xdp_do_redirect.
The function xdp_do_redirect end-up containing and interleaving the
map and non-map redirect code. This is sub-optimal, as it would be
strange for an XDP program to use both types of redirect in the same
program. The two use-cases are separate, and interleaving the code
just cause more instruction-cache pressure.
I would like to stress (again) that the non-map variant bpf_redirect
is very slow compared to the bpf_redirect_map variant, approx half the
speed. Measured with driver i40e the difference is:
- map redirect: 13,250,350 pps
- non-map redirect: 7,491,425 pps
For this reason, the function name of the non-map variant of redirect
have been called xdp_do_redirect_slow. This hopefully gives a hint
when using perf, that this is not the optimal XDP redirect operating mode.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'drivers/pnp')
0 files changed, 0 insertions, 0 deletions