bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Stanislav Fomichev <sdf@google.com>
Cc: Networking <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	YiFei Zhu <zhuyifei@google.com>,
	YiFei Zhu <zhuyifei1999@gmail.com>
Subject: Re: [PATCH bpf-next v4 1/5] bpf: Mutex protect used_maps array and count
Date: Thu, 10 Sep 2020 12:23:12 -0700	[thread overview]
Message-ID: <CAEf4BzbQ-8=gg_64u0WTsncCj=3ovRyk_craSovttGohc0yZwA@mail.gmail.com> (raw)
In-Reply-To: <20200909182406.3147878-2-sdf@google.com>

On Wed, Sep 9, 2020 at 11:25 AM Stanislav Fomichev <sdf@google.com> wrote:
>
> From: YiFei Zhu <zhuyifei@google.com>
>
> 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@gmail.com>
> Signed-off-by: YiFei Zhu <zhuyifei@google.com>
> Signed-off-by: Stanislav Fomichev <sdf@google.com>
> ---
>  .../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@fb.com>

  reply	other threads:[~2020-09-10 19:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-09 18:24 [PATCH bpf-next v4 0/5] Allow storage of flexible metadata information for eBPF programs Stanislav Fomichev
2020-09-09 18:24 ` [PATCH bpf-next v4 1/5] bpf: Mutex protect used_maps array and count Stanislav Fomichev
2020-09-10 19:23   ` Andrii Nakryiko [this message]
2020-09-09 18:24 ` [PATCH bpf-next v4 2/5] bpf: Add BPF_PROG_BIND_MAP syscall Stanislav Fomichev
2020-09-10 19:29   ` Andrii Nakryiko
2020-09-09 18:24 ` [PATCH bpf-next v4 3/5] libbpf: Add BPF_PROG_BIND_MAP syscall and use it on .metadata section Stanislav Fomichev
2020-09-10 19:40   ` Andrii Nakryiko
2020-09-11 15:49     ` Stanislav Fomichev
2020-09-09 18:24 ` [PATCH bpf-next v4 4/5] bpftool: support dumping metadata Stanislav Fomichev
2020-09-10 19:54   ` Andrii Nakryiko
2020-09-11 15:56     ` Stanislav Fomichev
2020-09-09 18:24 ` [PATCH bpf-next v4 5/5] selftests/bpf: Test load and dump metadata with btftool and skel Stanislav Fomichev
2020-09-10 19:59   ` Andrii Nakryiko
2020-09-11 15:57     ` Stanislav Fomichev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEf4BzbQ-8=gg_64u0WTsncCj=3ovRyk_craSovttGohc0yZwA@mail.gmail.com' \
    --to=andrii.nakryiko@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=sdf@google.com \
    --cc=zhuyifei1999@gmail.com \
    --cc=zhuyifei@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).