Lines Matching refs:prog
80 int bpf_prog_offload_init(struct bpf_prog *prog, union bpf_attr *attr) in bpf_prog_offload_init() argument
97 offload->prog = prog; in bpf_prog_offload_init()
112 prog->aux->offload = offload; in bpf_prog_offload_init()
127 int bpf_prog_offload_verifier_prep(struct bpf_prog *prog) in bpf_prog_offload_verifier_prep() argument
133 offload = prog->aux->offload; in bpf_prog_offload_verifier_prep()
135 ret = offload->offdev->ops->prepare(prog); in bpf_prog_offload_verifier_prep()
150 offload = env->prog->aux->offload; in bpf_prog_offload_verify_insn()
165 offload = env->prog->aux->offload; in bpf_prog_offload_finalize()
186 offload = env->prog->aux->offload; in bpf_prog_offload_replace_insn()
203 offload = env->prog->aux->offload; in bpf_prog_offload_remove_insns()
212 static void __bpf_prog_offload_destroy(struct bpf_prog *prog) in __bpf_prog_offload_destroy() argument
214 struct bpf_prog_offload *offload = prog->aux->offload; in __bpf_prog_offload_destroy()
217 offload->offdev->ops->destroy(prog); in __bpf_prog_offload_destroy()
221 prog->aux->offload = NULL; in __bpf_prog_offload_destroy()
224 void bpf_prog_offload_destroy(struct bpf_prog *prog) in bpf_prog_offload_destroy() argument
227 if (prog->aux->offload) in bpf_prog_offload_destroy()
228 __bpf_prog_offload_destroy(prog); in bpf_prog_offload_destroy()
232 static int bpf_prog_offload_translate(struct bpf_prog *prog) in bpf_prog_offload_translate() argument
238 offload = prog->aux->offload; in bpf_prog_offload_translate()
240 ret = offload->offdev->ops->translate(prog); in bpf_prog_offload_translate()
253 int bpf_prog_offload_compile(struct bpf_prog *prog) in bpf_prog_offload_compile() argument
255 prog->bpf_func = bpf_prog_warn_on_exec; in bpf_prog_offload_compile()
257 return bpf_prog_offload_translate(prog); in bpf_prog_offload_compile()
261 struct bpf_prog *prog; member
268 struct bpf_prog_aux *aux = args->prog->aux; in bpf_prog_offload_info_fill_ns()
292 struct bpf_prog *prog) in bpf_prog_offload_info_fill() argument
295 .prog = prog, in bpf_prog_offload_info_fill()
298 struct bpf_prog_aux *aux = prog->aux; in bpf_prog_offload_info_fill()
543 static bool __bpf_offload_dev_match(struct bpf_prog *prog, in __bpf_offload_dev_match() argument
549 if (!bpf_prog_is_dev_bound(prog->aux)) in __bpf_offload_dev_match()
552 offload = prog->aux->offload; in __bpf_offload_dev_match()
564 bool bpf_offload_dev_match(struct bpf_prog *prog, struct net_device *netdev) in bpf_offload_dev_match() argument
569 ret = __bpf_offload_dev_match(prog, netdev); in bpf_offload_dev_match()
576 bool bpf_offload_prog_map_match(struct bpf_prog *prog, struct bpf_map *map) in bpf_offload_prog_map_match() argument
586 ret = __bpf_offload_dev_match(prog, offmap->netdev); in bpf_offload_prog_map_match()
656 __bpf_prog_offload_destroy(offload->prog); in bpf_offload_dev_netdev_unregister()