diff options
| author | David S. Miller <davem@davemloft.net> | 2014-09-09 16:59:03 -0700 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-09-09 16:59:03 -0700 |
| commit | 60005c60b1ea807013bcbbfe9309fc924a3881f0 (patch) | |
| tree | 50f1a085ddd7923b2b3c2764c850d0c02447d32a /include | |
| parent | ca777eff51f7fbaebd954e645d8ecb781a906b4a (diff) | |
| parent | 286aad3c4014ca825c447e07e24f8929e6d266d2 (diff) | |
Merge branch 'bpf-next'
Daniel Borkmann says:
====================
BPF updates
[ Set applies on top of current net-next but also on top of
Alexei's latest patches. Please see individual patches for
more details. ]
Changelog:
v1->v2:
- Removed paragraph in 1st commit message
- Rest stays the same
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/filter.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h index 8f82ef3f1cdd..4b59edead908 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -289,15 +289,20 @@ struct sock_fprog_kern { struct sock_filter *filter; }; +struct bpf_binary_header { + unsigned int pages; + u8 image[]; +}; + struct bpf_work_struct { struct bpf_prog *prog; struct work_struct work; }; struct bpf_prog { - u32 pages; /* Number of allocated pages */ - u32 jited:1, /* Is our filter JIT'ed? */ - len:31; /* Number of filter blocks */ + u16 pages; /* Number of allocated pages */ + bool jited; /* Is our filter JIT'ed? */ + u32 len; /* Number of filter blocks */ struct sock_fprog_kern *orig_prog; /* Original BPF program */ struct bpf_work_struct *work; /* Deferred free work struct */ unsigned int (*bpf_func)(const struct sk_buff *skb, @@ -358,6 +363,14 @@ struct bpf_prog *bpf_prog_realloc(struct bpf_prog *fp_old, unsigned int size, gfp_t gfp_extra_flags); void __bpf_prog_free(struct bpf_prog *fp); +typedef void (*bpf_jit_fill_hole_t)(void *area, unsigned int size); + +struct bpf_binary_header * +bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr, + unsigned int alignment, + bpf_jit_fill_hole_t bpf_fill_ill_insns); +void bpf_jit_binary_free(struct bpf_binary_header *hdr); + static inline void bpf_prog_unlock_free(struct bpf_prog *fp) { bpf_prog_unlock_ro(fp); |
