netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v2] Add BPF_SYNCHRONIZE_MAPS bpf(2) command
@ 2018-07-29 15:51 Alexei Starovoitov
  2018-07-29 20:46 ` Daniel Colascione
  2018-07-31  2:01 ` Joel Fernandes
  0 siblings, 2 replies; 35+ messages in thread
From: Alexei Starovoitov @ 2018-07-29 15:51 UTC (permalink / raw)
  To: Daniel Colascione
  Cc: Joel Fernandes, LKML, Tim Murray, Network Development,
	Lorenzo Colitti, Chenbo Feng, Mathieu Desnoyers,
	Alexei Starovoitov, Daniel Borkmann

On Thu, Jul 26, 2018 at 7:51 PM, Daniel Colascione <dancol@google.com> wrote:
> BPF_SYNCHRONIZE_MAPS waits for the release of any references to a BPF
> map made by a BPF program that is running at the time the
> BPF_SYNCHRONIZE_MAPS command is issued. The purpose of this command is
> to provide a means for userspace to replace a BPF map with another,
> newer version, then ensure that no component is still using the "old"
> map before manipulating the "old" map in some way.
>
> Signed-off-by: Daniel Colascione <dancol@google.com>
> ---
>  include/uapi/linux/bpf.h |  9 +++++++++
>  kernel/bpf/syscall.c     | 13 +++++++++++++
>  2 files changed, 22 insertions(+)
>
> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> index b7db3261c62d..5b27e9117d3e 100644
> --- a/include/uapi/linux/bpf.h
> +++ b/include/uapi/linux/bpf.h
> @@ -75,6 +75,14 @@ struct bpf_lpm_trie_key {
>         __u8    data[0];        /* Arbitrary size */
>  };
>
> +/* BPF_SYNCHRONIZE_MAPS waits for the release of any references to a
> + * BPF map made by a BPF program that is running at the time the
> + * BPF_SYNCHRONIZE_MAPS command is issued. The purpose of this command

that doesn't sound right to me.
such command won't wait for the release of the references.
in case of map-in-map the program does not hold
the references to inner map (only to outer map).

> + * is to provide a means for userspace to replace a BPF map with
> + * another, newer version, then ensure that no component is still
> + * using the "old" map before manipulating the "old" map in some way.
> + */

that's correct, but the whole paragraph still reads too
'generic' which will lead to confusion,
whereas the use case is map-in-map only.
I think bpf_sync_inner_map or
bpf_sync_map_in_map would be better
choices for the name.

btw i don't have reliable internet access at the moment,
so pls excuse the delays.

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2018-07-31 22:30 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20180707015616.25988-1-dancol@google.com>
2018-07-07  2:54 ` [RFC] Add BPF_SYNCHRONIZE bpf(2) command Alexei Starovoitov
2018-07-07  3:22   ` Daniel Colascione
2018-07-07 20:33   ` Joel Fernandes
2018-07-08 20:54     ` Mathieu Desnoyers
2018-07-09 21:09       ` Alexei Starovoitov
2018-07-09 21:35         ` Mathieu Desnoyers
2018-07-09 22:19           ` Paul E. McKenney
2018-07-09 22:19             ` Alexei Starovoitov
2018-07-09 22:48               ` Paul E. McKenney
2018-07-09 21:36         ` Daniel Colascione
2018-07-09 22:10           ` Alexei Starovoitov
2018-07-09 22:21             ` Daniel Colascione
2018-07-09 22:34               ` Alexei Starovoitov
2018-07-10  5:25                 ` Chenbo Feng
2018-07-10 23:52                   ` Alexei Starovoitov
2018-07-11  2:46                     ` Lorenzo Colitti
2018-07-11  3:40                       ` Alexei Starovoitov
2018-07-14 18:18                         ` Joel Fernandes
2018-07-16 15:29                           ` Daniel Colascione
2018-07-16 20:23                             ` Joel Fernandes
2018-07-26 16:51                               ` [PATCH v2] Add BPF_SYNCHRONIZE_MAPS " Daniel Colascione
2018-07-27 19:17                           ` [RFC] Add BPF_SYNCHRONIZE " Daniel Colascione
2018-07-10  5:13       ` Joel Fernandes
2018-07-10 16:42         ` Paul E. McKenney
2018-07-10 16:57           ` Joel Fernandes
2018-07-10 17:12             ` Paul E. McKenney
2018-07-10 17:29               ` Joel Fernandes
2018-07-10 17:42                 ` Paul E. McKenney
2018-07-29 15:51 [PATCH v2] Add BPF_SYNCHRONIZE_MAPS " Alexei Starovoitov
2018-07-29 20:46 ` Daniel Colascione
2018-07-31  2:01 ` Joel Fernandes
2018-07-31  2:06   ` Joel Fernandes
2018-07-31  4:03     ` Y Song
2018-07-31 21:56       ` Joel Fernandes
2018-07-31 22:30         ` Daniel Borkmann

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).