mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
libbpf: Recognize insn_array map type
Teach libbpf about the existence of the new instruction array map. Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com> Link: https://lore.kernel.org/r/20251105090410.1250500-4-a.s.protopopov@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
committed by
Alexei Starovoitov
parent
18a187bf25
commit
cbef91de02
@@ -190,6 +190,7 @@ static const char * const map_type_name[] = {
|
|||||||
[BPF_MAP_TYPE_USER_RINGBUF] = "user_ringbuf",
|
[BPF_MAP_TYPE_USER_RINGBUF] = "user_ringbuf",
|
||||||
[BPF_MAP_TYPE_CGRP_STORAGE] = "cgrp_storage",
|
[BPF_MAP_TYPE_CGRP_STORAGE] = "cgrp_storage",
|
||||||
[BPF_MAP_TYPE_ARENA] = "arena",
|
[BPF_MAP_TYPE_ARENA] = "arena",
|
||||||
|
[BPF_MAP_TYPE_INSN_ARRAY] = "insn_array",
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char * const prog_type_name[] = {
|
static const char * const prog_type_name[] = {
|
||||||
|
|||||||
@@ -364,6 +364,10 @@ static int probe_map_create(enum bpf_map_type map_type)
|
|||||||
case BPF_MAP_TYPE_SOCKHASH:
|
case BPF_MAP_TYPE_SOCKHASH:
|
||||||
case BPF_MAP_TYPE_REUSEPORT_SOCKARRAY:
|
case BPF_MAP_TYPE_REUSEPORT_SOCKARRAY:
|
||||||
break;
|
break;
|
||||||
|
case BPF_MAP_TYPE_INSN_ARRAY:
|
||||||
|
key_size = sizeof(__u32);
|
||||||
|
value_size = sizeof(struct bpf_insn_array_value);
|
||||||
|
break;
|
||||||
case BPF_MAP_TYPE_UNSPEC:
|
case BPF_MAP_TYPE_UNSPEC:
|
||||||
default:
|
default:
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|||||||
Reference in New Issue
Block a user