summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/bpf_helpers.h
diff options
context:
space:
mode:
authorJohn Fastabend <john.fastabend@gmail.com>2017-08-28 07:10:04 -0700
committerDavid S. Miller <davem@davemloft.net>2017-08-28 11:13:21 -0700
commit464bc0fd6273d518aee79fbd37211dd9bc35d863 (patch)
tree32280f0588583c50f6712de2ad0e3af886dcaadd /tools/testing/selftests/bpf/bpf_helpers.h
parent901c5d2fbfcdc5d1d49a7a835b9ce9be5eee6393 (diff)
bpf: convert sockmap field attach_bpf_fd2 to type
In the initial sockmap API we provided strparser and verdict programs using a single attach command by extending the attach API with a the attach_bpf_fd2 field. However, if we add other programs in the future we will be adding a field for every new possible type, attach_bpf_fd(3,4,..). This seems a bit clumsy for an API. So lets push the programs using two new type fields. BPF_SK_SKB_STREAM_PARSER BPF_SK_SKB_STREAM_VERDICT This has the advantage of having a readable name and can easily be extended in the future. Updates to samples and sockmap included here also generalize tests slightly to support upcoming patch for multiple map support. Signed-off-by: John Fastabend <john.fastabend@gmail.com> Fixes: 174a79ff9515 ("bpf: sockmap with sk redirect support") Suggested-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests/bpf/bpf_helpers.h')
-rw-r--r--tools/testing/selftests/bpf/bpf_helpers.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h
index 98f3be26d390..36fb9161b34a 100644
--- a/tools/testing/selftests/bpf/bpf_helpers.h
+++ b/tools/testing/selftests/bpf/bpf_helpers.h
@@ -68,8 +68,7 @@ static int (*bpf_setsockopt)(void *ctx, int level, int optname, void *optval,
static int (*bpf_sk_redirect_map)(void *map, int key, int flags) =
(void *) BPF_FUNC_sk_redirect_map;
static int (*bpf_sock_map_update)(void *map, void *key, void *value,
- unsigned long long flags,
- unsigned long long map_lags) =
+ unsigned long long flags) =
(void *) BPF_FUNC_sock_map_update;