summaryrefslogtreecommitdiffstats
path: root/samples/bpf/bpf_helpers.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-09-18 06:09:07 +0200
committerDavid S. Miller <davem@davemloft.net>2015-09-18 06:09:07 +0200
commit41a9802fd87316ac736182e2debc579e987c8311 (patch)
tree4a74088c6a959041fd267fcf03466ca7eea355e1 /samples/bpf/bpf_helpers.h
parentnet: only check perm protocol when register proto (diff)
parentbpf: add bpf_redirect() helper (diff)
downloadlinux-41a9802fd87316ac736182e2debc579e987c8311.tar.xz
linux-41a9802fd87316ac736182e2debc579e987c8311.zip
Merge branch 'bpf_avoid_clone'
Alexei Starovoitov says: ==================== bpf: performance improvements v1->v2: dropped redundant iff_up check in patch 2 At plumbers we discussed different options on how to get rid of skb_clone from bpf_clone_redirect(), the patch 2 implements the best option. Patch 1 adds 'integrated exts' to cls_bpf to improve performance by combining simple actions into bpf classifier. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/bpf/bpf_helpers.h')
-rw-r--r--samples/bpf/bpf_helpers.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/samples/bpf/bpf_helpers.h b/samples/bpf/bpf_helpers.h
index 3a44d3a272af..21aa1b44c30c 100644
--- a/samples/bpf/bpf_helpers.h
+++ b/samples/bpf/bpf_helpers.h
@@ -33,6 +33,10 @@ static int (*bpf_get_current_comm)(void *buf, int buf_size) =
(void *) BPF_FUNC_get_current_comm;
static int (*bpf_perf_event_read)(void *map, int index) =
(void *) BPF_FUNC_perf_event_read;
+static int (*bpf_clone_redirect)(void *ctx, int ifindex, int flags) =
+ (void *) BPF_FUNC_clone_redirect;
+static int (*bpf_redirect)(int ifindex, int flags) =
+ (void *) BPF_FUNC_redirect;
/* llvm builtin functions that eBPF C program may use to
* emit BPF_LD_ABS and BPF_LD_IND instructions