mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
libbpf: Support resizable hashtable
Add BPF_MAP_TYPE_RHASH to libbpf's map type name table and feature probing so that libbpf-based tools can create and identify resizable hash maps. Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com> Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com> Link: https://lore.kernel.org/r/20260605-rhash-v7-8-5b8e05f8630d@meta.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
parent
9dcbb5045f
commit
6e46ff0abe
|
|
@ -192,6 +192,7 @@ static const char * const map_type_name[] = {
|
|||
[BPF_MAP_TYPE_CGRP_STORAGE] = "cgrp_storage",
|
||||
[BPF_MAP_TYPE_ARENA] = "arena",
|
||||
[BPF_MAP_TYPE_INSN_ARRAY] = "insn_array",
|
||||
[BPF_MAP_TYPE_RHASH] = "rhash",
|
||||
};
|
||||
|
||||
static const char * const prog_type_name[] = {
|
||||
|
|
|
|||
|
|
@ -309,6 +309,9 @@ static int probe_map_create(enum bpf_map_type map_type)
|
|||
value_size = sizeof(__u64);
|
||||
opts.map_flags = BPF_F_NO_PREALLOC;
|
||||
break;
|
||||
case BPF_MAP_TYPE_RHASH:
|
||||
opts.map_flags = BPF_F_NO_PREALLOC;
|
||||
break;
|
||||
case BPF_MAP_TYPE_CGROUP_STORAGE:
|
||||
case BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE:
|
||||
key_size = sizeof(struct bpf_cgroup_storage_key);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user