diff options
| author | Russell King <rmk+kernel@armlinux.org.uk> | 2016-11-01 12:17:57 +0300 |
|---|---|---|
| committer | Russell King <rmk+kernel@armlinux.org.uk> | 2016-11-01 12:17:57 +0300 |
| commit | 9902aa4728fe9128ea45f1a772e2238d64d8cdc5 (patch) | |
| tree | cca30efb3ad2126fcb10aa6349ed799a5656e851 /include/linux/filter.h | |
| parent | df0bd1e8f3c508bf4c3445f94b12e38289b65f13 (diff) | |
| parent | 90731c24d2db7ec04df43ddbcee9605183d05187 (diff) | |
| download | linux-9902aa4728fe9128ea45f1a772e2238d64d8cdc5.tar.xz | |
Merge branch 'drm-tda998x-mali' into drm-tda998x-devel
Diffstat (limited to 'include/linux/filter.h')
| -rw-r--r-- | include/linux/filter.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h index 8f74f3d61894..a16439b99fd9 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -368,6 +368,11 @@ struct bpf_skb_data_end { void *data_end; }; +struct xdp_buff { + void *data; + void *data_end; +}; + /* compute the linear packet data range [data, data_end) which * will be accessed by cls_bpf and act_bpf programs */ @@ -429,6 +434,18 @@ static inline u32 bpf_prog_run_clear_cb(const struct bpf_prog *prog, return BPF_PROG_RUN(prog, skb); } +static inline u32 bpf_prog_run_xdp(const struct bpf_prog *prog, + struct xdp_buff *xdp) +{ + u32 ret; + + rcu_read_lock(); + ret = BPF_PROG_RUN(prog, (void *)xdp); + rcu_read_unlock(); + + return ret; +} + static inline unsigned int bpf_prog_size(unsigned int proglen) { return max(sizeof(struct bpf_prog), @@ -513,6 +530,7 @@ bool bpf_helper_changes_skb_data(void *func); struct bpf_prog *bpf_patch_insn_single(struct bpf_prog *prog, u32 off, const struct bpf_insn *patch, u32 len); +void bpf_warn_invalid_xdp_action(u32 act); #ifdef CONFIG_BPF_JIT extern int bpf_jit_enable; |
