Skip to content

Commit

Permalink
selftests/bpf: Add test cases for hash map with dynptr key
Browse files Browse the repository at this point in the history
Add three positive test cases to test the basic operations on the
dynptr-keyed hash map. The basic operations include lookup, update,
delete and get_next_key. These operations are exercised both through
bpf syscall and bpf program. These three test cases use different map
keys. The first test case uses both bpf_dynptr and a struct with only
bpf_dynptr as map key, the second one uses a struct with an integer and
a bpf_dynptr as map key, and the last one use a struct with bpf_dynptr
being nested in another struct as map key.

Also add multiple negative test cases for dynptr-keyed hash map. These
test cases mainly check whether the layout of dynptr and non-dynptr in
the stack is matched with the definition of map->key_record.

Signed-off-by: Hou Tao <[email protected]>
  • Loading branch information
Hou Tao authored and Kernel Patches Daemon committed Jan 25, 2025
1 parent 664d6b0 commit 699a37e
Show file tree
Hide file tree
Showing 3 changed files with 1,026 additions and 0 deletions.
Loading

0 comments on commit 699a37e

Please sign in to comment.