aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/bpf/helpers.c
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2015-05-29 17:23:07 -0400
committerDavid S. Miller <davem@davemloft.net>2015-06-01 00:44:44 -0400
commit3324b584b6f633a24550691c194600bcab7fc899 (patch)
tree2894bf499d8cc8d792711eef8684b65d3e45c853 /kernel/bpf/helpers.c
parent17ca8cbf49be3aa94bb1c2b7ee6545fd70094eb4 (diff)
ebpf: misc core cleanup
Besides others, move bpf_tail_call_proto to the remaining definitions of other protos, improve comments a bit (i.e. remove some obvious ones, where the code is already self-documenting, add objectives for others), simplify bpf_prog_array_compatible() a bit. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/bpf/helpers.c')
-rw-r--r--kernel/bpf/helpers.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
index b3aaabdf9a50..7ad5d8842d5b 100644
--- a/kernel/bpf/helpers.c
+++ b/kernel/bpf/helpers.c
@@ -45,11 +45,11 @@ static u64 bpf_map_lookup_elem(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5)
45} 45}
46 46
47const struct bpf_func_proto bpf_map_lookup_elem_proto = { 47const struct bpf_func_proto bpf_map_lookup_elem_proto = {
48 .func = bpf_map_lookup_elem, 48 .func = bpf_map_lookup_elem,
49 .gpl_only = false, 49 .gpl_only = false,
50 .ret_type = RET_PTR_TO_MAP_VALUE_OR_NULL, 50 .ret_type = RET_PTR_TO_MAP_VALUE_OR_NULL,
51 .arg1_type = ARG_CONST_MAP_PTR, 51 .arg1_type = ARG_CONST_MAP_PTR,
52 .arg2_type = ARG_PTR_TO_MAP_KEY, 52 .arg2_type = ARG_PTR_TO_MAP_KEY,
53}; 53};
54 54
55static u64 bpf_map_update_elem(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) 55static u64 bpf_map_update_elem(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5)
@@ -64,13 +64,13 @@ static u64 bpf_map_update_elem(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5)
64} 64}
65 65
66const struct bpf_func_proto bpf_map_update_elem_proto = { 66const struct bpf_func_proto bpf_map_update_elem_proto = {
67 .func = bpf_map_update_elem, 67 .func = bpf_map_update_elem,
68 .gpl_only = false, 68 .gpl_only = false,
69 .ret_type = RET_INTEGER, 69 .ret_type = RET_INTEGER,
70 .arg1_type = ARG_CONST_MAP_PTR, 70 .arg1_type = ARG_CONST_MAP_PTR,
71 .arg2_type = ARG_PTR_TO_MAP_KEY, 71 .arg2_type = ARG_PTR_TO_MAP_KEY,
72 .arg3_type = ARG_PTR_TO_MAP_VALUE, 72 .arg3_type = ARG_PTR_TO_MAP_VALUE,
73 .arg4_type = ARG_ANYTHING, 73 .arg4_type = ARG_ANYTHING,
74}; 74};
75 75
76static u64 bpf_map_delete_elem(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) 76static u64 bpf_map_delete_elem(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5)
@@ -84,11 +84,11 @@ static u64 bpf_map_delete_elem(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5)
84} 84}
85 85
86const struct bpf_func_proto bpf_map_delete_elem_proto = { 86const struct bpf_func_proto bpf_map_delete_elem_proto = {
87 .func = bpf_map_delete_elem, 87 .func = bpf_map_delete_elem,
88 .gpl_only = false, 88 .gpl_only = false,
89 .ret_type = RET_INTEGER, 89 .ret_type = RET_INTEGER,
90 .arg1_type = ARG_CONST_MAP_PTR, 90 .arg1_type = ARG_CONST_MAP_PTR,
91 .arg2_type = ARG_PTR_TO_MAP_KEY, 91 .arg2_type = ARG_PTR_TO_MAP_KEY,
92}; 92};
93 93
94static u64 bpf_get_prandom_u32(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) 94static u64 bpf_get_prandom_u32(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5)