41#define RTE_BPF_FUNC_MAX_ARGS 5
43#define RTE_BPF_EXEC_FLAG_JIT RTE_BIT64(0)
46#define RTE_BPF_EXEC_FLAG_MASK RTE_BPF_EXEC_FLAG_JIT
49#define RTE_BPF_FORMAT_FLAG_DISASSEMBLY 0
51#define RTE_BPF_FORMAT_FLAG_HEXADECIMAL RTE_BIT32(0)
55#define RTE_BPF_FORMAT_FLAG_RELATIVE_JUMPS 0
57#define RTE_BPF_FORMAT_FLAG_ABSOLUTE_JUMPS RTE_BIT32(1)
61#define RTE_BPF_FORMAT_FLAG_AUTO_WIDE 0
63#define RTE_BPF_FORMAT_FLAG_NEVER_WIDE RTE_BIT32(2)
93#define RTE_BPF_ARG_PTR_TYPE(x) ((x) & RTE_BPF_ARG_PTR)
111 uint64_t (*val)(uint64_t, uint64_t, uint64_t,
136struct rte_bpf_validate_debug;
153 const struct rte_ebpf_insn *
ins;
157 const struct bpf_insn *
ins;
179 struct rte_bpf_validate_debug *debug;
186 const struct rte_ebpf_insn *
ins;
202union rte_bpf_func_arg {
207typedef uint64_t (*rte_bpf_jit_func0_t)(void);
208typedef uint64_t (*rte_bpf_jit_func1_t)(
union rte_bpf_func_arg);
209typedef uint64_t (*rte_bpf_jit_func2_t)(
union rte_bpf_func_arg, union rte_bpf_func_arg);
210typedef uint64_t (*rte_bpf_jit_func3_t)(
union rte_bpf_func_arg, union rte_bpf_func_arg,
211 union rte_bpf_func_arg);
212typedef uint64_t (*rte_bpf_jit_func4_t)(
union rte_bpf_func_arg, union rte_bpf_func_arg,
213 union rte_bpf_func_arg, union rte_bpf_func_arg);
214typedef uint64_t (*rte_bpf_jit_func5_t)(
union rte_bpf_func_arg, union rte_bpf_func_arg,
215 union rte_bpf_func_arg, union rte_bpf_func_arg, union rte_bpf_func_arg);
223 rte_bpf_jit_func0_t func0;
224 rte_bpf_jit_func1_t func1;
225 rte_bpf_jit_func2_t func2;
226 rte_bpf_jit_func3_t func3;
227 rte_bpf_jit_func4_t func4;
228 rte_bpf_jit_func5_t func5;
234struct rte_bpf_prog_ctx {
235 union rte_bpf_func_arg arg[RTE_BPF_FUNC_MAX_ARGS];
394 uint64_t rc[], uint32_t num, uint64_t flags);
462 uint32_t pc, uint32_t flags);
@ RTE_BPF_ORIGIN_ELF_MEMORY
@ RTE_BPF_ORIGIN_ELF_FILE
__rte_experimental struct rte_bpf struct rte_bpf * rte_bpf_load(const struct rte_bpf_prm *prm) __rte_malloc __rte_dealloc(rte_bpf_destroy
int rte_bpf_get_jit(const struct rte_bpf *bpf, struct rte_bpf_jit *jit)
void rte_bpf_dump(FILE *f, const struct rte_ebpf_insn *buf, uint32_t len)
struct rte_bpf_prm * rte_bpf_convert(const struct bpf_program *prog) __rte_malloc __rte_dealloc_free
__rte_experimental int rte_bpf_get_jit_ex(const struct rte_bpf *bpf, struct rte_bpf_jit_ex *jit)
__rte_experimental struct rte_bpf struct rte_bpf struct rte_bpf * rte_bpf_elf_load(const struct rte_bpf_prm *prm, const char *fname, const char *sname) __rte_malloc __rte_dealloc(rte_bpf_destroy
__rte_experimental struct rte_bpf struct rte_bpf struct rte_bpf uint64_t rte_bpf_exec(const struct rte_bpf *bpf, void *ctx)
__rte_experimental uint64_t rte_bpf_exec_ex(const struct rte_bpf *bpf, const struct rte_bpf_prog_ctx *ctx, uint64_t flags)
__rte_experimental int rte_bpf_format(char *buffer, size_t bufsz, const struct rte_ebpf_insn *ins, uint32_t pc, uint32_t flags)
__rte_experimental struct rte_bpf * rte_bpf_load_ex(const struct rte_bpf_prm_ex *prm) __rte_malloc __rte_dealloc(rte_bpf_destroy
__rte_experimental bool rte_bpf_insn_is_wide(const struct rte_ebpf_insn *ins)
uint32_t rte_bpf_exec_burst(const struct rte_bpf *bpf, void *ctx[], uint64_t rc[], uint32_t num)
__rte_experimental uint32_t rte_bpf_exec_burst_ex(const struct rte_bpf *bpf, const struct rte_bpf_prog_ctx *ctx, uint64_t rc[], uint32_t num, uint64_t flags)
void rte_bpf_destroy(struct rte_bpf *bpf)
#define __rte_dealloc(dealloc, argno)
#define __rte_dealloc_free
const struct bpf_insn * ins
struct rte_bpf_arg prog_arg[RTE_BPF_FUNC_MAX_ARGS]
enum rte_bpf_origin origin
const struct rte_ebpf_insn * ins
const struct rte_bpf_xsym * xsym
struct rte_bpf_arg prog_arg
const struct rte_ebpf_insn * ins
const struct rte_bpf_xsym * xsym
struct rte_bpf_xsym::@82::@85 var
struct rte_bpf_arg args[RTE_BPF_FUNC_MAX_ARGS]