Lines Matching refs:fp
78 struct bpf_prog *fp; in bpf_prog_alloc() local
81 fp = __vmalloc(size, gfp_flags, PAGE_KERNEL); in bpf_prog_alloc()
82 if (fp == NULL) in bpf_prog_alloc()
85 kmemcheck_annotate_bitfield(fp, meta); in bpf_prog_alloc()
89 vfree(fp); in bpf_prog_alloc()
93 fp->pages = size / PAGE_SIZE; in bpf_prog_alloc()
94 fp->aux = aux; in bpf_prog_alloc()
95 fp->aux->prog = fp; in bpf_prog_alloc()
97 return fp; in bpf_prog_alloc()
106 struct bpf_prog *fp; in bpf_prog_realloc() local
114 fp = __vmalloc(size, gfp_flags, PAGE_KERNEL); in bpf_prog_realloc()
115 if (fp != NULL) { in bpf_prog_realloc()
116 kmemcheck_annotate_bitfield(fp, meta); in bpf_prog_realloc()
118 memcpy(fp, fp_old, fp_old->pages * PAGE_SIZE); in bpf_prog_realloc()
119 fp->pages = size / PAGE_SIZE; in bpf_prog_realloc()
120 fp->aux->prog = fp; in bpf_prog_realloc()
129 return fp; in bpf_prog_realloc()
133 void __bpf_prog_free(struct bpf_prog *fp) in __bpf_prog_free() argument
135 kfree(fp->aux); in __bpf_prog_free()
136 vfree(fp); in __bpf_prog_free()
658 const struct bpf_prog *fp) in bpf_prog_array_compatible() argument
664 array->owner_prog_type = fp->type; in bpf_prog_array_compatible()
665 array->owner_jited = fp->jited; in bpf_prog_array_compatible()
670 return array->owner_prog_type == fp->type && in bpf_prog_array_compatible()
671 array->owner_jited == fp->jited; in bpf_prog_array_compatible()
674 static int bpf_check_tail_call(const struct bpf_prog *fp) in bpf_check_tail_call() argument
676 struct bpf_prog_aux *aux = fp->aux; in bpf_check_tail_call()
687 if (!bpf_prog_array_compatible(array, fp)) in bpf_check_tail_call()
701 int bpf_prog_select_runtime(struct bpf_prog *fp) in bpf_prog_select_runtime() argument
703 fp->bpf_func = (void *) __bpf_prog_run; in bpf_prog_select_runtime()
705 bpf_int_jit_compile(fp); in bpf_prog_select_runtime()
706 bpf_prog_lock_ro(fp); in bpf_prog_select_runtime()
713 return bpf_check_tail_call(fp); in bpf_prog_select_runtime()
726 void bpf_prog_free(struct bpf_prog *fp) in bpf_prog_free() argument
728 struct bpf_prog_aux *aux = fp->aux; in bpf_prog_free()