Skip to content

bpf: introduce timeout hash map

Cong Wang bpf netdev 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest3 patches 11 repliesIn review
  2. v43 patches 1 replySuperseded
  3. v33 patches 0 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v25 patches21 repliesSuperseded
v13 patches5 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3bpf: introduce timeout hash mapinclude/linux/bpf_types.h include/uapi/linux/bpf.h kernel/bpf/hashtab.c +2 more+269 -1511 replies
2/3selftests/bpf: add test cases for bpf timeout maptools/testing/selftests/bpf/test_maps.c+68 -00 replies
3/3selftests/bpf: add timeout map check in map_ptr teststools/testing/selftests/bpf/progs/map_ptr_kern.c+20 -00 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchAndrey Ignatov
1/3
2/3
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [Patch bpf-next v5 0/3] bpf: introduce timeout hash map

From: Cong Wang <[email protected]>

This patchset introduces a new eBPF hash map whose elements have timeouts. Patch 1 is the implementation of timeout map, patch 2 adds some test cases for timeout map in test_maps, and patch 3 adds a test case in map ptr test. This patchset has been tested with the provided test cases for hours.

Please check each patch description for more details.

---
v5: add a lost piece of patch during rebase
fix the extra_elems corner case
add a stress test case

v4: merge gc_work into gc_idle_work to avoid a nasty race condition
fix a potential use-after-free
add one more test case
improve comments and update changelog

v3: move gc list from bucket to elem
reuse lru_node in struct htab_elem
drop patches which are no longer necessary
fix delete path
add a test case for delete path
add parallel test cases
change timeout to ms
drop batch ops

v2: fix hashmap ptr test
add a test case in map ptr test
factor out htab_timeout_map_alloc()

Cong Wang (3):
bpf: introduce timeout hash map selftests/bpf: add test cases for bpf timeout map selftests/bpf: add timeout map check in map_ptr tests

 include/linux/bpf_types.h                     |   1 +
 include/uapi/linux/bpf.h                      |   5 +-
 kernel/bpf/hashtab.c                          | 274 +++++++++++++++++-
 kernel/bpf/syscall.c                          |   3 +-
 tools/include/uapi/linux/bpf.h                |   1 +
 .../selftests/bpf/progs/map_ptr_kern.c        |  20 ++
 tools/testing/selftests/bpf/test_maps.c       |  68 +++++
 7 files changed, 357 insertions(+), 15 deletions(-)
Signature · 1 line
2.25.1