bpf: introduce the bpf_get_local_storage() helper function
authorRoman Gushchin <guro@fb.com>
Thu, 2 Aug 2018 21:27:24 +0000 (14:27 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 2 Aug 2018 22:47:32 +0000 (00:47 +0200)
commitcd3394317653837e2eb5c5d0904a8996102af9fc
tree7f0c16ba103be23baa66f94c18c851c62e2eb682
parent7b5dd2bde72cd33313b63cf3ba1de6a9e443a65d
bpf: introduce the bpf_get_local_storage() helper function

The bpf_get_local_storage() helper function is used
to get a pointer to the bpf local storage from a bpf program.

It takes a pointer to a storage map and flags as arguments.
Right now it accepts only cgroup storage maps, and flags
argument has to be 0. Further it can be extended to support
other types of local storage: e.g. thread local storage etc.

Signed-off-by: Roman Gushchin <guro@fb.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/linux/bpf.h
include/uapi/linux/bpf.h
kernel/bpf/cgroup.c
kernel/bpf/core.c
kernel/bpf/helpers.c
kernel/bpf/verifier.c
net/core/filter.c