Re: [PATCH bpf-next v4 1/5] bpf: Mutex protect used_maps array and count

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux