On Wed, Sep 9, 2020 at 11:25 AM Stanislav Fomichev [off-list ref] wrote:
From: YiFei Zhu <redacted>
To support modifying the used_maps array, we use a mutex to protect
the use of the counter and the array. The mutex is initialized right
after the prog aux is allocated, and destroyed right before prog
aux is freed. This way we guarantee it's initialized for both cBPF
and eBPF.
Cc: YiFei Zhu <redacted>
Signed-off-by: YiFei Zhu <redacted>
Signed-off-by: Stanislav Fomichev <redacted>
---
.../net/ethernet/netronome/nfp/bpf/offload.c | 18 ++++++++++++------
include/linux/bpf.h | 1 +
kernel/bpf/core.c | 15 +++++++++++----
kernel/bpf/syscall.c | 16 ++++++++++++----
net/core/dev.c | 11 ++++++++---
5 files changed, 44 insertions(+), 17 deletions(-)
LGTM.
Acked-by: Andrii Nakryiko <redacted>