Lines Matching refs:prog
108 static void __bpf_prog_offload_destroy(struct bpf_prog *prog) in __bpf_prog_offload_destroy() argument
110 struct bpf_prog_offload *offload = prog->aux->offload; in __bpf_prog_offload_destroy()
113 offload->offdev->ops->destroy(prog); in __bpf_prog_offload_destroy()
117 prog->aux->offload = NULL; in __bpf_prog_offload_destroy()
178 __bpf_prog_offload_destroy(offload->prog); in __bpf_offload_dev_netdev_unregister()
188 static int __bpf_prog_dev_bound_init(struct bpf_prog *prog, struct net_device *netdev) in __bpf_prog_dev_bound_init() argument
198 offload->prog = prog; in __bpf_prog_dev_bound_init()
205 if (bpf_prog_is_offloaded(prog->aux) && (!ondev || !ondev->offdev)) { in __bpf_prog_dev_bound_init()
219 prog->aux->offload = offload; in __bpf_prog_dev_bound_init()
228 int bpf_prog_dev_bound_init(struct bpf_prog *prog, union bpf_attr *attr) in bpf_prog_dev_bound_init() argument
259 prog->aux->offload_requested = !(attr->prog_flags & BPF_F_XDP_DEV_BOUND_ONLY); in bpf_prog_dev_bound_init()
262 err = __bpf_prog_dev_bound_init(prog, netdev); in bpf_prog_dev_bound_init()
296 int bpf_prog_offload_verifier_prep(struct bpf_prog *prog) in bpf_prog_offload_verifier_prep() argument
302 offload = prog->aux->offload; in bpf_prog_offload_verifier_prep()
304 ret = offload->offdev->ops->prepare(prog); in bpf_prog_offload_verifier_prep()
319 offload = env->prog->aux->offload; in bpf_prog_offload_verify_insn()
334 offload = env->prog->aux->offload; in bpf_prog_offload_finalize()
355 offload = env->prog->aux->offload; in bpf_prog_offload_replace_insn()
372 offload = env->prog->aux->offload; in bpf_prog_offload_remove_insns()
381 void bpf_prog_dev_bound_destroy(struct bpf_prog *prog) in bpf_prog_dev_bound_destroy() argument
388 if (prog->aux->offload) { in bpf_prog_dev_bound_destroy()
389 list_del_init(&prog->aux->offload->offloads); in bpf_prog_dev_bound_destroy()
391 netdev = prog->aux->offload->netdev; in bpf_prog_dev_bound_destroy()
392 __bpf_prog_offload_destroy(prog); in bpf_prog_dev_bound_destroy()
402 static int bpf_prog_offload_translate(struct bpf_prog *prog) in bpf_prog_offload_translate() argument
408 offload = prog->aux->offload; in bpf_prog_offload_translate()
410 ret = offload->offdev->ops->translate(prog); in bpf_prog_offload_translate()
423 int bpf_prog_offload_compile(struct bpf_prog *prog) in bpf_prog_offload_compile() argument
425 prog->bpf_func = bpf_prog_warn_on_exec; in bpf_prog_offload_compile()
427 return bpf_prog_offload_translate(prog); in bpf_prog_offload_compile()
431 struct bpf_prog *prog; member
438 struct bpf_prog_aux *aux = args->prog->aux; in bpf_prog_offload_info_fill_ns()
462 struct bpf_prog *prog) in bpf_prog_offload_info_fill() argument
465 .prog = prog, in bpf_prog_offload_info_fill()
468 struct bpf_prog_aux *aux = prog->aux; in bpf_prog_offload_info_fill()
694 static bool __bpf_offload_dev_match(struct bpf_prog *prog, in __bpf_offload_dev_match() argument
700 if (!bpf_prog_is_dev_bound(prog->aux)) in __bpf_offload_dev_match()
703 offload = prog->aux->offload; in __bpf_offload_dev_match()
715 bool bpf_offload_dev_match(struct bpf_prog *prog, struct net_device *netdev) in bpf_offload_dev_match() argument
720 ret = __bpf_offload_dev_match(prog, netdev); in bpf_offload_dev_match()
743 bool bpf_offload_prog_map_match(struct bpf_prog *prog, struct bpf_map *map) in bpf_offload_prog_map_match() argument
753 ret = __bpf_offload_dev_match(prog, offmap->netdev); in bpf_offload_prog_map_match()
839 void *bpf_dev_bound_resolve_kfunc(struct bpf_prog *prog, u32 func_id) in bpf_dev_bound_resolve_kfunc() argument
850 if (!prog->aux->offload) in bpf_dev_bound_resolve_kfunc()
853 ops = prog->aux->offload->netdev->xdp_metadata_ops; in bpf_dev_bound_resolve_kfunc()