]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
libbpf: Recognize insn_array map type
authorAnton Protopopov <a.s.protopopov@gmail.com>
Wed, 5 Nov 2025 09:04:01 +0000 (09:04 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 6 Nov 2025 01:31:25 +0000 (17:31 -0800)
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>
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf_probes.c

index 27a07782bd72609159b5bd0ff70639a28207f50d..777c848ac0972cab6d289eeff1722f305a85191f 100644 (file)
@@ -190,6 +190,7 @@ static const char * const map_type_name[] = {
        [BPF_MAP_TYPE_USER_RINGBUF]             = "user_ringbuf",
        [BPF_MAP_TYPE_CGRP_STORAGE]             = "cgrp_storage",
        [BPF_MAP_TYPE_ARENA]                    = "arena",
+       [BPF_MAP_TYPE_INSN_ARRAY]               = "insn_array",
 };
 
 static const char * const prog_type_name[] = {
index 9dfbe7750f564ac2ad8b86a087ee708c88e97017..bccf4bb747e1d97b7d0408c9f97528b88c73281b 100644 (file)
@@ -364,6 +364,10 @@ static int probe_map_create(enum bpf_map_type map_type)
        case BPF_MAP_TYPE_SOCKHASH:
        case BPF_MAP_TYPE_REUSEPORT_SOCKARRAY:
                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:
        default:
                return -EOPNOTSUPP;