bpf: fix pseudo calls for program loaded from ELF
authorKonstantin Ananyev <konstantin.ananyev@intel.com>
Fri, 17 May 2019 14:09:42 +0000 (15:09 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 5 Jun 2019 16:34:56 +0000 (18:34 +0200)
commit64ac6feb8291eb0fe74cf965dd3890625f8f3171
treef318a08dc73c7151d63f0dc50e72535df9b02565
parent9bd75b508e11fcb38589c90ae435734d6343ad78
bpf: fix pseudo calls for program loaded from ELF

clang 6.0 and onwards, for the external function call generates
BPF_PSEUDO_CALL instruction:
call pseudo +-off -> call another bpf function.
More details about that change: https://lwn.net/Articles/741773/
DPDK BPF implementation right now doesn't support multiple BPF
functions per module.
To overcome that problem, and preserve existing functionality
(ability to call allowed by user external functions),
bpf_elf_load() clears EBPF_PSEUDO_CALL value.
For details how to reproduce the issue:
https://bugs.dpdk.org/show_bug.cgi?id=259

Fixes: 5dba93ae5f2d ("bpf: add ability to load eBPF program from ELF object file")
Cc: stable@dpdk.org
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
lib/librte_bpf/bpf_def.h
lib/librte_bpf/bpf_load_elf.c
lib/librte_bpf/rte_bpf.h