bpf: add JIT compilation for x86_64 ISA

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
This commit is contained in:
Konstantin Ananyev 2018-05-10 11:23:06 +01:00 committed by Thomas Monjalon
parent 6e12ec4c4d
commit cc752e43e0
4 changed files with 1381 additions and 0 deletions

View File

@ -28,6 +28,9 @@ SRCS-$(CONFIG_RTE_LIBRTE_BPF) += bpf_validate.c
ifeq ($(CONFIG_RTE_LIBRTE_BPF_ELF),y)
SRCS-$(CONFIG_RTE_LIBRTE_BPF) += bpf_load_elf.c
endif
ifeq ($(CONFIG_RTE_ARCH_X86_64),y)
SRCS-$(CONFIG_RTE_LIBRTE_BPF) += bpf_jit_x86.c
endif
# install header files
SYMLINK-$(CONFIG_RTE_LIBRTE_BPF)-include += bpf_def.h

View File

@ -41,7 +41,12 @@ bpf_jit(struct rte_bpf *bpf)
{
int32_t rc;
#ifdef RTE_ARCH_X86_64
rc = bpf_jit_x86(bpf);
#else
rc = -ENOTSUP;
#endif
if (rc != 0)
RTE_BPF_LOG(WARNING, "%s(%p) failed, error code: %d;\n",
__func__, bpf, rc);

1369
lib/librte_bpf/bpf_jit_x86.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,10 @@ sources = files('bpf.c',
'bpf_load.c',
'bpf_validate.c')
if arch_subdir == 'x86'
sources += files('bpf_jit_x86.c')
endif
install_headers = files('bpf_def.h',
'rte_bpf.h')