On Wed, Sep 9, 2020 at 11:25 AM Stanislav Fomichev <sdf@xxxxxxxxxx> wrote: > > From: YiFei Zhu <zhuyifei@xxxxxxxxxx> > > 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 <zhuyifei1999@xxxxxxxxx> > Signed-off-by: YiFei Zhu <zhuyifei@xxxxxxxxxx> > Signed-off-by: Stanislav Fomichev <sdf@xxxxxxxxxx> > --- > .../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 <andriin@xxxxxx>