Lines Matching refs:bpf
30 for (type = 0; type < ARRAY_SIZE(cgrp->bpf.progs); type++) { in cgroup_bpf_put()
31 struct list_head *progs = &cgrp->bpf.progs[type]; in cgroup_bpf_put()
42 bpf_prog_array_free(cgrp->bpf.effective[type]); in cgroup_bpf_put()
76 u32 flags = p->bpf.flags[type]; in hierarchy_allows_attach()
81 cnt = prog_list_length(&p->bpf.progs[type]); in hierarchy_allows_attach()
107 if (cnt == 0 || (p->bpf.flags[type] & BPF_F_ALLOW_MULTI)) in compute_effective_progs()
108 cnt += prog_list_length(&p->bpf.progs[type]); in compute_effective_progs()
120 if (cnt > 0 && !(p->bpf.flags[type] & BPF_F_ALLOW_MULTI)) in compute_effective_progs()
123 list_for_each_entry(pl, &p->bpf.progs[type], node) { in compute_effective_progs()
143 old_array = xchg(&cgrp->bpf.effective[type], array); in activate_effective_progs()
159 #define NR ARRAY_SIZE(cgrp->bpf.effective) in cgroup_bpf_inherit()
164 INIT_LIST_HEAD(&cgrp->bpf.progs[i]); in cgroup_bpf_inherit()
190 err = compute_effective_progs(desc, type, &desc->bpf.inactive); in update_effective_progs()
199 activate_effective_progs(desc, type, desc->bpf.inactive); in update_effective_progs()
200 desc->bpf.inactive = NULL; in update_effective_progs()
212 bpf_prog_array_free(desc->bpf.inactive); in update_effective_progs()
213 desc->bpf.inactive = NULL; in update_effective_progs()
233 struct list_head *progs = &cgrp->bpf.progs[type]; in __cgroup_bpf_attach()
247 if (!list_empty(progs) && cgrp->bpf.flags[type] != flags) in __cgroup_bpf_attach()
300 cgrp->bpf.flags[type] = flags; in __cgroup_bpf_attach()
341 struct list_head *progs = &cgrp->bpf.progs[type]; in __cgroup_bpf_detach()
342 u32 flags = cgrp->bpf.flags[type]; in __cgroup_bpf_detach()
393 cgrp->bpf.flags[type] = 0; in __cgroup_bpf_detach()
411 struct list_head *progs = &cgrp->bpf.progs[type]; in __cgroup_bpf_query()
412 u32 flags = cgrp->bpf.flags[type]; in __cgroup_bpf_query()
416 cnt = bpf_prog_array_length(cgrp->bpf.effective[type]); in __cgroup_bpf_query()
433 return bpf_prog_array_copy_to_user(cgrp->bpf.effective[type], in __cgroup_bpf_query()
539 ret = BPF_PROG_RUN_ARRAY(cgrp->bpf.effective[type], skb, in __cgroup_bpf_run_filter_skb()
566 ret = BPF_PROG_RUN_ARRAY(cgrp->bpf.effective[type], sk, BPF_PROG_RUN); in __cgroup_bpf_run_filter_sk()
610 ret = BPF_PROG_RUN_ARRAY(cgrp->bpf.effective[type], &ctx, BPF_PROG_RUN); in __cgroup_bpf_run_filter_sock_addr()
639 ret = BPF_PROG_RUN_ARRAY(cgrp->bpf.effective[type], sock_ops, in __cgroup_bpf_run_filter_sock_ops()
658 allow = BPF_PROG_RUN_ARRAY(cgrp->bpf.effective[type], &ctx, in __cgroup_bpf_check_dev_permission()