bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 bpf-next 0/3] bpf: Relax the max_entries check for inner map
@ 2020-08-28  1:18 Martin KaFai Lau
  2020-08-28  1:18 ` [PATCH v3 bpf-next 1/3] bpf: Add map_meta_equal map ops Martin KaFai Lau
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Martin KaFai Lau @ 2020-08-28  1:18 UTC (permalink / raw)
  To: bpf; +Cc: Alexei Starovoitov, Daniel Borkmann, kernel-team, netdev

v3:
- Add map_meta_equal to bpf_map_ops and use it as an explict
  opt-in support for map-in-map
  
v2:
- New BPF_MAP_TYPE_FL to minimize code churns (Alexei)
- s/capabilities/properties/ (Andrii)
- Describe WHY in commit log (Andrii)

People has a use case that starts with a smaller inner map first and then
replaces it with a larger inner map later when it is needed.

This series allows the outer map to be updated with inner map in different
size as long as it is safe (meaning the max_entries is not used in the
verification time during prog load).

Please see individual patch for details.

Martin KaFai Lau (3):
  bpf: Add map_meta_equal map ops
  bpf: Relax max_entries check for most of the inner map types
  bpf: selftests: Add test for different inner map size

 include/linux/bpf.h                           | 16 +++++++++
 kernel/bpf/arraymap.c                         | 16 +++++++++
 kernel/bpf/bpf_inode_storage.c                |  1 +
 kernel/bpf/cpumap.c                           |  1 +
 kernel/bpf/devmap.c                           |  2 ++
 kernel/bpf/hashtab.c                          |  4 +++
 kernel/bpf/lpm_trie.c                         |  1 +
 kernel/bpf/map_in_map.c                       | 24 +++++--------
 kernel/bpf/map_in_map.h                       |  2 --
 kernel/bpf/queue_stack_maps.c                 |  2 ++
 kernel/bpf/reuseport_array.c                  |  1 +
 kernel/bpf/ringbuf.c                          |  1 +
 kernel/bpf/stackmap.c                         |  1 +
 kernel/bpf/syscall.c                          |  1 +
 net/core/bpf_sk_storage.c                     |  1 +
 net/core/sock_map.c                           |  2 ++
 net/xdp/xskmap.c                              |  8 +++++
 .../selftests/bpf/prog_tests/btf_map_in_map.c | 35 ++++++++++++++++++-
 .../selftests/bpf/progs/test_btf_map_in_map.c | 31 ++++++++++++++++
 19 files changed, 132 insertions(+), 18 deletions(-)

-- 
2.24.1


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

end of thread, other threads:[~2020-08-28 15:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-28  1:18 [PATCH v3 bpf-next 0/3] bpf: Relax the max_entries check for inner map Martin KaFai Lau
2020-08-28  1:18 ` [PATCH v3 bpf-next 1/3] bpf: Add map_meta_equal map ops Martin KaFai Lau
2020-08-28  1:18 ` [PATCH v3 bpf-next 2/3] bpf: Relax max_entries check for most of the inner map types Martin KaFai Lau
2020-08-28  1:18 ` [PATCH v3 bpf-next 3/3] bpf: selftests: Add test for different inner map size Martin KaFai Lau
2020-08-28 15:27 ` [PATCH v3 bpf-next 0/3] bpf: Relax the max_entries check for inner map 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).