1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Intel Corporation
12 #include <rte_common.h>
19 __rte_experimental void
20 rte_bpf_destroy(struct rte_bpf *bpf)
23 if (bpf->jit.func != NULL)
24 munmap(bpf->jit.func, bpf->jit.sz);
29 __rte_experimental int
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 #ifdef RTE_ARCH_X86_64
45 rc = bpf_jit_x86(bpf);
51 RTE_BPF_LOG(WARNING, "%s(%p) failed, error code: %d;\n",
56 RTE_INIT(rte_bpf_init_log);
59 rte_bpf_init_log(void)
61 rte_bpf_logtype = rte_log_register("lib.bpf");
62 if (rte_bpf_logtype >= 0)
63 rte_log_set_level(rte_bpf_logtype, RTE_LOG_INFO);