summaryrefslogtreecommitdiff
path: root/drivers/net/geneve.c
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2017-04-27 02:39:35 +0300
committerDavid S. Miller <davem@davemloft.net>2017-04-28 22:48:15 +0300
commitf3515b5d0b718cceae9e67802cfa20d5e6f9b567 (patch)
treef36c473e0e53ef2018334abd8cffcf42b4dd70b6 /drivers/net/geneve.c
parent43bcf707ccdc79ee63edb953fcf72e6dc244cfa1 (diff)
downloadlinux-f3515b5d0b718cceae9e67802cfa20d5e6f9b567.tar.xz
bpf: provide a generic macro for percpu values for selftests
To overcome bugs as described and fixed in 89087c456fb5 ("bpf: Fix values type used in test_maps"), provide a generic BPF_DECLARE_PERCPU() and bpf_percpu() accessor macro for all percpu map values used in tests. Declaring variables works as follows (also works for structs): BPF_DECLARE_PERCPU(uint32_t, my_value); They can then be accessed normally as uint32_t type through: bpf_percpu(my_value, <cpu_nr>) For example: bpf_percpu(my_value, 0)++; Implicitly, we make sure that the passed type is allocated and aligned by gcc at least on a 8-byte boundary, so that it works together with the map lookup/update syscall for percpu maps. We use it as a usage example in test_maps, so that others are free to adapt this into their code when necessary. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/geneve.c')
0 files changed, 0 insertions, 0 deletions