1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Intel Corporation
12 #include <rte_common.h>
20 rte_bpf_destroy(struct rte_bpf *bpf)
23 if (bpf->jit.func != NULL)
24 munmap(bpf->jit.func, bpf->jit.sz);
30 rte_bpf_get_jit(const struct rte_bpf *bpf, struct rte_bpf_jit *jit)
32 if (bpf == NULL || jit == NULL)
40 bpf_jit(struct rte_bpf *bpf)
44 #if defined(RTE_ARCH_X86_64)
45 rc = bpf_jit_x86(bpf);
46 #elif defined(RTE_ARCH_ARM64)
47 rc = bpf_jit_arm64(bpf);
53 RTE_BPF_LOG(WARNING, "%s(%p) failed, error code: %d;\n",
58 RTE_INIT(rte_bpf_init_log)
60 rte_bpf_logtype = rte_log_register("lib.bpf");
61 if (rte_bpf_logtype >= 0)
62 rte_log_set_level(rte_bpf_logtype, RTE_LOG_INFO);