Helper function bpf_get_local_storage
Definition
Copyright (c) 2015 The Libbpf Authors. All rights reserved.
Get the pointer to the local storage area. The type and the size of the local storage is defined by the map argument. The flags meaning is specific for each map type, and has to be 0 for cgroup local storage.
Depending on the BPF program type, a local storage area can be shared between multiple instances of the BPF program, running simultaneously.
A user should care about the synchronization by himself. For example, by using the BPF_ATOMIC instructions to alter the shared data.
Returns
A pointer to the local storage area.
static void *(* const bpf_get_local_storage)(void *map, __u64 flags) = (void *) 81;
Usage
Docs could be improved
This part of the docs is incomplete, contributions are very welcome
Program types
This helper call can be used in the following program types:
BPF_PROG_TYPE_CGROUP_DEVICE
BPF_PROG_TYPE_CGROUP_SKB
BPF_PROG_TYPE_CGROUP_SOCK
BPF_PROG_TYPE_CGROUP_SOCKOPT
BPF_PROG_TYPE_CGROUP_SOCK_ADDR
BPF_PROG_TYPE_CGROUP_SYSCTL
BPF_PROG_TYPE_SOCK_OPS
Map types
This helper call can be used with the following map types:
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome