BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next 00/10] Fixes for LPM trie
@ 2024-11-18  1:07 Hou Tao
  2024-11-18  1:07 ` [PATCH bpf-next 01/10] bpf: Remove unnecessary check when updating " Hou Tao
                   ` (11 more replies)
  0 siblings, 12 replies; 40+ messages in thread
From: Hou Tao @ 2024-11-18  1:07 UTC (permalink / raw)
  To: bpf
  Cc: Martin KaFai Lau, Alexei Starovoitov, Andrii Nakryiko,
	Eduard Zingerman, Song Liu, Hao Luo, Yonghong Song,
	Daniel Borkmann, KP Singh, Stanislav Fomichev, Jiri Olsa,
	John Fastabend, Sebastian Andrzej Siewior, Thomas Gleixner,
	Thomas Weißschuh, houtao1, xukuohai

From: Hou Tao <houtao1@huawei.com>

Hi,

This patch set fixes several issues for LPM trie. These issues were
found during adding new test cases or were reported by syzbot.

The patch set is structured as follows:

Patch #1~#2 are clean-ups for lpm_trie_update_elem().
Patch #3 handles BPF_EXIST and BPF_NOEXIST correctly for LPM trie.
Patch #4 fixes the accounting of n_entries when doing in-place update.
Patch #5 fixes the exact match condition in trie_get_next_key() and it
may skip keys when the passed key is not found in the map.
Patch #6~7 switch from kmalloc() to bpf memory allocator for LPM trie to
fix several lock order warnings reported by syzbot.
Patch #8 enables raw_spinlock_t for LPM trie again after switching to
bpf memory allocator.
Patch #9: move test_lpm_map to map_tests to make it run regularly.
Patch #10: add more basic test cases for LPM trie.

Please see individual patches for more details. Comments are always
welcome.

Hou Tao (10):
  bpf: Remove unnecessary check when updating LPM trie
  bpf: Remove unnecessary kfree(im_node) in lpm_trie_update_elem
  bpf: Handle BPF_EXIST and BPF_NOEXIST for LPM trie
  bpf: Handle in-place update for full LPM trie correctly
  bpf: Fix exact match conditions in trie_get_next_key()
  bpf: Add bpf_mem_cache_is_mergeable() helper
  bpf: Switch to bpf mem allocator for LPM trie
  bpf: Use raw_spinlock_t for LPM trie
  selftests/bpf: Move test_lpm_map.c to map_tests
  selftests/bpf: Add more test cases for LPM trie

 include/linux/bpf_mem_alloc.h                 |   1 +
 kernel/bpf/lpm_trie.c                         | 158 +++++--
 kernel/bpf/memalloc.c                         |  12 +
 tools/testing/selftests/bpf/.gitignore        |   1 -
 tools/testing/selftests/bpf/Makefile          |   2 +-
 .../lpm_trie_map_basic_ops.c}                 | 401 +++++++++++++++++-
 6 files changed, 523 insertions(+), 52 deletions(-)
 rename tools/testing/selftests/bpf/{test_lpm_map.c => map_tests/lpm_trie_map_basic_ops.c} (64%)

-- 
2.29.2


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

end of thread, other threads:[~2024-11-23  3:30 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-18  1:07 [PATCH bpf-next 00/10] Fixes for LPM trie Hou Tao
2024-11-18  1:07 ` [PATCH bpf-next 01/10] bpf: Remove unnecessary check when updating " Hou Tao
2024-11-21 10:22   ` Toke Høiland-Jørgensen
2024-11-18  1:08 ` [PATCH bpf-next 02/10] bpf: Remove unnecessary kfree(im_node) in lpm_trie_update_elem Hou Tao
2024-11-21 10:25   ` Toke Høiland-Jørgensen
2024-11-18  1:08 ` [PATCH bpf-next 03/10] bpf: Handle BPF_EXIST and BPF_NOEXIST for LPM trie Hou Tao
2024-11-18 13:39   ` Thomas Weißschuh
2024-11-19  1:08     ` Hou Tao
2024-11-21 10:32   ` Toke Høiland-Jørgensen
2024-11-18  1:08 ` [PATCH bpf-next 04/10] bpf: Handle in-place update for full LPM trie correctly Hou Tao
2024-11-18 13:13   ` Sebastian Andrzej Siewior
2024-11-19  1:05     ` Hou Tao
2024-11-21 10:53   ` Toke Høiland-Jørgensen
2024-11-22  2:06     ` Hou Tao
2024-11-18  1:08 ` [PATCH bpf-next 05/10] bpf: Fix exact match conditions in trie_get_next_key() Hou Tao
2024-11-21 11:01   ` Toke Høiland-Jørgensen
2024-11-18  1:08 ` [PATCH bpf-next 06/10] bpf: Add bpf_mem_cache_is_mergeable() helper Hou Tao
2024-11-18 13:29   ` Thomas Weißschuh
2024-11-19  1:06     ` Hou Tao
2024-11-18  1:08 ` [PATCH bpf-next 07/10] bpf: Switch to bpf mem allocator for LPM trie Hou Tao
2024-11-18 13:30   ` Sebastian Andrzej Siewior
2024-11-18 16:56     ` Yonghong Song
2024-11-20  1:16   ` Alexei Starovoitov
2024-11-21  1:20     ` Hou Tao
2024-11-23  3:29       ` Alexei Starovoitov
2024-11-21 11:39   ` Toke Høiland-Jørgensen
2024-11-21 11:52     ` Thomas Weißschuh
2024-11-21 12:50       ` Toke Høiland-Jørgensen
2024-11-22  3:36         ` Hou Tao
2024-11-18  1:08 ` [PATCH bpf-next 08/10] bpf: Use raw_spinlock_t " Hou Tao
2024-11-18  1:08 ` [PATCH bpf-next 09/10] selftests/bpf: Move test_lpm_map.c to map_tests Hou Tao
2024-11-18  1:08 ` [PATCH bpf-next 10/10] selftests/bpf: Add more test cases for LPM trie Hou Tao
2024-11-18 17:46   ` Daniel Borkmann
2024-11-19  1:10     ` Hou Tao
     [not found] ` <46268aa9ef13a24388af833b17f6cef8bdd3a7be8402fec7640e65a2f1118468@mail.kernel.org>
2024-11-18  6:20   ` [PATCH bpf-next 00/10] Fixes " Hou Tao
2024-11-18 17:43     ` Daniel Xu
2024-11-19  1:09       ` Hou Tao
2024-11-18 15:39 ` Sebastian Andrzej Siewior
2024-11-19  1:35   ` Hou Tao
2024-11-19 14:15     ` Sebastian Andrzej Siewior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox