Lines Matching refs:bpf

28 	percpu_ref_kill(&cgrp->bpf.refcnt);  in cgroup_bpf_offline()
111 bpf.release_work); in cgroup_bpf_release()
113 struct list_head *storages = &cgrp->bpf.storages; in cgroup_bpf_release()
120 for (atype = 0; atype < ARRAY_SIZE(cgrp->bpf.progs); atype++) { in cgroup_bpf_release()
121 struct list_head *progs = &cgrp->bpf.progs[atype]; in cgroup_bpf_release()
134 cgrp->bpf.effective[atype], in cgroup_bpf_release()
149 percpu_ref_exit(&cgrp->bpf.refcnt); in cgroup_bpf_release()
160 struct cgroup *cgrp = container_of(ref, struct cgroup, bpf.refcnt); in cgroup_bpf_release_fn()
162 INIT_WORK(&cgrp->bpf.release_work, cgroup_bpf_release); in cgroup_bpf_release_fn()
163 queue_work(system_wq, &cgrp->bpf.release_work); in cgroup_bpf_release_fn()
207 u32 flags = p->bpf.flags[atype]; in hierarchy_allows_attach()
212 cnt = prog_list_length(&p->bpf.progs[atype]); in hierarchy_allows_attach()
239 if (cnt == 0 || (p->bpf.flags[atype] & BPF_F_ALLOW_MULTI)) in compute_effective_progs()
240 cnt += prog_list_length(&p->bpf.progs[atype]); in compute_effective_progs()
252 if (cnt > 0 && !(p->bpf.flags[atype] & BPF_F_ALLOW_MULTI)) in compute_effective_progs()
255 list_for_each_entry(pl, &p->bpf.progs[atype], node) { in compute_effective_progs()
275 old_array = rcu_replace_pointer(cgrp->bpf.effective[atype], old_array, in activate_effective_progs()
292 #define NR ARRAY_SIZE(cgrp->bpf.effective) in cgroup_bpf_inherit()
297 ret = percpu_ref_init(&cgrp->bpf.refcnt, cgroup_bpf_release_fn, 0, in cgroup_bpf_inherit()
306 INIT_LIST_HEAD(&cgrp->bpf.progs[i]); in cgroup_bpf_inherit()
308 INIT_LIST_HEAD(&cgrp->bpf.storages); in cgroup_bpf_inherit()
325 percpu_ref_exit(&cgrp->bpf.refcnt); in cgroup_bpf_inherit()
340 if (percpu_ref_is_zero(&desc->bpf.refcnt)) in update_effective_progs()
343 err = compute_effective_progs(desc, atype, &desc->bpf.inactive); in update_effective_progs()
352 if (percpu_ref_is_zero(&desc->bpf.refcnt)) { in update_effective_progs()
353 if (unlikely(desc->bpf.inactive)) { in update_effective_progs()
354 bpf_prog_array_free(desc->bpf.inactive); in update_effective_progs()
355 desc->bpf.inactive = NULL; in update_effective_progs()
360 activate_effective_progs(desc, atype, desc->bpf.inactive); in update_effective_progs()
361 desc->bpf.inactive = NULL; in update_effective_progs()
373 bpf_prog_array_free(desc->bpf.inactive); in update_effective_progs()
374 desc->bpf.inactive = NULL; in update_effective_progs()
462 progs = &cgrp->bpf.progs[atype]; in __cgroup_bpf_attach()
467 if (!list_empty(progs) && cgrp->bpf.flags[atype] != saved_flags) in __cgroup_bpf_attach()
500 cgrp->bpf.flags[atype] = saved_flags; in __cgroup_bpf_attach()
558 if (percpu_ref_is_zero(&desc->bpf.refcnt)) in replace_effective_prog()
563 if (pos && !(cg->bpf.flags[atype] & BPF_F_ALLOW_MULTI)) in replace_effective_prog()
566 head = &cg->bpf.progs[atype]; in replace_effective_prog()
578 desc->bpf.effective[atype], in replace_effective_prog()
608 progs = &cgrp->bpf.progs[atype]; in __cgroup_bpf_replace()
709 progs = &cgrp->bpf.progs[atype]; in __cgroup_bpf_detach()
710 flags = cgrp->bpf.flags[atype]; in __cgroup_bpf_detach()
734 cgrp->bpf.flags[atype] = 0; in __cgroup_bpf_detach()
775 progs = &cgrp->bpf.progs[atype]; in __cgroup_bpf_query()
776 flags = cgrp->bpf.flags[atype]; in __cgroup_bpf_query()
778 effective = rcu_dereference_protected(cgrp->bpf.effective[atype], in __cgroup_bpf_query()
1079 cgrp->bpf.effective[atype], skb, __bpf_prog_run_save_cb); in __cgroup_bpf_run_filter_skb()
1081 ret = BPF_PROG_RUN_ARRAY_CG(cgrp->bpf.effective[atype], skb, in __cgroup_bpf_run_filter_skb()
1112 ret = BPF_PROG_RUN_ARRAY_CG(cgrp->bpf.effective[atype], sk, bpf_prog_run); in __cgroup_bpf_run_filter_sk()
1159 ret = BPF_PROG_RUN_ARRAY_CG_FLAGS(cgrp->bpf.effective[atype], &ctx, in __cgroup_bpf_run_filter_sock_addr()
1189 ret = BPF_PROG_RUN_ARRAY_CG(cgrp->bpf.effective[atype], sock_ops, in __cgroup_bpf_run_filter_sock_ops()
1208 allow = BPF_PROG_RUN_ARRAY_CG(cgrp->bpf.effective[atype], &ctx, in __cgroup_bpf_check_dev_permission()
1340 ret = BPF_PROG_RUN_ARRAY_CG(cgrp->bpf.effective[atype], &ctx, bpf_prog_run); in __cgroup_bpf_run_filter_sysctl()
1364 prog_array = rcu_dereference(cgrp->bpf.effective[attach_type]); in __cgroup_bpf_prog_array_is_empty()
1454 ret = BPF_PROG_RUN_ARRAY_CG(cgrp->bpf.effective[CGROUP_SETSOCKOPT], in __cgroup_bpf_run_filter_setsockopt()
1564 ret = BPF_PROG_RUN_ARRAY_CG(cgrp->bpf.effective[CGROUP_GETSOCKOPT], in __cgroup_bpf_run_filter_getsockopt()
1625 ret = BPF_PROG_RUN_ARRAY_CG(cgrp->bpf.effective[CGROUP_GETSOCKOPT], in __cgroup_bpf_run_filter_getsockopt_kern()