libbpf: Make global data internal arrays mmap()-able, if possible
authorAndrii Nakryiko <andriin@fb.com>
Sun, 17 Nov 2019 17:28:05 +0000 (09:28 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 18 Nov 2019 10:41:59 +0000 (11:41 +0100)
commit7fe74b436236b17ac57e46527166d22bcc230175
tree7caa1d7e4c28ee1b925410be13da037eaee7d902
parentfc9702273e2edb90400a34b3be76f7b08fa3344b
libbpf: Make global data internal arrays mmap()-able, if possible

Add detection of BPF_F_MMAPABLE flag support for arrays and add it as an extra
flag to internal global data maps, if supported by kernel. This allows users
to memory-map global data and use it without BPF map operations, greatly
simplifying user experience.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Liu <songliubraving@fb.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20191117172806.2195367-5-andriin@fb.com
tools/lib/bpf/libbpf.c